/* ============================================================
   Mobile fixes for the website UI kit.
   Targets inline-styled grids and section padding with
   !important so we don't have to refactor every component.
   Breakpoints at 760px and 420px.
   ============================================================ */

/* clip (not hidden) prevents horizontal scroll without turning html/body
   into a scroll container, which would silently break position: sticky. */
html, body { overflow-x: clip; }

/* ============================================================
   Energy layer: navy / gold / linen only.
   Keeps the existing layout, adds warmer depth and playful motion.
   ============================================================ */
:root {
  --gold-soft: rgba(212, 166, 86, 0.16);
  --gold-line: rgba(212, 166, 86, 0.48);
  --gold-glow: rgba(212, 166, 86, 0.28);
  --navy-glow: rgba(15, 31, 51, 0.18);
  --linen-warm: #FBF7EE;
}

::selection {
  background: rgba(212, 166, 86, 0.32);
  color: var(--ink);
}

.btn {
  overflow: hidden;
  transform: translateZ(0);
  transition:
    transform var(--dur) var(--ease),
    background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease) !important;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.22) 44%, transparent 58%);
  transform: translateX(-120%);
  transition: transform 520ms var(--ease);
  pointer-events: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:hover::before {
  transform: translateX(120%);
}

.btn--primary {
  background: linear-gradient(135deg, #e0bc74 0%, #d4a656 60%, #c2933f 100%) !important;
  color: var(--ink) !important;
  border-color: #b8862e !important;
  box-shadow: 0 12px 28px rgba(212,166,86,0.34), inset 0 1px 0 rgba(255,255,255,0.35);
}

.btn--primary:hover {
  background: linear-gradient(135deg, #d9b061 0%, #c2933f 100%) !important;
  box-shadow: 0 16px 34px rgba(190,140,46,0.32), 0 0 0 4px var(--gold-soft);
}

.btn--secondary {
  background: linear-gradient(135deg, #fff 0%, var(--linen-warm) 100%) !important;
  border-color: var(--gold-line) !important;
  color: var(--ink) !important;
  box-shadow: 0 8px 20px rgba(15,31,51,0.07);
}

.btn--secondary:hover {
  background: linear-gradient(135deg, var(--surface-band) 0%, rgba(212,166,86,0.22) 100%) !important;
  border-color: var(--sand) !important;
  color: var(--ink) !important;
  box-shadow: 0 14px 28px rgba(15,31,51,0.12), 0 0 0 4px var(--gold-soft);
}

[data-enquire-panel],
[data-tour-option-card],
[data-route-card],
[data-highlight-card] {
  border-color: rgba(212,166,86,0.34) !important;
}

[data-tour-option-card],
[data-route-card] {
  box-shadow: 0 18px 46px rgba(15,31,51,0.08), 0 0 0 1px rgba(212,166,86,0.08) !important;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease) !important;
}

[data-tour-option-card]:hover,
[data-route-card]:hover {
  transform: translateY(-3px);
  border-color: var(--gold-line) !important;
  box-shadow: 0 24px 58px rgba(15,31,51,0.13), 0 0 0 5px var(--gold-soft) !important;
}

[data-highlight-card] {
  box-shadow: 0 8px 18px rgba(15,31,51,0.045);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease) !important;
}

[data-highlight-card]:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15,31,51,0.08);
}

[data-route-photo-strip] {
  scrollbar-width: none;
}

[data-route-photo-strip]::-webkit-scrollbar {
  display: none;
}

[data-section-rhythm="home-reviews"] {
  padding-top: 104px !important;
  padding-bottom: 88px !important;
}

[data-section-rhythm="home-faq"],
[data-section-rhythm="home-instagram"] {
  padding-top: 88px !important;
  padding-bottom: 88px !important;
}

[data-section-rhythm="maps"] {
  padding-top: 104px !important;
  padding-bottom: 48px !important;
}

[data-crew-section] {
  padding-top: 56px !important;
  padding-bottom: 104px !important;
}

[data-section-rhythm="page-intro"] {
  padding-bottom: 32px !important;
}

[data-section-rhythm="page-content"] {
  padding-top: 24px !important;
  padding-bottom: 104px !important;
}

[data-section-rhythm="route-intro"] {
  padding-bottom: 24px !important;
}

[data-section-rhythm="route-detail"] {
  padding-top: 24px !important;
  padding-bottom: 96px !important;
}

[data-section-rhythm="route-cta"] {
  padding-top: 80px !important;
  padding-bottom: 80px !important;
}

[data-section-rhythm="closing-stack"] {
  margin-top: 48px !important;
  padding-top: 24px !important;
}

[data-tb="banner"] {
  background: linear-gradient(90deg, var(--ink) 0%, #173152 50%, var(--ink) 100%) !important;
}

main > section[style*="var(--surface-band)"] {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(212,166,86,0.10) 100%),
    var(--surface-band) !important;
}

.wa-float {
  box-shadow: 0 12px 30px rgba(37,211,102,0.26), 0 0 0 4px rgba(212,166,86,0.18) !important;
}

.wa-float {
  isolation: isolate;
}
.wa-float::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.44);
  animation: wa-pulse 2200ms ease-out infinite;
  z-index: -1;
}

@keyframes wa-pulse {
  0% { transform: scale(1); opacity: 0.85; box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.44); }
  70% { transform: scale(1.18); opacity: 0; box-shadow: 0 0 0 18px rgba(37, 211, 102, 0); }
  100% { transform: scale(1.18); opacity: 0; box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .wa-float::before { animation: none; }
  .btn,
  .btn::before,
  [data-tour-option-card],
  [data-route-card],
  [data-highlight-card] {
    transition: none !important;
  }
  .btn:hover,
  [data-tour-option-card]:hover,
  [data-route-card]:hover,
  [data-highlight-card]:hover {
    transform: none !important;
  }
}

/* ----- 760px and down: tablet / phone ----- */
@media (max-width: 760px) {

  /* ------ Section padding ------ */
  main section,
  footer {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
  main > section {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }

  [data-section-rhythm="home-reviews"] {
    padding-top: 48px !important;
    padding-bottom: 42px !important;
  }

  [data-section-rhythm="home-faq"] {
    padding-top: 36px !important;
    padding-bottom: 42px !important;
  }

  [data-section-rhythm="home-instagram"] {
    padding-top: 36px !important;
    padding-bottom: 50px !important;
  }

  [data-section-rhythm="maps"] {
    padding-top: 50px !important;
    padding-bottom: 34px !important;
  }

  [data-crew-section] {
    padding-top: 38px !important;
    padding-bottom: 54px !important;
  }

  [data-crew-portrait-home="true"] {
    display: none !important;
  }

  [data-section-rhythm="page-intro"] {
    padding-bottom: 28px !important;
  }

  [data-section-rhythm="page-content"] {
    padding-top: 22px !important;
    padding-bottom: 54px !important;
  }

  [data-section-rhythm="route-intro"] {
    padding-bottom: 24px !important;
  }

  [data-section-rhythm="route-detail"] {
    padding-top: 22px !important;
    padding-bottom: 54px !important;
  }

  [data-section-rhythm="route-cta"] {
    padding-top: 50px !important;
    padding-bottom: 50px !important;
  }

  [data-section-rhythm="closing-stack"] {
    margin-top: 40px !important;
    padding-top: 22px !important;
  }

  /* ------ All inline multi-column grids → single column ------ */
  main [style*="grid-template-columns"]:not([data-keep-cols]),
  footer [style*="grid-template-columns"]:not([data-keep-cols]) {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  /* ------ Headlines ------ */
  main h1 {
    font-size: clamp(34px, 9vw, 44px) !important;
    line-height: 1.08 !important;
  }
  main section h2 {
    font-size: clamp(26px, 7vw, 32px) !important;
    line-height: 1.12 !important;
  }
  main h3 { font-size: clamp(18px, 5vw, 22px) !important; line-height: 1.2 !important; }
  main > section:first-of-type h1 {
    font-size: clamp(36px, 11vw, 56px) !important;
  }

  /* ------ Hero shrink ------ */
  main > section:first-of-type {
    min-height: auto !important;
    padding-top: 80px !important;
    padding-bottom: 56px !important;
  }
  /* Header is a solid white bar on mobile (not a transparent overlay), so the
     hero must sit cleanly below it — no negative margin pulling it up behind
     the header, which previously bled through under the support banner. */
  main > section[data-hero-section] {
    margin-top: 0 !important;
    padding-top: 56px !important;
  }
  main > section[data-section-rhythm="page-intro"] {
    padding-bottom: 28px !important;
  }
  main > section[data-section-rhythm="route-intro"] {
    padding-bottom: 24px !important;
  }
  main > section:first-of-type p {
    font-size: 16px !important;
    line-height: 1.6 !important;
  }

  /* ------ Booking widget / enquire panel full-width ------ */
  main [style*="max-width: 420"],
  main [style*="maxWidth: 420"],
  main [style*="max-width: 360"],
  main [style*="maxWidth: 360"] {
    max-width: 100% !important;
  }

  /* ------ Sticky panels (route map, booking widget) → static ------ */
  main [style*="position: sticky"] {
    position: static !important;
    top: auto !important;
  }

  [data-route-hero] {
    min-height: 0 !important;
  }

  [data-route-media] {
    min-height: 370px !important;
  }

  [data-route-booking-panel] {
    padding: 28px 20px !important;
  }

  [data-route-title] {
    font-size: clamp(33px, 9vw, 44px) !important;
    line-height: 1.05 !important;
  }

  [data-route-body] {
    padding: 24px 18px 34px !important;
  }

  [data-route-photo-strip] {
    margin-left: -18px !important;
    margin-right: -18px !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  [data-route-photo-button] {
    flex-basis: 74% !important;
    min-width: 74% !important;
  }

  [data-route-switcher] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 5px !important;
    border-radius: 18px !important;
  }

  [data-route-switcher] button {
    min-height: 74px !important;
    border-radius: 15px !important;
    padding: 11px 10px !important;
  }

  [data-route-section-title] {
    font-size: clamp(26px, 7vw, 34px) !important;
    line-height: 1.08 !important;
  }

  [data-route-step] {
    grid-template-columns: 40px 1fr !important;
    gap: 12px !important;
    padding-right: 0 !important;
  }

  [data-route-index] {
    width: 40px !important;
    height: 40px !important;
  }

  [data-route-map-card] {
    border-radius: 12px !important;
    margin-top: 18px !important;
  }

  [data-route-layout] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 22px !important;
  }

  [data-route-sticky] {
    position: fixed !important;
    left: 12px !important;
    /* Leave the bottom-right corner free for the WhatsApp float so the two
       fixed elements sit side by side instead of overlapping. */
    right: 84px !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    top: auto !important;
    z-index: 34 !important;
    width: auto !important;
    max-width: none !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 12px !important;
    border-radius: 16px !important;
    background: rgba(255,255,255,0.94) !important;
    backdrop-filter: blur(18px) saturate(150%) !important;
    box-shadow: 0 16px 42px rgba(15,31,51,0.18), 0 0 0 1px rgba(212,166,86,0.28) !important;
  }

  [data-route-booking-title] {
    font-family: var(--font-body) !important;
    font-size: 15px !important;
    line-height: 19px !important;
    font-weight: 900 !important;
    margin: 0 !important;
  }

  [data-route-booking-specs],
  [data-route-booking-note] {
    display: none !important;
  }

  [data-route-sticky] .btn {
    width: auto !important;
    min-height: 50px !important;
    padding: 12px 14px !important;
    font-size: 13px !important;
  }

  [data-routes-screen] {
    padding-bottom: 104px !important;
  }

  [data-inclusion-pair] {
    gap: 10px !important;
  }

  /* ------ TopBar — hide entirely on mobile ------ */
  /* (The TopBar component gets a data-tb tag so we can target it
     without the nth-child gymnastics that was hiding the App wrapper.) */
  [data-tb="topbar"] {
    display: none !important;
  }

  /* ------ Support banner — keep visible but compact ------ */
  [data-tb="banner"] {
    overflow: hidden !important;
  }
  [data-banner-inner] {
    padding: 6px 6px !important;
    font-size: clamp(9px, 2.5vw, 10px) !important;
    letter-spacing: 0.035em !important;
    line-height: 12px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* ------ Header / Nav ------ */
  /* Solid white bar on mobile, and NOT sticky — it scrolls away with the
     page instead of following the user down. */
  header,
  header[data-scrolled] {
    position: static !important;
    background: rgba(255,255,255,0.96) !important;
    border-bottom: 1px solid var(--hairline) !important;
    backdrop-filter: saturate(140%) blur(10px) !important;
  }
  header > div {
    gap: 10px !important;
    padding: 10px 14px !important;
  }
  [data-mobile-tools] {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }
  /* Show the hamburger */
  [data-hamburger] {
    display: inline-flex !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
  }
  /* Hide desktop nav links + desktop actions (lang + book button) */
  [data-desktop-nav] { display: none !important; }
  [data-desktop-actions] { display: none !important; }
  [data-mobile-lang] {
    display: inline-flex !important;
    flex-shrink: 0 !important;
  }
  [data-brand-link] {
    min-width: 0 !important;
    flex: 1 !important;
    align-items: center !important;
    text-align: left !important;
    min-height: 44px !important;
    justify-content: flex-start !important;
  }
  /* Keep the real SVG logo on the white bar (dark logo reads fine on white). */
  [data-brand-logo] {
    display: block !important;
    width: min(48vw, 178px) !important;
    height: auto !important;
  }
  [data-brand-wordmark] {
    display: none !important;
  }
  [data-brand-subtitle] {
    display: none !important;
  }
  [data-lang-option] {
    min-width: 44px !important;
    min-height: 44px !important;
  }

  /* ------ Support banner (ALL CAPS bold) — readable ------ */
  /* (handled by [data-tb="banner"] rule above; kept here as a no-op
     to preserve file layout) */

  /* ------ Tour card image aspect ------ */
  main article [style*="aspect-ratio: 4 / 3"],
  main [style*="aspectRatio: '4 / 3'"] {
    aspect-ratio: 16 / 11 !important;
  }

  /* ------ Voices clips ------ */
  main [style*="aspect-ratio: 9 / 16"],
  main [style*="aspectRatio: '9 / 16'"] {
    aspect-ratio: 4 / 5 !important;
  }

  /* ------ Instagram tiles 6 → 3 ------ */
  main [style*="repeat(6"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* ------ Modal: bottom sheet ------ */
  [data-booking-modal] {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  [data-booking-modal] > div {
    max-width: 100% !important;
    width: 100% !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    max-height: 92vh !important;
  }
  [data-booking-modal] > div > div {
    padding: 28px 20px !important;
  }
  [data-booking-modal] [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  [data-booking-modal] h2 {
    font-size: 22px !important;
    line-height: 1.18 !important;
  }
  [data-booking-modal] p {
    font-size: 16px !important;
    line-height: 24px !important;
  }

  /* ------ Hairline gaps ------ */
  main [style*="gap: 80"],
  main [style*="gap: 64"],
  footer [style*="gap: 48"] {
    gap: 28px !important;
  }

  /* ------ WhatsApp floating button — bottom-right corner at any depth ------ */
  button.wa-float[style*="position: fixed"] {
    width: 58px !important;
    height: 58px !important;
    right: 16px !important;
    bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  }

  /* ------ Image containers: prevent overflow ------ */
  main img, main video {
    max-width: 100% !important;
    height: auto !important;
  }
  [data-gallery-media] {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  main p {
    font-size: 16px !important;
    line-height: 26px !important;
  }
  main video[data-cover-video] {
    max-width: none !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  .mobile-carousel {
    display: flex !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 16px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 0 10px !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mobile-carousel::-webkit-scrollbar {
    display: none;
  }
  .mobile-carousel__item {
    flex: 0 0 84% !important;
    min-width: 0 !important;
    scroll-snap-align: start;
  }
  .mobile-carousel--videos .mobile-carousel__item {
    flex-basis: 84% !important;
  }
  .mobile-carousel--instagram .mobile-carousel__item {
    flex-basis: 84% !important;
  }

  /* ------ "Free flow" wrappers with hard widths ------ */
  main [style*="max-width: 1280"],
  main [style*="max-width: 1200"],
  main [style*="max-width: 980"] {
    max-width: 100% !important;
  }

  /* ------ Meta / spec rows that flex horizontal: wrap ------ */
  main [style*="display: flex"][style*="gap: 36"],
  main [style*="display: flex"][style*="gap: 28"] {
    flex-wrap: wrap !important;
  }
}

/* ----- 420px and down: very narrow phones ----- */
@media (max-width: 420px) {
  main > section {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  [data-section-rhythm="home-reviews"] {
    padding-top: 44px !important;
    padding-bottom: 36px !important;
  }
  [data-section-rhythm="home-faq"],
  [data-section-rhythm="home-instagram"] {
    padding-top: 32px !important;
  }
  [data-section-rhythm="maps"] {
    padding-bottom: 30px !important;
  }
  [data-crew-section] {
    padding-top: 34px !important;
  }
  [data-section-rhythm="page-content"],
  [data-section-rhythm="route-detail"] {
    padding-top: 20px !important;
  }
  main > section[data-section-rhythm="page-intro"] {
    padding-bottom: 24px !important;
  }
  main > section[data-section-rhythm="route-intro"] {
    padding-bottom: 22px !important;
  }
  main > section:first-of-type h1 {
    font-size: clamp(30px, 10vw, 44px) !important;
  }
  header > div {
    padding: 10px 12px !important;
  }
  header svg {
    width: 28px !important;
    height: 28px !important;
  }
  /* Itinerary numerals 56px → 44px */
  main [style*="width: 56"][style*="border-radius: 999"] {
    width: 44px !important;
    height: 44px !important;
    font-size: 16px !important;
  }
}
