/*
 * Desktop and tablet layout for the Turning Heads page (900px and wider).
 * The design is drawn for phones only; below 900px nothing here applies.
 * Hooks: build.mjs tags the page wrapper (.th-page), its ten sections
 * (.th-hero ... .th-book) and the pop-up panels. Inline styles from the
 * design need !important to be overridden.
 */
@media (min-width: 900px) {
  :root { --g: max(40px, calc((100vw - 1280px) / 2)); }
  body { background: #ECE6DA; }

  .th-page { max-width: none !important; display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .th-page > section { grid-column: 1 / -1; }
  .th-services, .th-products, .th-find { padding-left: var(--g) !important; padding-right: var(--g) !important; }

  /* 1 Hero: full screen, bigger type, video uncropped */
  .th-hero > div { height: min(100vh, 940px) !important; min-height: 640px !important; }
  .th-hero video { transform: none !important; }
  .th-hero header { padding: 28px var(--g) !important; }
  .th-hero header img { width: 150px !important; }
  .th-hero > div > div:last-child { padding: 0 var(--g) 72px !important; max-width: calc(720px + var(--g)); }
  .th-hero h1 { font-size: clamp(120px, 11.5vw, 196px) !important; }
  .th-hero p { font-size: 20px !important; max-width: 420px !important; }
  .th-hero h1 + p + a { max-width: 400px; margin-top: 32px !important; }

  /* 2 + 3 Photo beside About */
  .th-photo { grid-column: 1 !important; height: auto !important; min-height: 680px; }
  .th-about { grid-column: 2 !important; align-self: center; padding: 96px var(--g) 96px 72px !important; }
  .th-about > p { font-size: clamp(44px, 4.4vw, 64px) !important; line-height: 1 !important; }
  .th-about > div:nth-child(3) { font-size: 18px !important; max-width: 520px; }

  /* 4 Services: five tiles in a row */
  .th-services { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 20px; padding-top: 112px !important; }
  .th-services > * { grid-column: 1 / -1; }
  .th-services > a:not(:last-child) { grid-column: auto; display: flex !important; flex-direction: column; align-items: stretch !important; gap: 14px !important; padding: 18px 0 24px !important; position: relative; }
  .th-services > a:not(:last-child) > span:first-child { width: 100% !important; height: auto !important; aspect-ratio: 4 / 5; background-color: #cfc7b8 !important; }
  .th-services > a:not(:last-child) > span:last-child { position: absolute; right: 0; bottom: 24px; }
  .th-services > a:not(:last-child) > span:nth-child(2) { padding-right: 52px; }
  .th-services > div[style*="border-top"]:not([style*="display"]) { display: none !important; }
  .th-services > a:last-child { max-width: 420px; margin-top: 32px !important; }

  /* 5 In the salon: three across */
  .th-salon { padding-top: 112px !important; }
  .th-salon > div:first-child, .th-store > div:first-child { padding-left: var(--g) !important; padding-right: var(--g) !important; }
  .th-salon > div:last-child { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px !important; overflow: visible !important; padding: 0 var(--g) !important; }
  .th-salon > div:last-child > figure { flex: none !important; min-width: 0; }
  .th-salon > div:first-child > span:last-child { visibility: hidden; }
  /* Six reels: one row, so the section fits on one screen */
  .th-salon > div:last-child { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 16px !important; }
  .th-salon video { aspect-ratio: 9 / 16 !important; }

  /* 6 In the store and 8 brands: full grids on desktop, no half-cut cards at the edges */
  .th-store > div:last-child, .th-products > div:nth-child(7) { display: grid !important; gap: 16px !important; overflow: visible !important; scroll-snap-type: none !important; padding-bottom: 0 !important; }
  .th-store > div:last-child { grid-template-columns: repeat(9, minmax(0, 1fr)); padding: 0 var(--g) !important; }
  .th-products > div:nth-child(7) { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 !important; padding: 0 !important; }
  .th-store > div:last-child > *, .th-products > div:nth-child(7) > * { flex: none !important; width: auto !important; min-width: 0; }
  .th-store > div:first-child > span:last-child, .th-products > div:nth-child(6) > span:last-child { visibility: hidden; }
  .th-dragging { cursor: grabbing !important; scroll-snap-type: none !important; user-select: none; }

  /* 7 Post & Perk */
  .th-perk { padding-top: 112px !important; }
  .th-perk > div:first-child, .th-perk > h2 { padding-left: var(--g) !important; padding-right: var(--g) !important; }
  .th-perk > h2 { font-size: clamp(64px, 7vw, 110px) !important; }
  .th-perk > div:nth-child(3) { margin: 36px var(--g) 0 !important; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 40px !important; border-top: 0 !important; }
  .th-perk > div:nth-child(3) > div { border-top: 1px solid #14110E; font-size: 18px !important; align-content: start; padding: 18px 0 22px !important; }
  .th-perk { padding-bottom: 24px !important; }

  /* 8 Products */
  .th-products { display: grid !important; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 72px; padding-top: 112px !important; }
  .th-products > * { grid-column: 1 / -1; }
  .th-products > h2 { grid-column: 1; grid-row: 2 / span 3; font-size: clamp(64px, 7vw, 110px) !important; line-height: .9 !important; margin-top: 16px !important; }
  .th-products > p, .th-products > input, .th-products > input + div { grid-column: 2; }
  .th-products > p { font-size: 18px !important; margin-top: 20px !important; }
  .th-products > div:nth-child(6) { margin-top: 64px !important; }
  .th-products > div:nth-child(9) { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 16px !important; }
  .th-products > div:nth-child(9) > div > div:first-child { aspect-ratio: 1 / 1 !important; }
  .th-products > a:last-child { max-width: 420px; }

  /* 9 Find us: details left, map right */
  .th-find { display: grid !important; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 72px; padding-top: 112px !important; align-items: start; }
  .th-find > * { grid-column: 1; }
  .th-find > h2 { font-size: clamp(56px, 6vw, 92px) !important; }
  .th-find > iframe { grid-column: 2; grid-row: 1 / span 5; height: 100% !important; min-height: 520px; }

  /* 10 Book your seat */
  .th-book { display: grid !important; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 72px; padding: 96px var(--g) 120px !important; margin-top: 112px !important; align-items: end; }
  .th-book > * { grid-column: 2; }
  .th-book > h2 { grid-column: 1; grid-row: 1 / span 4; font-size: clamp(110px, 12vw, 200px) !important; align-self: start; }

  /* Floating "Book now" bar and cart bar: compact, bottom right */
  .th-fab, .th-cartbar { left: auto !important; right: 28px !important; transform: none !important; width: 340px !important; }

  /* Product and cart sheets: centred panels instead of bottom sheets */
  .th-sheet { top: 50% !important; bottom: auto !important; transform: translate(-50%, -50%) !important; width: min(680px, 92vw) !important; height: min(86vh, 860px) !important; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }

  /* Booking screen: wider, services in two columns */
  .th-bk { max-width: 1040px !important; }
  .th-bk-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; align-content: start; }
  .th-bk-bar { width: min(560px, calc(100% - 28px)) !important; }
}

/* Smaller desktops and tablets in landscape: fewer, larger cards per row */
@media (min-width: 900px) and (max-width: 1199px) {
  .th-store > div:last-child { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .th-products > div:nth-child(9) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .th-salon > div:last-child { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
