/* ============================================================
   Smart Trip Planner - Responsive Overrides
   ============================================================ */

@media (max-width: 1199.98px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .dest-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-strip-inner { grid-template-columns: repeat(3, 1fr); }
  .summary-item { border-bottom: 1px solid var(--color-border-soft); }
  .summary-item:nth-child(3n) { border-right: 0; }
  .summary-item:not(:nth-child(3n)) { border-right: 1px solid var(--color-border-soft); }
}

@media (max-width: 991.98px) {
  .section-space { padding: 4.5rem 0; }
  .trip-builder-section { padding: 4.5rem 0; }
  .hero { min-height: auto; padding: 7rem 0 4rem; }
  .hero-orbit-scene { min-height: 540px; margin-top: 1.7rem; }
  .hero-traveler-wrap { width: min(320px, 54%); height: 90%; }
  .hero-mini-card { transform: scale(0.97); }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .trust-strip-row { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
  .trust-item + .trust-item { border-left: 0; }

  .generation-visual { min-height: 280px; }
  .generation-travel-stack { margin-top: 3rem; }
  .generation-step-text { font-size: 0.9rem; }

  .sticky-summary { position: static !important; top: auto !important; }

  .summary-strip-inner { grid-template-columns: repeat(2, 1fr); }
  .summary-item { border-right: 0 !important; border-bottom: 1px solid var(--color-border-soft); }
  .summary-item:nth-child(odd) { border-right: 1px solid var(--color-border-soft) !important; }

  .dashboard-header-top { flex-direction: column; align-items: stretch; }
  .dashboard-actions { width: 100%; flex-wrap: wrap; }
  .dashboard-actions .btn { flex: 1 1 calc(50% - 0.4rem); min-width: 0; }

  .chat-shell { max-height: none; min-height: min(62dvh, 540px); }
}

@media (max-width: 767.98px) {
  html { scroll-padding-top: calc(var(--stp-nav-h) + 12px); }

  .section-space { padding: 3.5rem 0; }
  .hero { padding: 6.1rem 0 3.5rem; }
  .hero-title { font-size: clamp(1.95rem, 8vw, 2.55rem); line-height: 1.18; }
  .hero-sub { font-size: 0.98rem; }
  .hero-cta { gap: 0.55rem; }
  .hero-cta .btn { width: 100%; }
  .hero-benefits li { font-size: 0.88rem; }
  .hero-orbit-scene { min-height: 490px; border-radius: 1.35rem; }
  .hero-traveler-wrap { width: min(290px, 62%); height: 88%; }
  .hero-object { width: 40px; height: 40px; font-size: 1rem; }
  .hero-mini-card { min-width: 130px; max-width: 172px; padding: 0.52rem 0.64rem; }
  .mc-value { font-size: 0.76rem; }
  .route-card     { top:  4%; right: 1%; }
  .hotel-card     { top: 35%; left: 1%; }
  .food-card      { top: 28%; right: 1%; }
  .itinerary-card { bottom: 12%; left: 4%; }
  .weather-card   { bottom:  8%; right: 4%; }
  .features-grid { grid-template-columns: 1fr; }
  .dest-grid { grid-template-columns: 1fr 1fr; }
  .trust-strip-row { grid-template-columns: 1fr; }
  .trust-item { justify-content: flex-start; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--color-border-soft); }
  .trust-item:last-child { border-bottom: 0; }

  .nav-spacer { height: clamp(70px, 16vw, 78px); }

  .chat-bubble { max-width: min(94%, 100%); }

  .summary-strip-inner { grid-template-columns: 1fr; }
  .summary-item:nth-child(odd) { border-right: 0 !important; }

  .dashboard-actions .btn { flex: 1 1 100%; }

  .timeline-day-card { grid-template-columns: 1fr; }
  .timeline-day-marker { justify-content: flex-start; margin-bottom: 0.35rem; }

  .builder-stepper { flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
  .stepper-line { display: none; }
  .stepper-node { min-width: calc(50% - 0.4rem); }
  .wizard-panels { min-height: 390px; }
  .wizard-actions { gap: 0.6rem; }
  .wizard-actions .btn { width: 100%; }
  .wizard-meta { gap: 0.4rem; align-items: flex-start !important; }

  .auth-card { padding: 1.6rem; }
  .auth-side { padding: 1.75rem; min-height: auto; }

  .page-header { gap: 1rem; flex-direction: column; align-items: stretch; }

  .chat-page-layout .input-group-lg { flex-direction: column; align-items: stretch; }
  .chat-page-layout .input-group-lg .form-control {
    border-radius: 0.75rem !important;
    min-height: var(--stp-touch-min);
  }
  .chat-page-layout .input-group-lg .btn {
    width: 100%; margin-top: 0.5rem;
    border-radius: 0.75rem !important;
    min-height: var(--stp-touch-min);
  }
  .chat-messages-panel { max-height: min(48vh, 440px); }

  .modal-dialog { margin: 0.85rem; max-width: calc(100vw - 1.7rem); }

  .footer-bottom { justify-content: center; text-align: center; }
}

@media (max-width: 575.98px) {
  .container { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
  .section-space { padding: 3rem 0; }
  .eyebrow { font-size: 0.72rem; letter-spacing: 0.16em; }
  .hero-title { font-size: clamp(1.75rem, 8.7vw, 2.35rem); }
  .hero-tag { font-size: 0.67rem; padding: 0.42rem 0.75rem; }
  .hero-orbit-scene { min-height: 420px; margin-top: 1.1rem; }
  .hero-traveler-wrap { width: min(250px, 64%); height: 84%; }
  .hero-mini-card { min-width: 118px; max-width: 148px; padding: 0.48rem 0.58rem; border-radius: 0.75rem; }
  .mc-label { font-size: 0.58rem; }
  .mc-value { font-size: 0.72rem; }
  /* Hide less critical objects on mobile */
  .hero-passport-obj,
  .hero-suitcase-obj { display: none; }
  /* Hide hotel + food cards, keep route + itinerary + weather */
  .hotel-card,
  .food-card { display: none; }
  .route-card    { top: 6%; right: 1%; }
  .itinerary-card { bottom: 10%; left: 3%; max-width: 138px; }
  .weather-card  { bottom: 8%; right: 3%; min-width: 108px; }

  .form-control, .form-select {
    font-size: var(--stp-font-form-mobile);
    min-height: 2.85rem;
  }
  textarea.form-control { min-height: 6rem; }

  .interest-grid { gap: 0.4rem; }
  .activity-chip { padding: 0.5rem 0.85rem; }

  .dashboard-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; width: 100%; }
  .dashboard-actions .btn { width: 100%; min-height: var(--stp-touch-min); font-size: 0.88rem; grid-column: auto; }
  .dashboard-actions #btnCopyShare { grid-column: 1 / -1; }
  .wizard-panels { min-height: 360px; }
  .stepper-node { min-width: calc(50% - 0.45rem); }
  .stepper-node span { width: 2.15rem; height: 2.15rem; border-radius: 0.7rem; }
  .stepper-node small { font-size: 0.67rem; letter-spacing: 0.04em; }

  .trip-grid { grid-template-columns: 1fr; }
  .dest-grid { grid-template-columns: 1fr; }

  .page-share-intro { flex-direction: column; align-items: stretch !important; text-align: center; }
  .page-share-intro .btn { width: 100%; }

  #toastContainer {
    left: 0.75rem; right: 0.75rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  }

  .rec-thumb { width: 42px; height: 42px; font-size: 1rem; }
  .chat-page-layout #quickPrompts { gap: 0.4rem; }
  .chat-page-layout .chat-prompt { font-size: 0.82rem; }
  .refine-chips .btn { font-size: 0.82rem; flex: 1 1 calc(50% - 0.4rem); }

}

@media (max-width: 380px) {
  .hero-orbit-scene { min-height: 380px; }
  .hero-mini-card { min-width: 106px; max-width: 126px; }
  .itinerary-card { max-width: 120px; }
  .hero-ticket-obj,
  .hero-pin-obj { display: none; }
  .wizard-panels { min-height: 335px; }
  .stepper-node { min-width: 100%; }
  .generation-card { padding: 1.25rem 1rem !important; }
}

@media (max-width: 425px) {
  .site-footer .container.py-5 {
    padding-top: 2.55rem !important;
    padding-bottom: 2rem !important;
  }
}

@media (max-width: 359.98px) {
  .stp-navbar .navbar-brand {
    font-size: 1rem;
    max-width: calc(100vw - 5.75rem);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
}

@media (min-width: 992px) {
  .page-generated #generatedPlanLayout .col-lg-4 { align-self: flex-start; }
}
