/**
 * SkyStayTravel — mobile bottom tab bar (≤760px only)
 */
:root {
  --sst-bottom-nav-h: 64px;
  --sst-bottom-nav-safe: env(safe-area-inset-bottom, 0px);
  --sst-bottom-nav-stack: calc(var(--sst-bottom-nav-h) + var(--sst-bottom-nav-safe));
}

.sst-bottom-nav {
  display: none;
}

@media (max-width: 760px) {
  .sst-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    position: fixed;
    left: 0;
    right: 0;
    top: auto !important;
    bottom: 0 !important;
    inset: auto 0 0 0 !important;
    z-index: 8900;
    width: 100%;
    max-width: 100vw;
    height: auto !important;
    min-height: var(--sst-bottom-nav-stack);
    max-height: none !important;
    padding: 4px 4px calc(4px + var(--sst-bottom-nav-safe));
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.97) !important;
    background-image: none !important;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
    border-bottom: 0 !important;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  color: #334155;
  transform: none !important;
  overflow: hidden;
  box-sizing: border-box;
}

  body.sst-has-bottom-nav {
    padding-bottom: calc(var(--sst-bottom-nav-stack) + 8px) !important;
  }

  /* Utility shells reuse homepage CSS (padding-top:0 for hero) — restore header clearance */
  body.sst-page-guides.sst-page-home,
  body.sst-page-search.sst-page-home {
    padding-top: var(--sst-nav-stack-h, var(--sst-nav-h, 54px)) !important;
    overflow-x: clip;
  }

  body.sst-page-guides .home-main,
  body.sst-page-search .sst-search-page {
    padding-top: 8px;
  }

  body.sst-page-guides .sst-guides-intro {
    padding-top: 12px;
  }

  /* Keep top header visible on utility shells (avoids jump while using bottom tabs) */
  body.sst-page-guides .sst-commercial-nav.nav-hidden,
  body.sst-page-search .sst-commercial-nav.nav-hidden,
  body.sst-page-ai .sst-commercial-nav.nav-hidden {
    transform: none !important;
    -webkit-transform: none !important;
  }

  /* Route sticky CTA sits fully above the tab bar */
  body.sst-has-bottom-nav .sst-route-sticky-cta {
    bottom: var(--sst-bottom-nav-stack) !important;
    z-index: 8800;
    padding-bottom: 10px !important;
  }

  body.sst-has-bottom-nav.sst-route-sticky-on {
    padding-bottom: calc(var(--sst-bottom-nav-stack) + 74px) !important;
  }

  /* Cookie card sits above the tab bar while visible */
  body.sst-has-bottom-nav .sst-cookie-banner {
    bottom: calc(10px + var(--sst-bottom-nav-stack)) !important;
    z-index: 10000;
  }

  body.sst-cookie-open.sst-has-bottom-nav {
    scroll-padding-bottom: calc(var(--sst-bottom-nav-stack) + min(36vh, 200px) + 12px);
  }

  /* The consent card outranks everything by design, but it must not cover a
     menu the visitor deliberately opened — the drawer is opaque, so the card
     drops behind it and comes back when the drawer closes. */
  body.sst-nav-open .sst-cookie-banner {
    z-index: 8800 !important;
  }

  /* The drawer runs to bottom:0 and paints over the tab bar, so its last link
     needs the same home-indicator clearance the tab bar gets. */
  body.sst-has-bottom-nav .mobile-nav {
    padding-bottom: calc(30px + var(--sst-bottom-nav-safe));
  }

  /* Holiday Matcher sticky submit (full matcher page) */
  body.sst-has-bottom-nav .sst-hm-sticky-submit {
    bottom: var(--sst-bottom-nav-stack) !important;
    z-index: 8800;
  }

  body.sst-has-bottom-nav.sst-hm-sticky-visible {
    padding-bottom: calc(var(--sst-bottom-nav-stack) + 72px) !important;
  }

  body.sst-page-ai.sst-has-bottom-nav {
    padding-bottom: 0 !important;
  }

  body.sst-page-ai.sst-has-bottom-nav .sst-ai-stage {
    padding-bottom: calc(var(--sst-bottom-nav-stack) + 12px) !important;
  }

  /* Chat/plan: composer sits flush on the tab bar (no floating gap). */
  body.sst-page-ai.sst-has-bottom-nav.sst-ai-mode-chat .sst-ai-stage,
  body.sst-page-ai.sst-has-bottom-nav.sst-ai-mode-plan .sst-ai-stage {
    padding: 0 !important;
    padding-bottom: var(--sst-bottom-nav-stack) !important;
  }

  body.sst-page-ai.sst-cookie-open.sst-has-bottom-nav .sst-ai-stage {
    padding-bottom: calc(var(--sst-bottom-nav-stack) + 210px) !important;
  }

  body.sst-page-ai.sst-has-bottom-nav .chat-wrap,
  body.sst-page-ai.sst-has-bottom-nav .chat-card {
    max-height: 100%;
  }

  body.sst-page-search .sst-home-search-band {
    margin-top: 0;
    padding-top: 8px;
  }
}

.sst-bottom-nav__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  width: 100%;
  min-height: 48px;
  max-height: 52px;
  padding: 6px 2px;
  border-radius: 12px;
  text-decoration: none;
  color: #334155;
  opacity: 1;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.1;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.sst-bottom-nav__tab:hover {
  color: #0770e3;
  background: rgba(7, 112, 227, 0.08);
}

/* Keyboard focus needs its own ring: the hover tint alone reads as a hover
   state, not as "this is where you are". */
.sst-bottom-nav__tab:focus-visible {
  color: #0770e3;
  background: rgba(7, 112, 227, 0.08);
  outline: 3px solid #0770e3;
  outline-offset: -3px;
}

.sst-bottom-nav__tab.is-active {
  color: #0770e3;
  background: rgba(7, 112, 227, 0.12);
}

/* Ask AI tab — standout entry in the mobile bar */
.sst-bottom-nav__tab--ai {
  position: relative;
}

.sst-bottom-nav__tab--ai .sst-bottom-nav__icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sst-bottom-nav__spark {
  display: block;
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 700;
}

.sst-bottom-nav__tab--ai:not(.is-active) {
  color: #0557b0;
}

.sst-bottom-nav__tab--ai.is-active {
  color: #fff;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.28) 0%, transparent 45%),
    linear-gradient(145deg, #3b9af5 0%, #0770e3 52%, #0557b0 100%);
  box-shadow:
    0 0 0 1px rgba(255, 209, 102, 0.55),
    0 6px 16px rgba(7, 112, 227, 0.28);
}

.sst-bottom-nav__tab--ai.is-active .sst-bottom-nav__label {
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* Guides tab — editorial feel when active */
.sst-bottom-nav__tab--guides.is-active {
  color: #0b1f3a;
  background:
    linear-gradient(180deg, #fff8e8 0%, #ffe8a8 100%);
  box-shadow:
    0 0 0 1px rgba(230, 168, 0, 0.45),
    0 6px 14px rgba(230, 168, 0, 0.18);
}

.sst-bottom-nav__tab--guides.is-active .sst-bottom-nav__label {
  font-weight: 900;
}

@media (max-width: 760px) {
  .sst-bottom-nav {
    padding: 5px 6px calc(5px + var(--sst-bottom-nav-safe));
    background: rgba(255, 255, 255, 0.94) !important;
    border-top-color: rgba(15, 23, 42, 0.08);
    box-shadow:
      0 -1px 0 rgba(255, 255, 255, 0.8) inset,
      0 -12px 32px rgba(15, 23, 42, 0.1);
  }

  body.sst-page-ai.sst-has-bottom-nav .composer-wrap {
    padding-bottom: 0;
  }
}

.sst-bottom-nav__icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: block;
  color: inherit;
  opacity: 1;
}

.sst-bottom-nav__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sst-bottom-nav__label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 761px) {
  .sst-bottom-nav {
    display: none !important;
  }

  body.sst-has-bottom-nav {
    padding-bottom: 0 !important;
  }

  body.sst-page-guides.sst-page-home,
  body.sst-page-search.sst-page-home {
    padding-top: var(--sst-nav-stack-h, var(--sst-nav-h, 58px)) !important;
  }
}

/* Slim legal row for the tab-bar shells (search, guides). They carry no site
   footer, so without this the only route to Privacy/Terms/Disclaimer is the
   burger drawer — which is hidden on desktop. Visible at every width. */
.sst-utility-legal {
  margin-top: 8px;
  padding: 18px 16px 22px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  text-align: center;
}

.sst-utility-legal p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #64748b;
}

.sst-utility-legal a {
  /* Padded to a 24px-tall target rather than bare 15px text.
     Other pages use #ffd166 on the dark navy footer; this strip sits on
     white, so place gold is the matching readable gold. */
  display: inline-block;
  padding: 5px 2px;
  color: var(--sst-place-gold, #e6a800);
  font-weight: 700;
  text-decoration: none;
}

.sst-utility-legal a:hover,
.sst-utility-legal a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sst-utility-legal__sep {
  padding: 0 6px;
  color: #cbd5e1;
  user-select: none;
}

.sst-utility-legal__note {
  margin-top: 6px !important;
  font-size: 0.72rem !important;
}

/* Ask SkyStay floating button — desktop only, since the tab bar above
   already carries the AI entry point on mobile. */
.sst-ai-fab {
  display: none;
}

@media (min-width: 761px) {
  .sst-ai-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    /* Below the cookie banner (10000) and the tab bar (8900). */
    z-index: 8700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 999px;
    background: #0770e3;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1;
    letter-spacing: -0.01em;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(7, 112, 227, 0.28), 0 1px 4px rgba(15, 23, 42, 0.14);
    opacity: 1;
    transform: translate3d(0, 0, 0);
    max-width: 220px;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.18s ease,
      box-shadow 0.18s ease, padding 0.28s ease, gap 0.28s ease, max-width 0.28s ease;
  }

  /* sst-bottom-nav.js adds this as the newsletter/footer scrolls up to meet
     the button, so it never sits on top of them. */
  .sst-ai-fab.is-tucked {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
    pointer-events: none;
  }

  /* After a page click, collapse to the star only. Hover/focus unfolds again. */
  .sst-ai-fab.is-folded:not(:hover):not(:focus-visible) {
    gap: 0;
    padding: 11px;
    max-width: 40px;
  }

  .sst-ai-fab.is-folded:not(:hover):not(:focus-visible) .sst-ai-fab__label {
    max-width: 0;
    opacity: 0;
    margin: 0;
    transform: translateX(6px);
  }

  .sst-ai-fab__label {
    display: inline-block;
    max-width: 140px;
    opacity: 1;
    transform: translateX(0);
    transition: max-width 0.28s ease, opacity 0.2s ease, transform 0.28s ease;
  }

  .sst-ai-fab:hover,
  .sst-ai-fab:focus-visible {
    background: #0a5fc2;
    color: #fff;
    box-shadow: 0 8px 22px rgba(7, 112, 227, 0.34), 0 1px 4px rgba(15, 23, 42, 0.16);
  }

  .sst-ai-fab:focus-visible {
    outline: 2px solid #ffd166;
    outline-offset: 2px;
  }

  .sst-ai-fab__spark {
    flex: 0 0 auto;
    font-size: 0.88rem;
    line-height: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sst-ai-fab,
  .sst-ai-fab__label {
    transition: none;
  }
}
