/* =====================================================================
   Natural Oasis Day Spa: phone & tablet layout
   Tablet 641-1024px · Phone up to 640px · Small phone up to 380px
   Loaded after styles.css.
   ===================================================================== */

/* ---------- Tablet and below ---------- */
@media (max-width: 1024px) {
  :root { --header-h: 76px; }
  .section { padding-block: 72px; }
  .section-lg { padding-block: 88px; }
  .container { width: min(100% - 48px, var(--container)); }
  .section-head { margin-bottom: 40px; }

  /* Treatments / gift picks: 5 cards fill two full rows (3 + 2) */
  .cat-grid.five { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
  .cat-grid.five > * { grid-column: span 2; }
  .cat-grid.five > :nth-child(4), .cat-grid.five > :nth-child(5) { grid-column: span 3; }
  .cat-grid.five > :nth-child(4) .photo, .cat-grid.five > :nth-child(5) .photo { aspect-ratio: 4 / 3; border-radius: 180px 180px 6px 6px; }

  /* Visit block: details + hours side by side, map across the full width */
  .visit-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .visit-grid > :last-child { grid-column: 1 / -1; }
  .visit-grid .map-frame { aspect-ratio: 16 / 8; }

  /* Booking page aside cards in a 2-up grid */
  .book-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Footer: brand on its own row, three columns below */
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

/* ---------- Tablet only ---------- */
@media (min-width: 641px) and (max-width: 900px) {
  /* Package cards go horizontal: photo left, details right */
  .offer { display: grid; grid-template-columns: 1fr 1.1fr; grid-template-rows: auto 1fr auto; column-gap: 24px; row-gap: 10px; align-items: start; }
  .offer .photo { grid-column: 1; grid-row: 1 / span 3; aspect-ratio: auto; height: 100%; min-height: 220px; }
  .offer h3 { grid-column: 2; text-align: left; }
  .offer p { grid-column: 2; }
  .offer .offer-foot { grid-column: 2; }

  .em-grid { grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
  .em-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em-products > :last-child { grid-column: 1 / -1; }
  .em-products > :last-child img { aspect-ratio: 16 / 9; }

  .gift-options { grid-template-columns: 1fr 1fr; }
  .gift-option { padding: 28px; }
  .split { grid-template-columns: 1fr 1fr; gap: 32px; }
  .menu-list { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .includes { margin-top: 40px; }
}

/* ---------- Phone ---------- */
@media (max-width: 640px) {
  :root { --header-h: 68px; --radius: 22px; }
  body { font-size: 16px; }
  .container, .narrow { width: calc(100% - 32px); }
  .section { padding-block: 56px; }
  .section-lg { padding-block: 64px; }
  .section-head { margin-bottom: 28px; }
  .lede { font-size: 1.02rem; }
  h2 { font-size: clamp(2rem, 8.5vw, 2.6rem); }
  h3 { font-size: 1.45rem; }
  .eyebrow { font-size: 12px; letter-spacing: 0.18em; margin-bottom: 12px; }

  /* Header and menu */
  .brand img { height: 46px; }
  .icon-btn { width: 44px; height: 44px; }
  .main-nav { padding: 4px 16px 20px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.35); }
  .main-nav a { padding: 16px 0; border-bottom: 1px solid var(--line-light); }
  .main-nav a::after { display: none; }
  .main-nav a[aria-current="page"] { color: var(--cedar); font-weight: 600; }
  .nav-call a { color: var(--cedar); }

  /* Buttons span the full width */
  .btn-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .btn-row .btn { width: 100%; }
  .btn { min-height: 52px; padding: 14px 22px; }

  /* Hero: tighter, nothing overlaps */
  .hero-scroll .hero { min-height: 0; }
  .hero-emblem { width: 84px; height: 84px; margin-bottom: 22px; }
  .hero-emblem svg { width: 40px; height: 40px; }
  .hero h1 { font-size: clamp(2.7rem, 13vw, 3.6rem); line-height: 1; }
  .hero .lede { font-size: 12px; letter-spacing: 0.16em; margin: 18px auto 26px; }
  .hero .btn-row { width: 100%; max-width: 340px; margin-inline: auto; }
  .scroll-cue { bottom: 12px; }
  .scroll-cue span { display: none; }
  .scroll-cue i { height: 28px; }

  .page-hero.with-photo { padding: 96px 0 56px; }
  .page-hero h1 { font-size: clamp(2.4rem, 11vw, 3.2rem); }

  /* Packages: swipeable full-width cards with a peek of the next one */
  .offer-grid {
    display: grid; grid-auto-flow: column; grid-auto-columns: 86%; grid-template-columns: none;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    border: 0; border-radius: 0; gap: 12px;
    margin-inline: -16px; padding: 0 16px 6px; scroll-padding-inline: 16px;
    scrollbar-width: none;
  }
  .offer-grid::-webkit-scrollbar { display: none; }
  .offer { scroll-snap-align: start; border: 1px solid var(--line-dark); border-radius: var(--radius); padding: 22px 18px 18px; }
  .offer:last-child { border: 1px solid var(--line-dark); }
  .swipe-hint { display: flex; }
  .includes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 32px; }
  .include span { font-size: 10.5px; letter-spacing: 0.08em; line-height: 1.35; }
  .include svg { width: 26px; height: 26px; }

  /* Treatments: 2-up grid, fifth card spans the full width */
  .cat-grid, .cat-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .cat-grid.five > *, .cat-grid.five > :nth-child(4) { grid-column: span 1; }
  .cat-grid.five > :nth-child(5) { grid-column: 1 / -1; }
  .cat-card .photo, .cat-grid.five .cat-card .photo,
  .cat-grid.five > :nth-child(4) .photo { aspect-ratio: 3 / 4; border-radius: 200px 200px 6px 6px; }
  .cat-grid.five > :nth-child(5) .photo { aspect-ratio: 16 / 9; border-radius: 22px; }
  .cat-card { gap: 8px; }
  .cat-card h3, .cat-grid.five .cat-card h3 { font-size: 1.2rem; line-height: 1.2; }
  .cat-card .from { font-size: 11px; }
  .cat-card .chip-btn { width: 100%; min-height: 44px; padding: 8px 10px; }

  /* Eminence */
  .em-grid { gap: 32px; }
  .em-products { gap: 10px; }
  .em-products figcaption { font-size: 10.5px; letter-spacing: 0.06em; padding: 0 6px 10px; }
  .em-stats dd { font-size: 2.1rem; }
  .em-pillars li { padding: 7px 12px; font-size: 11.5px; }

  /* Gifts */
  .gift-band .copy { padding: 28px 20px 24px; }
  .gift-band .photo { min-height: 220px; }
  .gift-option { padding: 22px 18px; }
  .gift-option .card-art .badge img { height: 54px; }

  /* Visit */
  .visit-grid { grid-template-columns: 1fr; gap: 28px; }
  .visit-grid > :last-child { grid-column: auto; }
  .visit-grid .map-frame { aspect-ratio: 4 / 3; }
  .split .map-frame { aspect-ratio: 4 / 3 !important; }

  /* Steps */
  .steps { gap: 0; }
  .step { padding: 20px 0; }

  /* Spa menu */
  .menu-nav a { min-height: 48px; padding: 0 12px; font-size: 12px; }
  .menu-page { padding-bottom: 40px; }
  .menu-page .menu-cat { padding: 22px 16px 10px; margin-top: 16px; border-radius: 20px; }
  .menu-cat-head { gap: 10px; }
  .menu-item { padding: 18px 0; gap: 4px 12px; }
  .menu-page .menu-item { padding: 18px 10px; margin: 0 -10px; }
  .menu-item .name { font-size: 1.35rem; }
  .menu-item .price { font-size: 1.4rem; }
  .menu-item .desc { font-size: 15px; }
  .menu-item .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .menu-item .actions .chip-btn.book { grid-column: 1 / -1; justify-content: center; }
  .menu-item .chip-btn { width: 100%; padding: 8px 10px; }
  .notice { padding: 14px 16px; font-size: 14.5px; }

  /* Booking form */
  .book-layout { gap: 32px; }
  .form-block { margin-bottom: 28px; padding-bottom: 28px; }
  .book-aside { grid-template-columns: 1fr 1fr; gap: 10px; }
  .aside-card { padding: 16px; }
  .aside-card h3 { font-size: 1.2rem; }
  .aside-card .btn { width: 100%; padding: 10px; font-size: 12px; }
  .aside-card .hours li { font-size: 14px; flex-direction: column; gap: 0; padding: 6px 0; }

  /* FAQ */
  .faq summary { font-size: 1.22rem; padding: 18px 0; }
  .faq-group { margin-top: 40px; }
  .faq-cta { margin-top: 48px; padding: 32px 20px; }

  /* Add-to-cart dialog becomes a bottom sheet */
  dialog.add-dialog { margin: auto 0 0; max-width: 100%; width: 100%; border-radius: 22px 22px 0 0; max-height: 92dvh; }
  .dialog-head { padding: 22px 18px 0; }
  .dialog-head h2 { font-size: 1.7rem; }
  .dialog-body { padding: 16px 18px 22px; }
  .cart-foot { padding: 16px 18px 22px; }

  /* Footer: compact two-column */
  .site-footer { padding: 44px 0 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .footer-grid > :first-child, .footer-grid > :nth-child(2) { grid-column: 1 / -1; }
  .footer-badge { padding: 10px 22px; }
  .footer-badge img { height: 52px; }
  .footer-bottom { margin-top: 32px; flex-direction: column; gap: 6px; font-size: 13px; }

  .toast { left: 12px; right: 12px; transform: translateY(20px); border-radius: 16px; }
  .toast.show { transform: none; }
}

/* ---------- Small phones ---------- */
@media (max-width: 380px) {
  .container, .narrow { width: calc(100% - 24px); }
  .offer-grid { margin-inline: -12px; padding-inline: 12px; scroll-padding-inline: 12px; }
  .hero h1 { font-size: 2.5rem; }
  .includes { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .book-aside { grid-template-columns: 1fr; }
  .menu-nav a { padding: 0 10px; }
}

/* Swipe hint under the packages (phones only) */
.swipe-hint { display: none; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 0; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-dark-muted); }
.swipe-hint svg { width: 18px; height: 18px; }

/* Landscape phones: keep the hero usable */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-scroll .hero { min-height: 0; }
  .hero-emblem { display: none; }
  .hero h1 { font-size: 2.4rem; }
  .hero .lede { margin: 10px auto 16px; }
  .scroll-cue { display: none; }
}

@media (max-width: 640px) {
  .footer-grid li { font-size: 14px; }
  .footer-grid > :nth-child(3) li { white-space: nowrap; font-size: 13.5px; }
}

/* Spa menu on phones: all three buttons on one row */
@media (max-width: 640px) {
  .menu-item .actions { grid-template-columns: 0.8fr 0.9fr 1.5fr; gap: 6px; margin-top: 4px; }
  .menu-item .actions .chip-btn.book { grid-column: auto; }
  .menu-item .chip-btn { min-height: 42px; padding: 6px 4px; font-size: 11px; letter-spacing: 0.08em; white-space: nowrap; }
  .menu-item .desc { margin-bottom: 2px; line-height: 1.5; }
}
@media (max-width: 360px) {
  .menu-item .chip-btn { font-size: 10px; letter-spacing: 0.04em; }
}

/* Keep two-option choices side by side on phones */
@media (max-width: 640px) {
  .choices { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .choice span { padding: 12px; min-height: 0; }
  .choice span small { font-size: 13px; line-height: 1.35; }
}

/* How it works: number beside the text on phones */
@media (max-width: 640px) {
  .step { display: grid; grid-template-columns: 52px 1fr; column-gap: 8px; align-items: baseline; padding: 18px 0; }
  .step::before { grid-row: 1 / span 2; margin: 0; font-size: 2rem; }
  .step h3 { margin: 0 0 4px; }
  .step p { grid-column: 2; margin: 0; }
  .gift-option .card-art { aspect-ratio: 2 / 1; }
}

/* Request form on phones: pair short fields side by side */
@media (min-width: 340px) and (max-width: 640px) {
  .request-form .field-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .request-form .field-row:has(#r-guests) { grid-template-columns: 96px 1fr; }
  .request-form .field-row:has(#r-email) { grid-template-columns: 1fr; gap: 0; }
  .request-form .field label { font-size: 13.5px; }
  .request-form .form-block > legend h2 { font-size: 1.8rem; }
}

/* Tablet refinements */
@media (min-width: 641px) and (max-width: 900px) {
  .gift-band { grid-template-columns: 1fr 1fr; }
  .gift-band .photo { order: 0; min-height: 100%; }
  .gift-band .copy { padding: 36px 28px; }
  .menu-item .actions { display: grid; grid-template-columns: 0.8fr 0.9fr 1.5fr; gap: 6px; }
  .menu-item .chip-btn { width: 100%; padding: 6px 4px; font-size: 11px; letter-spacing: 0.08em; white-space: nowrap; justify-content: center; }
  .menu-cat-head.has-image { grid-template-columns: minmax(0, 1fr) 150px; }
}
