/* Phone optimisations for the approved design. Loaded after the design's own styles;
   only layout/tap-target changes below 900px, no colours or typography swaps. */

.dc-menu, .dc-gallery-more { display: none; }

@media (max-width: 900px) {
  /* compact sticky header: logo · Book now · menu button; the nav opens as a panel */
  header[style*="position: sticky"] > div { flex-wrap: nowrap !important; gap: 12px !important; padding: 10px 68px 10px 20px !important; min-height: 60px; }
  header[style*="position: sticky"] > div > a:first-child span { font-size: 24px !important; }
  header[style*="position: sticky"] > div > a.btn { margin-left: auto; min-height: 40px; padding: 10px 14px; font-size: 11px; }
  header[style*="position: sticky"] nav[aria-label="Main"] { display: none !important; }

  /* three-dots menu: a small dropdown card under the button, the page stays visible */
  html.nav-open header[style*="position: sticky"] nav[aria-label="Main"] {
    display: flex !important; flex-direction: column; flex-wrap: nowrap !important; gap: 0 !important; align-items: stretch !important;
    position: fixed; top: 58px; right: 12px; left: auto; width: min(260px, calc(100vw - 24px)); max-height: calc(100dvh - 76px); overflow-y: auto;
    margin: 0 !important; padding: 6px 0; z-index: 45;
    background: #2A1D17; border: 1px solid rgba(246,238,228,.14); border-radius: 6px; box-shadow: 0 18px 40px rgba(20,10,5,.45);
    transform-origin: top right; animation: dcMenu .18s ease-out both;
  }
  @keyframes dcMenu { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
  html.nav-open header[style*="position: sticky"] nav[aria-label="Main"] .navl { font-size: 13px; padding: 14px 18px; border-bottom: 0; border-left: 2px solid transparent; }
  html.nav-open header[style*="position: sticky"] nav[aria-label="Main"] .navl + .navl { border-top: 1px solid rgba(246,238,228,.08); }
  html.nav-open header[style*="position: sticky"] nav[aria-label="Main"] .navl.on { color: #FFFFFF; border-left-color: #E08A63; }
  /* a backdrop-filter makes the header the containing block of fixed children; drop it while the menu is open */
  html.nav-open header[style*="position: sticky"] { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: #2A1D17 !important; }

  .dc-menu { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; position: fixed; z-index: 50; top: 10px; right: 12px; width: 40px; height: 40px;
    border: 0; border-radius: 50%; background: transparent; color: #F6EEE4; cursor: pointer; padding: 0; transition: background .2s; }
  .dc-menu i { display: block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
  .dc-menu:hover, html.nav-open .dc-menu { background: rgba(246,238,228,.12); }
}

@media (max-width: 900px) {
  /* iOS Safari gives date inputs a native min-width that ignores width:100% and spills out of the field */
  .field { min-width: 0; }
  .inp[type="date"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%;
    -webkit-min-logical-width: 0; line-height: 46px; text-align: left; }
  .inp[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 46px; line-height: 46px; }
  /* iOS zooms the page into any input under 16px on tap, which makes the field look like it overflows */
  .inp, .ta, select.inp { font-size: 16px !important; }

  /* home: the "Your summer on the Riviera" card sat flush against the full-bleed "ends in gold" photo */
  .page-home section[style^="padding: 0 0 100px"] { padding-top: 40px !important; }

  /* hot points: filters, then the map, then the ← STOP n/8 → controls, then the stop details */
  .page-hot-points .wrap:has(> .tour) { display: flex; flex-direction: column; }
  .page-hot-points .wrap:has(> .tour) > :first-child, .page-hot-points .wrap > .tour { display: contents !important; }
  .page-hot-points .wrap:has(> .tour) > :first-child > [role="group"] { order: 1; }
  .page-hot-points .tour > :first-child { order: 2; margin-top: 28px; }
  .page-hot-points .wrap:has(> .tour) > :first-child > :last-child { order: 3; justify-content: center; margin-top: 16px; }
  .page-hot-points .tour > :nth-child(2) { order: 4; margin-top: 28px; }
}

@media (max-width: 640px) {
  /* section rhythm: the 100–110px desktop paddings become 64px */
  section[style*="padding: 110px 0"], section[style*="padding: 100px 0"] { padding-top: 64px !important; padding-bottom: 64px !important; }

  /* parasol / daybed maps: keep spots at a tappable size and let the map scroll sideways */
  #book-beach div[style*="flex: 999 1 640px"], #book-pool div[style*="flex: 999 1 640px"] { padding: 18px 14px !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #book-beach div[style*="flex: 999 1 640px"] > :not(:first-child):not(:last-child),
  #book-pool div[style*="flex: 999 1 640px"] > :not(:first-child):not(:last-child) { min-width: 540px; }
  #book-beach span[style*="flex: 0 0 84px"], #book-pool span[style*="flex: 0 0 84px"] { flex-basis: 56px !important; }

  /* wide comparison table: it already scrolls; show that it does */
  div[style*="overflow-x: auto"] > .tbl { min-width: 600px; }
  div[style*="overflow-x: auto"]:has(> .tbl) { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }

  /* galleries: one photo + a button that opens the photo viewer */
  .masonry[data-gallery] { columns: 1 !important; }
  .masonry[data-gallery] > :nth-child(n+2) { display: none !important; }
  .masonry[data-gallery] > :first-child img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
  .dc-gallery-more { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin-top: 14px; padding: 14px 20px;
    border: 1px solid currentColor; border-radius: 2px; background: transparent; color: inherit; cursor: pointer;
    font: 700 12px Manrope, sans-serif; letter-spacing: .12em; text-transform: uppercase; }

  /* date fields: one per row so the full date fits (contact grid → single column; home booking bar) */
  .page-contact div:has(> .field > input[type="date"]) { grid-template-columns: minmax(0, 1fr) !important; }
  #book > .field:has(> input[type="date"]) { flex-basis: 100% !important; }

  /* touch targets */
  .btn { min-height: 48px; }
  .chip { min-height: 40px; }
}
