/* =========================================================
   LEGACY BRIDGE — new navbar / footer / mobile bar on pages whose body
   still uses the old design (style.css + responsive.css).
   Used by site_template/legacy_layout.php only (tour detail for now).

   base.css can't be loaded here: its global rules (body font, img
   display:block, --bs-body-* overrides, html overflow) would restyle the
   old page body. So this file carries only what the chrome needs:
   the tokens and the base classes, copied from base.css (keep in sync),
   plus resets scoped to the chrome with :where() (zero specificity, so
   the component CSS still wins).
   ========================================================= */

:root {
  --color-white: #FFFFFF;
  --color-navy: #081A28;
  --color-gold: #E4B273;
  --color-black: #000000;
  --color-primary: #3260A1;
  --color-primary-60: rgba(50, 96, 161, 0.6);
  --color-primary-30: rgba(50, 96, 161, 0.3);
  --color-gold-light: #FFD482;
  --color-dark: #141414;
  --color-light: #F4F7F9;
  --color-yellow: #FDC400;
  --color-gray: #A8A8A8;
  --color-cream: #FFF0D9;
  --color-slate: #4E546F;
  --color-danger: rgb(220 53 69);
  --color-ivory: #FFFCF7;
  --color-royal: #004099;
  --color-navy-deep: #001833;

  --font-base: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-serif: "Crimson Pro", Georgia, "Times New Roman", serif;

  --container-max: 1440px;
  --gutter: 48px;

  --radius-pill: 999px;
  --radius-card: 12px;
  --radius-media: 10px;
  --radius-tag: 4px;
}

@media (max-width: 1199.98px) { :root { --gutter: 24px; } }
@media (max-width: 767.98px)  { :root { --gutter: 16px; } }

/* ---------- Chrome-only resets (what base.css does globally) ---------- */
:where(.site-header, .site-footer, .mobile-bar, .mobile-sheet, .skip-link) {
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.375;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
:where(.site-header, .site-footer, .mobile-bar, .mobile-sheet) p { font-size: 16px; }   /* old style.css: p { 15px } */
:where(.site-header, .site-footer, .mobile-bar, .mobile-sheet) img { max-width: 100%; display: block; }
:where(.site-header, .site-footer, .mobile-bar, .mobile-sheet) a { text-decoration: none; }

/* ---------- Layout / buttons (from base.css) ---------- */
.site-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.btn-ds {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn-ds:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }
.btn-ds--sm { height: 36px; padding: 0 18px; font-size: 14px; font-weight: 600; line-height: 1; }
.btn-ds--light { background: var(--color-light); color: var(--color-navy); }
.btn-ds--light:hover { background: var(--color-white); color: var(--color-navy); }
.btn-ds--navy { background: var(--color-navy); color: var(--color-white); }
.btn-ds--navy:hover { background: var(--color-dark); color: var(--color-white); }
.btn-ds--lg { height: 48px; padding: 0 24px; font-size: 16px; font-weight: 500; line-height: 1; }
.btn-ds--icon { padding-right: 10px; }
.btn-ds--xs { height: 38px; padding: 0 14px; gap: 6px; font-size: 11.9px; font-weight: 400; line-height: 1; }   /* tour-card button (cart page cards) */
.btn-ds--xs.btn-ds--icon { padding-right: 5px; }
.btn-ds--primary { background: var(--color-primary); color: var(--color-white); }
.btn-ds--primary:hover { background: #2a5490; color: var(--color-white); }

.icon-circle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-white);
}
.icon-circle img { width: 12px; height: 12px; display: block; }
.text-price { font-size: 17.42px; line-height: normal; font-weight: 500; letter-spacing: -0.02em; }

/* ---------- Tour detail, cart, thank-you: no old page background ----------
   style.css gives <body> the old main_bg.webp image (still used by other old pages,
   so style.css is not edited). The new design uses a plain page (cart / thank-you: light grey, cards on top). */
body.page-tour-detail {
  background-image: none;
  background-color: var(--color-white);
}
body:is(.page-cart, .page-thankyou) {
  background-image: none;
  background-color: var(--color-light);
}

/* ---------- Tour detail + cart: mobile fixed bar (tour "Total / Buy now", cart "Total / check out") ----------
   The old pages placed it 70px up (bottom: 70px) and opened the tour receipt at 138px
   (70px + the 68px bar) to clear the OLD bottom nav, which showed up to 991px.
   The new mobile bar is 64px and only shows below 768px. Position only; the
   markup, classes and JS are unchanged. */
/* Mobile views: tour <= 990px, cart <= 991px (each page's checkScreenWidth()). */
@media (max-width: 990px) {
  .page-tour-detail { --tour-cartbar-h: 68px; --tour-bottom-offset: 0px; }
  .page-tour-detail .receipt_open { bottom: calc(var(--tour-bottom-offset) + var(--tour-cartbar-h)) !important; }
}
@media (max-width: 991.98px) {
  .page-cart { --tour-cartbar-h: 68px; --tour-bottom-offset: 0px; }
  /* Cart: the mobile view has its own top bar (back, "Cart (n)", price sort), no site navbar (user decision 2026-10-14) */
  .page-cart .site-header { display: none; }
}
@media (max-width: 991.98px) {
  :is(.page-tour-detail, .page-cart) .mob_add_cart_button { bottom: var(--tour-bottom-offset, 70px); }
  /* Keep the footer bottom clear of the fixed bar (--tour-cartbar-h is only set inside each page's mobile range) */
  body:is(.page-tour-detail, .page-cart) { padding-bottom: calc(var(--tour-bottom-offset, 0px) + var(--tour-cartbar-h, 0px) + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 767.98px) {
  :is(.page-tour-detail, .page-cart) { --tour-bottom-offset: calc(var(--mobile-bar-h, 64px) + env(safe-area-inset-bottom, 0px)); }
  body:is(.page-tour-detail, .page-cart) { padding-bottom: calc(var(--tour-bottom-offset) + var(--tour-cartbar-h)); }
}
