/* ==========================================================================
   Dreamspree — Responsive rules (v2)
   Breakpoints: 1440 (large desktop) · 1024 (laptop) · 768 (tablet) · 390 / 360 (mobile)
   ========================================================================== */

@media (min-width: 1440px) {
  :root { --container: 1280px; }
}

/* ---------- Compact header on laptops ---------- */
@media (max-width: 1280px) and (min-width: 1024px) {
  .nav__link { padding: 8px 8px; font-size: 0.82rem; white-space: nowrap; }
  .site-header__inner { gap: var(--s-4); }
  .nav__link::after { left: 8px; right: 8px; }
  .cart-btn__label { display: none; }
  .cart-btn { padding: 0 10px; }
  .header-actions .btn--consult { padding-inline: var(--s-4); font-size: var(--fs-xs); }
  .brand__logo { height: 36px; }
}
@media (max-width: 1180px) and (min-width: 1024px) {
  .nav__link[data-nav="services"] { display: none; }
}

/* ---------- Laptop & below ---------- */
@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dest-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
  .footer-grid .footer-col:last-child { grid-column: 1 / -1; }
  .pkg-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-6); }
  .explore-layout { grid-template-columns: 250px minmax(0, 1fr); gap: var(--s-5); }
  .cart-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); gap: var(--s-5); }
  .complete-trip__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-form, .search-form--transport { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
  .search-form .search-form__submit { grid-column: 1 / -1; }
}

/* ---------- Tablet & below ---------- */
@media (max-width: 1023px) {
  :root { --header-h: 62px; }
  /* Portrait crops put bright rock behind the copy: heavier scrim on tablets and phones */
  .hero__media::after { background: linear-gradient(180deg, rgba(var(--scrim-rgb),0.55) 0%, rgba(var(--scrim-rgb),0.6) 30%, rgba(var(--scrim-rgb),0.8) 60%, rgba(var(--scrim-rgb),0.93) 100%); }
  .hero__tab { width: 96px; }
  .nav { display: none; }
  .header-actions .btn--consult { display: none; }
  .nav-toggle { display: grid; }
  .hero { min-height: 72vh; padding-top: calc(var(--header-h) + var(--s-10)); padding-bottom: calc(var(--s-16) + var(--s-8)); }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trust-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-5); }
  .steps::before { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); gap: var(--s-8); }
  .split .media-stack { max-width: 520px; margin: 0 auto; }
  .cta-band__grid { grid-template-columns: minmax(0, 1fr); }
  .verify-steps, .values { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

  /* Package detail: single column, booking panel in flow, mobile bar visible */
  .pkg-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .booking { position: static; }
  .gallery { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 200px 140px; }
  .gallery__item:first-child { grid-row: 1; grid-column: 1 / -1; }
  .gallery__item:nth-child(n+4) { display: none; }
  .mobile-bar { display: flex; }
  body.has-mobile-bar { padding-bottom: 84px; }
  body.has-mobile-bar .toasts { bottom: 96px; }

  /* Explore: filters become a collapsible panel */
  .explore-layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; max-height: none; display: none; }
  .filters.is-open { display: grid; }
  .filters-toggle { display: inline-flex; }

  /* Trip builder: summary moves above the list as a collapsible card; sticky bar carries the total */
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .cart-summary { position: static; }
  /* Header cart: icon with a count badge */
  .cart-btn { width: 42px; height: 42px; padding: 0; justify-content: center; border-color: transparent; }
  .cart-btn svg { width: 22px; height: 22px; }
  .cart-btn__label { display: none; }
  .cart-btn .cart-btn__count { position: absolute; top: 0; right: -2px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  :root { --section-y: clamp(2.25rem, 1.8rem + 2vw, 3.25rem); }
  h1 { font-size: clamp(2.1rem, 1.5rem + 4vw, 2.9rem); }
  .section-head { flex-direction: column; align-items: flex-start; margin-bottom: var(--s-6); }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .dest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
  .dest-card__body { padding: var(--s-10) var(--s-3) var(--s-3); }
  .dest-card__name { font-size: 1.25rem; }
  .dest-card__tag { font-size: var(--fs-xs); }
  .dest-card__meta { font-size: var(--fs-xs); margin-top: var(--s-2); padding-top: var(--s-2); }
  .dest-card__arrow { width: 30px; height: 30px; }
  .dest-card__arrow svg { width: var(--icon-sm); height: var(--icon-sm); }
  .dest-card__top .badge { padding: 4px 8px; font-size: 11px; }
  .dest-intro { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dest-intro__media { min-height: 0; aspect-ratio: 16 / 7; }
  .dest-intro__body { padding: var(--s-4); }
  /* Hint that the service tabs scroll sideways */
  .search-tabs { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .hero { min-height: 0; padding-top: calc(var(--header-h) + var(--s-12)); padding-bottom: calc(var(--s-16) + var(--s-8)); }
  .hero__lede { font-size: var(--fs-base); }
  .hero__controls { margin-top: var(--s-6); align-items: center; }
  .hero__tab { width: 34px; min-height: 44px; justify-content: center; }
  .hero__tab[aria-current="true"] { width: 56px; }
  .hero__tab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hero__price { margin-bottom: var(--s-4); }
  .hero__ctas .btn { flex: 1 1 auto; }
  .search-widget--float { margin-top: calc(-1 * var(--s-12)); border-radius: var(--r-lg); }
  .search-panel { padding: var(--s-4); }
  .search-form, .search-form--service, .search-form--transport { grid-template-columns: minmax(0, 1fr); }
  .search-tabs { border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .search-form .seg--type { width: 100%; }
  /* One benefit per row on phones: icon left, copy right, no cramped two-column wrapping */
  .trust-row { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); padding: var(--s-5) 0; }
  .trust-row .feature { flex-direction: row; gap: var(--s-3); }
  .trust-row .feature__icon { width: 44px; height: 44px; }
  .trust-row p { font-size: var(--fs-sm); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--s-4); text-align: left; align-items: start; }
  .step__num { margin: 0; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .footer-grid .footer-col:last-child { grid-column: auto; }
  .footer-bottom { flex-direction: column; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .modal { padding: 0; align-items: flex-end; }
  .modal__dialog { width: 100%; max-height: 92vh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .modal__head, .modal__body { padding-left: var(--s-4); padding-right: var(--s-4); }
  .page-head { padding-block: var(--s-5); }
  .page-head h1 { font-size: var(--fs-xl); }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1 1 auto; }
  .pkg-head h1 { font-size: var(--fs-xl); }
  .pkg-head__actions { width: 100%; }
  .pkg-head__actions .btn { flex: 1 1 auto; }
  .gallery { grid-template-rows: 190px 110px; gap: var(--s-1); border-radius: var(--r-lg); }
  .highlights, .incl-grid { grid-template-columns: minmax(0, 1fr); }
  .acc-panel__inner { padding-left: var(--s-4); }
  .acc-btn { padding: var(--s-3); gap: var(--s-3); }
  .dest-choice { grid-template-columns: minmax(0, 1fr); }
  .dest-choice__btn { aspect-ratio: 16 / 8; }
  .radio-cards--3 { grid-template-columns: minmax(0, 1fr); }
  .visa-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stepper__label { display: none; }
  .stepper li.is-active .stepper__label { display: inline; }
  .visa-step__foot { flex-direction: column-reverse; }
  .visa-step__foot .btn, .visa-step__foot .cluster { width: 100%; }
  .visa-step__foot .cluster .btn { flex: 1 1 auto; }
  .cart-line { grid-template-columns: 76px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3); }
  .cart-line__media img, .cart-line__media .cart-icon-tile { width: 76px; height: 76px; }
  .cart-line__media .cart-icon-tile svg { width: 30px; height: 30px; }
  .cart-line__top { flex-direction: column; gap: var(--s-2); }
  .cart-line__price { max-width: none; text-align: left; }
  .cart-line__actions { grid-column: 1 / -1; }
  .complete-trip__grid { grid-template-columns: minmax(0, 1fr); }
  .checkout { padding: var(--s-4); }
  .checkout__foot .btn--lg { width: 100%; }
  .cart-drawer__ctas { grid-template-columns: minmax(0, 1fr); }
  .page-head--cart .checkout-steps { width: 100%; }
  .verify-steps, .values { grid-template-columns: minmax(0, 1fr); }
  .media-stack__float { right: 0; width: 44%; }
  .media-stack__tag { left: 0; }
  .cta-band { border-radius: var(--r-lg); }
  .results-bar { align-items: flex-start; }
  .pkg-card--row { flex-direction: column; }
  .pkg-card--row .card__media { width: 100%; aspect-ratio: 4 / 3; }
  .drawer__panel { width: min(340px, 90vw); }
  .toast { font-size: var(--fs-xs); }
  .visa-preview { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Small mobile ---------- */
@media (max-width: 380px) {
  .btn { padding-inline: var(--s-4); }
  .hero__title { font-size: 2.1rem; }
  .visa-summary { grid-template-columns: minmax(0, 1fr); }
  .brand__logo { height: 34px; }
  .checkout-steps li { font-size: var(--fs-xs); }
  .checkout-steps li + li::before { width: 12px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .card:hover, .dest-card:hover, .service-card:hover, .btn:hover, .icon-btn:hover, .chip:hover { transform: none; }
  .card:hover .card__media img, .dest-card:hover img, .service-card:hover img, .gallery__item:hover img { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .mobile-bar, .toasts, .modal, .drawer, .btn { display: none !important; }
  .pkg-layout { grid-template-columns: minmax(0, 1fr); }
  .acc-panel { height: auto !important; }
}

/* Mini cart takes the full screen on phones */
@media (max-width: 767px) {
  .cart-drawer .cart-drawer__panel { width: 100vw; }
  .cart-drawer__head, .cart-drawer__foot { padding-inline: var(--s-4); }
  .cart-drawer__body { padding-inline: var(--s-4); }
  .mini-item { margin-inline: calc(-1 * var(--s-4)); padding-inline: var(--s-4); }
}

/* ---------- Search v3: date picker, place search, departures, custom trips ---------- */
@media (max-width: 1023px) {
  .custom-band { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
}
@media (max-width: 767px) {
  /* Fields are full width on phones: the date picker matches the field instead of overhanging */
  .search-form .when__pop, .search-form .when__pop--right { left: 0; right: 0; width: auto; }
  .search-form__alt { width: 100%; }
  .search-form__alt > span { flex: 1; }
  .multi-row, .multi-row--hotel, .multi-row--transport, .multi-row--visa, .multi-row--flight { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-top: 44px; }
  .multi-row__n { position: absolute; top: 10px; left: 12px; margin: 0; }
  .multi-row .combo, .multi-row--hotel > .field:last-of-type, .multi-row--transport > .field:first-of-type, .multi-row--visa > .field:first-of-type { grid-column: 1 / -1; }
  .multi-row__ret[hidden] { display: none; }
  .multi-row__rm { position: absolute; top: 4px; right: 4px; margin: 0; }
  .multi-form__shared { grid-template-columns: minmax(0, 1fr); }
  .incl-pick__grid, .custom-band__card .incl-pick__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .incl-chip span { font-size: var(--fs-xs); padding: 9px 10px; }
  .custom-band__card { padding: var(--s-4); }
}
@media (max-width: 400px) {
  .dep-opt { grid-template-columns: 18px minmax(0, 1fr); }
  .dep-opt__note { grid-column: 2; text-align: left; max-width: none; }
  .dep-custom__fields, .when__dates { grid-template-columns: minmax(0, 1fr); }
}
