/* ============================================================
   Caribe Suites — Mobile Experience
   Loaded after sections.css to override desktop rules
   ============================================================ */

/* ============================================================
   1. HEADER
   ============================================================ */
@media (max-width: 640px) {
  .site-header {
    /* viewport-fit=cover: page extends behind Dynamic Island/notch.
       env(safe-area-inset-top) pushes content below it (~59px on iPhone 14 Pro Max). */
    padding: max(14px, env(safe-area-inset-top)) 20px 14px;
  }
  .site-header.scrolled {
    padding: max(12px, env(safe-area-inset-top)) 20px 12px;
  }
  .site-nav { display: none; }
  .header-cta span { display: none; }
  .header-cta {
    padding: 12px;
    min-height: 44px;
  }
  /* lang-toggle is the only other header tap target on mobile */
  .lang-toggle {
    min-height: 44px;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* ============================================================
   2. HERO — FULL SCREEN IMMERSIVE
   ============================================================ */
@media (max-width: 640px) {
  /* Marquee is decorative — hide on mobile */
  .hero .marquee { display: none; }

  .hero {
    padding: 0;
    max-width: none;
    margin: 0;
    position: relative;
    min-height: 100svh;
  }

  /* Flex column, text pushed to bottom */
  .hero-grid {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100svh;
    position: relative;
    gap: 0;
    align-items: stretch;
  }

  /* Dark gradient for readability: top (header) + bottom (text) */
  .hero-grid::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      rgba(8, 20, 35, 0.45) 0%,
      transparent 26%,
      transparent 44%,
      rgba(8, 20, 35, 0.70) 68%,
      rgba(8, 20, 35, 0.90) 100%
    );
    z-index: 1;
    pointer-events: none;
  }

  /* Visual becomes a full-screen background layer */
  .hero-visual {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: auto !important;
    max-width: none !important;
    perspective: none;
    z-index: 0;
  }

  .hero-deck {
    position: absolute;
    inset: 0;
  }

  /* Cards become full-screen slides */
  .hero-card {
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
  }
  .hero-card-inner {
    border-radius: 0 !important;
  }

  /* Cross-fade: only active card visible (uses existing opacity transition) */
  .hero-card[data-offset="0"] {
    z-index: 3;
    opacity: 1 !important;
    pointer-events: auto;
  }
  .hero-card[data-offset="1"],
  .hero-card[data-offset="2"] {
    opacity: 0 !important;
    pointer-events: none;
    z-index: 1;
  }

  /* Property name badge — small, bottom-left of image */
  .hero-card-meta {
    left: 20px;
    right: auto;
    bottom: 20px;
    z-index: 2;
    gap: 8px;
  }
  .hero-card-num { display: none; }
  .hero-card-name {
    font-size: 17px;
    margin-bottom: 2px;
    line-height: 1.1;
  }
  .hero-card-loc { font-size: 9px; }

  .hero-counter { display: none; }
  .hero-active-tag { display: none; }

  /* Text block — white on dark image */
  .hero-text {
    position: relative;
    z-index: 2;
    color: #fff;
    padding: 0 22px calc(90px + env(safe-area-inset-bottom, 0px));
  }

  .hero-eyebrow {
    color: rgba(255, 255, 255, 0.60);
    margin-bottom: 10px;
  }

  .hero-title {
    font-size: clamp(36px, 10.5vw, 52px) !important;
    margin: 0 0 12px !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: none !important;
    line-height: 1.0 !important;
  }
  .hero-kicker {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: none !important;
  }
  .hero-kicker::after { display: none !important; }
  .hero-pre, .hero-post { color: #fff !important; }

  html[data-mode="brand"] .hero-title {
    -webkit-text-fill-color: #fff !important;
    background: none !important;
  }
  html[data-mode="brand"] .hero-kicker {
    color: var(--ocean-light) !important;
    -webkit-text-fill-color: var(--ocean-light) !important;
    background: none !important;
  }

  .hero-lede {
    font-size: 14.5px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 20px;
    max-width: none;
    line-height: 1.5;
  }

  .hero-ctas {
    flex-direction: column;
    gap: 9px;
    margin-bottom: 0;
    flex-wrap: nowrap;
  }
  .hero-ctas .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 15px 20px;
    font-size: 14px;
    background: var(--ocean);
    box-shadow: 0 4px 18px -4px rgba(44, 111, 163, 0.60);
    border-radius: var(--btn-radius);
  }
  html[data-mode="brand"] .hero-ctas .btn-primary {
    background: linear-gradient(135deg, var(--ocean) 0%, var(--ocean-dark) 100%);
  }
  .hero-ctas .btn-ghost {
    width: 100%;
    justify-content: center;
    border-color: rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.85);
    padding: 13px 20px;
    font-size: 14px;
  }
  .hero-ctas .btn-ghost:hover,
  .hero-ctas .btn-ghost:active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
  }

  .hero-stats { display: none; }

  /* Hide the in-card meta (it's trapped behind ::before z-index) */
  .hero-card-meta { display: none !important; }

  /* Property badge lives inside .hero-text (z-index: 2) so it clears the gradient */
  .hero-prop-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
  }
  .hero-prop-dots {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
  }
  .hero-prop-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    transition: background 0.3s ease, transform 0.3s ease;
  }
  .hero-prop-dot.active {
    background: #fff;
    transform: scale(1.3);
  }
  .hero-prop-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .hero-prop-name {
    font-size: 15px;
    color: #fff;
    line-height: 1.1;
  }
  .hero-prop-loc {
    font-size: 9.5px;
    color: rgba(255,255,255,0.60);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

/* ============================================================
   3. LOCATIONS — hidden on mobile (city context is redundant;
      city name already visible on each stay card)
   ============================================================ */
@media (max-width: 640px) {
  .locations { display: none !important; }

  .locations-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
  }
  .locations-title { font-size: 28px; }

  .locations-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .loc-card { padding: 18px; gap: 14px; }
  .loc-map { height: 145px; border-radius: 8px; }
  .loc-name { font-size: 24px; margin: 0 0 6px; }
  .loc-desc { font-size: 13.5px; margin: 0 0 8px; }
  .loc-num { font-size: 22px; top: 18px; right: 18px; opacity: 0.35; }
}

/* ============================================================
   4. STAYS (Properties)
   ============================================================ */
@media (max-width: 640px) {
  .stays { padding: 36px 0 16px; }

  .stays-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
    padding: 0 20px;
  }
  .stays-title { font-size: 28px; line-height: 1.05; }
  .stays-desc { font-size: 14px; }

  /* Each stay: vertical card */
  .stays-list .stay {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 0 36px;
    border-top: none;
    border-bottom: none;
    align-items: stretch;
  }
  .stays-list .stay + .stay {
    border-top: 1px solid var(--hairline);
    padding-top: 36px;
  }
  .stays-list .stay:last-child { padding-bottom: 0; }

  .stay-meta { display: none; }

  .stay-photo {
    grid-column: 1 !important;
    aspect-ratio: 16/11;
    border-radius: 0;
    margin-bottom: 20px;
  }
  /* Always show nav arrows on touch */
  .stay-nav { opacity: 1 !important; }

  .stay-body {
    grid-column: 1 !important;
    padding: 0 20px;
    gap: 14px;
  }

  .stay-title-row { gap: 4px; }
  .stay-name { font-size: 28px; line-height: 1; }
  .stay-loc { font-size: 10.5px; }
  .stay-desc { font-size: 13.5px; line-height: 1.55; }

  .stay-feats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
    background: var(--paper-2);
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
  }
  .stay-feat .display { font-size: 24px; }
  /* ink-mute (#64748B) on paper-2 (#F6F1EA) = 4.25:1 — fails WCAG AA 4.5:1 at 9px.
     ink-2 (#334155) on paper-2 = 9.4:1 — passes with margin. */
  .stay-feat .mono { font-size: 9px; color: var(--ink-2); }

  .stay-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 0;
  }
  .stay-price { align-items: baseline; gap: 6px; }
  .stay-price-n { font-size: 21px; }

  .stay-cta {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 14px;
  }
}

/* ============================================================
   6. WHY DIRECT — simplified card layout
   ============================================================ */
@media (max-width: 640px) {
  .why { padding: 44px 20px; }

  .why-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding-bottom: 24px;
    margin-bottom: 0;
  }
  .why-title { font-size: 30px; line-height: 1.0; }
  .why-title-line:nth-child(2) { font-size: 28px; }
  .why-savings { gap: 12px; }
  .why-savings-num { font-size: 56px; }
  .why-savings-lbl { font-size: 9.5px; line-height: 1.5; }

  .why-grid {
    grid-template-columns: 1fr;
    border-bottom: none;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--hairline);
  }

  /* Card-style items */
  .why-item {
    padding: 20px 18px !important;
    border-right: none !important;
    border-bottom: none !important;
    border: 1px solid var(--hairline) !important;
    border-radius: var(--r-card) !important;
    background: var(--paper-2);
    gap: 8px;
  }
  .why-item:not(:first-child) { padding-left: 18px !important; }
  .why-item:last-child {
    border: 1px solid var(--hairline) !important;
    padding-right: 18px !important;
    margin-bottom: 0;
  }

  .why-item-n { font-size: 10px; margin-bottom: 0; }
  .why-item-title { font-size: 19px; line-height: 1.1; margin-bottom: 0; }
  .why-item-body { font-size: 13px; line-height: 1.55; margin: 0; }

  /* Hide complex data visualizations — not readable on mobile */
  .why-priceline,
  .why-chat,
  .why-tips,
  .why-flex { display: none !important; }

  /* Quick Win 2: show only the 2 most decision-relevant reasons.
     Item 1 (recommendations) and item 3 (flexibility) are nice-to-haves;
     price advantage and real human support close bookings. */
  .why-item-1,
  .why-item-3 { display: none !important; }

  .why-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding-top: 24px;
  }
  .why-foot-note { font-size: 17px; }

  /* Quick Win 3: duplicate WhatsApp CTA — Contact section already
     has this button 2 scrolls below, so remove the redundant one here */
  .why-foot-cta { display: none !important; }
}

/* ============================================================
   7. PAYMENTS
   ============================================================ */
@media (max-width: 640px) {
  .payments { padding: 36px 20px; }
  .payments-head { margin-bottom: 24px; }
  .payments-title { font-size: 21px; }

  .payments-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .pay-chip {
    padding: 13px 10px;
    justify-content: center;
    min-height: 52px;
  }
  .pay-chip:last-child { grid-column: 1 / -1; }
  .pay-chip-logo { height: 20px; }
  .payments-note { font-size: 10px; margin-top: 14px; }
}

/* ============================================================
   8. CONTACT
   ============================================================ */
@media (max-width: 640px) {
  .contact {
    padding: 44px 20px calc(96px + env(safe-area-inset-bottom, 0px));
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 36px;
  }
  .contact-title {
    font-size: clamp(50px, 17vw, 88px);
    line-height: 0.88;
  }
  .contact-right { gap: 18px; align-items: stretch; }
  .contact-desc { font-size: 14.5px; max-width: none; }
  .contact-cta {
    width: 100%;
    justify-content: center;
    padding: 15px 24px;
    font-size: 14px;
  }
  .contact-meta { gap: 10px; font-size: 10.5px; flex-wrap: wrap; }
}

/* ============================================================
   9. FOOTER
   ============================================================ */
@media (max-width: 640px) {
  .site-footer { padding: 18px 20px 26px; }
  .site-footer-inner {
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    text-align: center;
    font-size: 9.5px;
  }
  .footer-spacer { display: none; }
}

/* ============================================================
   10. BOOKING DRAWER — Bottom Sheet
   ============================================================ */
@media (max-width: 640px) {
  .drawer-panel {
    top: auto !important;
    right: 0;
    bottom: 0 !important;
    left: 0;
    width: 100% !important;
    border-radius: 22px 22px 0 0;
    max-height: 92svh;
    transform: translateY(100%) !important;
    transition: transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    box-shadow: 0 -8px 40px -8px rgba(30, 82, 120, 0.22);
  }
  .drawer.open .drawer-panel {
    transform: translateY(0) !important;
  }

  /* Drag handle */
  .drawer-panel::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    background: var(--hairline);
    border-radius: 999px;
    margin: 11px auto 0;
    flex-shrink: 0;
  }

  .drawer-header { padding: 12px 20px 14px; }
  .drawer-body {
    padding: 18px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .step-title { font-size: 24px; margin-bottom: 18px; }
  .prop-pick {
    grid-template-columns: 20px 54px 1fr auto;
    gap: 10px;
    padding: 12px;
  }
  .prop-pick-name { font-size: 17px; }
  .range-date { font-size: 17px; }
  .summary-row.total .display { font-size: 22px; }
  .drawer-footer {
    padding: 14px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .drawer-cta { padding: 14px 20px; font-size: 14px; }
}

/* ============================================================
   11. BOTTOM NAVIGATION BAR
   ============================================================ */
@media (max-width: 640px) {
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: oklch(98% 0.006 85 / 0.96);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-top: 1px solid var(--hairline);
    box-shadow: 0 -1px 16px -4px rgba(30, 41, 59, 0.07);
  }

  .mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    color: var(--muted);
    font-size: 9.5px;
    font-family: var(--sans);
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    transition: color 0.18s ease, background 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
  /* Active section tab */
  .mbn-item.mbn-active {
    color: var(--ocean);
    background: oklch(92% 0.025 220 / 0.5);
  }
  .mbn-item:active {
    color: var(--ocean);
    background: oklch(92% 0.025 220 / 0.5);
  }
  .mbn-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  /* Book button — no persistent fill so it never looks "selected".
     Ocean accent color + bold weight make it the visual priority without mimicking a selected tab. */
  .mbn-book {
    flex: 1.5;
    background: transparent;
    color: var(--muted);
    border-radius: 10px;
    padding: 8px 4px;
    gap: 3px;
    font-size: 9.5px;
    font-weight: 500;
    box-shadow: none;
    transition: background 0.15s ease, transform 0.14s ease, color 0.15s ease;
  }
  .mbn-book:active {
    background: oklch(92% 0.025 220 / 0.5);
    transform: scale(0.94);
    color: var(--ocean);
  }
  .mbn-book svg {
    width: 17px;
    height: 17px;
  }
}

/* ============================================================
   12. DESKTOP — hide mobile-only elements
   ============================================================ */
@media (min-width: 641px) {
  .mobile-bottom-nav { display: none; }
}
