/* Lume Stands: the cart drawer, the watch picker and the cart lines (gate 3b). Loaded on every shop page and, by
   js/shop/boot.js, on the home page, where they open over the 3D world. Every rule is scoped to an overlay (.ov)
   or the cart page's box (.cart-page), so nothing here touches the world's own page. Tokens come from
   css/world.css (--fg, --chip, --rule, ...); the few the shop adds are set here on the overlay itself. */

.ov, .cart-page {
  --sheet: rgba(246, 249, 253, .9);
  --btn: #EE9A2F;
  --btn-hover: #F2A847;
  --btn-ink: #16263A;
}
html.night .ov, html.night .cart-page { --sheet: rgba(22, 30, 64, .9); }

/* ---- the shell: a sheet from the bottom on phones; a drawer from the right (cart) or a drop-down (picker) on
   wider screens */
.ov { position: fixed; inset: 0; z-index: 60; font-family: Figtree, 'Helvetica Neue', Arial, sans-serif; }
.ov[hidden] { display: none; }
.ov-scrim { position: absolute; inset: 0; background: rgba(10, 18, 40, .32); opacity: 0; transition: opacity .3s ease; }
.ov.open .ov-scrim { opacity: 1; }
/* the sheet is a slab of the site's Liquid Glass (css/world.css --lg tokens): blurred sky under a fill with body,
   a specular rim along its top edge. It rises with a long ease-out and drops away quicker, easing in */
.ov .sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; max-height: 88svh; display: flex; flex-direction: column;
  border-radius: 24px 24px 0 0; color: var(--fg);
  background: var(--lg-sheen) 0 0 / 160% 120% no-repeat, var(--sheet);
  box-shadow: inset 1px 1px 0 var(--lg-hi), inset -1px 0 0 var(--lg-lo), 0 -12px 40px -8px rgba(16, 30, 60, .26);
  -webkit-backdrop-filter: blur(18px) saturate(1.7); backdrop-filter: blur(18px) saturate(1.7);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.32, 0, .67, 0); padding-bottom: env(safe-area-inset-bottom);
  text-shadow: none; overscroll-behavior: contain; text-align: left; line-height: 1.4;
}
.ov.open .sheet { transform: none; transition: transform .44s cubic-bezier(.16, 1, .3, 1); }
.ov .sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 8px 20px; }
.ov .sheet-head h2 { margin: 0; font-family: var(--serif-text); font-variation-settings: 'opsz' 48; font-size: 23px; font-weight: 540; flex: 1; letter-spacing: -.012em; }
.ov .sheet-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; }
.ov .sheet-close:hover { background: var(--chip); }
.ov .sheet-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; fill: none; }
.ov .sheet-body { overflow-y: auto; padding: 4px 20px 20px; overscroll-behavior: contain; }
.ov .grab { width: 40px; height: 4px; border-radius: 2px; background: currentColor; opacity: .2; margin: 8px auto 0; }
.ov :focus-visible, .cart-page :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- buttons and fields inside (the shop pages style the same names; these keep the home page's look out) */
:is(.ov, .cart-page) .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px;
  border: 0; border-radius: 999px; background: var(--btn); color: var(--btn-ink); font: inherit; font-weight: 650; font-size: 16.5px;
  text-decoration: none; text-shadow: none; cursor: pointer; transition: background .2s ease;
}
:is(.ov, .cart-page) .btn:hover { background: var(--btn-hover); }
:is(.ov, .cart-page) .btn[disabled], :is(.ov, .cart-page) .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
:is(.ov, .cart-page) .btn[disabled]:hover, :is(.ov, .cart-page) .btn[aria-disabled="true"]:hover { background: var(--btn); }
:is(.ov, .cart-page) .btn-line {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 999px;
  border: 1.5px solid currentColor; color: var(--fg); text-decoration: none; font-weight: 600; background: transparent; cursor: pointer;
}
:is(.ov, .cart-page) .btn-line:hover { background: var(--chip); }
.ov input[type="search"] {
  font: inherit; color: var(--ink); background: rgba(255, 255, 255, .92); border: 1px solid rgba(22, 38, 58, .22); border-radius: 12px;
  min-height: 48px; padding: 10px 14px; width: 100%; box-sizing: border-box; text-shadow: none;
}
.ov input::placeholder { color: #5D6B7D; }

/* ---- cart lines (drawer and cart page) */
:is(.ov, .cart-page) .cart-lines { list-style: none; margin: 0; padding: 0; }
/* the picture spans the name and meta rows; the spare height goes below the meta (1fr), so a one-line meta sits
   right under the name instead of drifting down */
:is(.ov, .cart-page) .cline { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto; gap: 2px 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--rule); transition: background-color 1.2s ease; }
:is(.ov, .cart-page) .cline.flash { background: rgba(238, 154, 47, .14); animation: line-in .5s cubic-bezier(.16, 1, .3, 1) .14s backwards; }   /* the stand just added settles into its line */
@keyframes line-in { from { opacity: 0; transform: translateY(-10px); } }
:is(.ov, .cart-page) .line-pic { grid-row: span 2; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: rgba(188, 211, 234, .5); }
:is(.ov, .cart-page) .line-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
:is(.ov, .cart-page) .line-name { font-family: var(--serif-text); font-variation-settings: 'opsz' 30; font-weight: 540; font-size: 17.5px; letter-spacing: -.005em; }
:is(.ov, .cart-page) .line-name a { display: inline-block; padding: 10px 0; margin: -8px 0; text-decoration: none; color: inherit; }   /* a 42 px tall target in a 26 px line */
:is(.ov, .cart-page) .line-name a:hover { text-decoration: underline; }
:is(.ov, .cart-page) .line-meta { grid-column: 2; font-size: 13.5px; color: var(--fg-soft); }
:is(.ov, .cart-page) .line-price { grid-column: 3; grid-row: 1; padding-top: 2px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
:is(.ov, .cart-page) .line-ctl { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
:is(.ov, .cart-page) .qty { display: inline-flex; align-items: center; border: 1px solid var(--chip-line); border-radius: 999px; }
:is(.ov, .cart-page) .qty-btn { width: 44px; height: 44px; border: 0; background: transparent; color: inherit; font: inherit; font-size: 20px; line-height: 1; cursor: pointer; border-radius: 999px; }
:is(.ov, .cart-page) .qty-btn:hover { background: var(--chip); }
:is(.ov, .cart-page) .qty-btn[disabled] { opacity: .35; cursor: default; }
:is(.ov, .cart-page) .qty-n { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
:is(.ov, .cart-page) .line-remove { min-height: 44px; border: 0; background: none; color: var(--fg-soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; font-size: 14px; }
:is(.ov, .cart-page) .cart-sum { margin-top: 12px; display: grid; gap: 4px; }
:is(.ov, .cart-page) .sum-row { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
:is(.ov, .cart-page) .sum-row.total { font-weight: 650; font-size: 18px; margin-top: 4px; }
:is(.ov, .cart-page) .ship-note { margin: 10px 0 0; font-size: 14.5px; }
:is(.ov, .cart-page) .ship-bar { height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; margin-top: 6px; }
:is(.ov, .cart-page) .ship-bar i { display: block; height: 100%; background: var(--btn); border-radius: 3px; }
:is(.ov, .cart-page) .checkout { width: 100%; margin-top: 14px; }
:is(.ov, .cart-page) .checkout-note { margin: 8px 0 0; text-align: center; font-size: 14px; color: var(--fg-soft); }
:is(.ov, .cart-page) .cart-trust { margin: 12px 0 0; font-size: 13.5px; color: var(--fg-soft); text-align: center; }
:is(.ov, .cart-page) .cart-empty { padding: 18px 0 8px; }
:is(.ov, .cart-page) .cart-empty p { margin: 0 0 14px; }

/* ---- the watch picker */
.ov .picker-search { position: sticky; top: 0; z-index: 1; padding: 4px 0 10px; background: var(--sheet); }
.picker .sheet-body { padding-top: 0; }
.ov .picker-now { margin: 0 0 4px; font-size: 14px; color: var(--fg-soft); }
.ov .fam { padding: 10px 0 4px; }
.ov .fam-h { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-soft); }
.ov .fam-h svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.ov .model { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.ov .model-name { font-weight: 600; font-size: 16px; }
.ov .sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.ov .size-btn { min-height: 44px; min-width: 64px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--chip-line); background: transparent; color: inherit; cursor: pointer; font: inherit; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.ov .size-btn:hover { background: var(--chip); }
.ov .size-btn[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); font-weight: 650; }
.ov .picker-none { padding: 16px 0; margin: 0; }

@media (min-width: 761px) {
  .drawer .sheet { left: auto; top: 0; bottom: 0; width: min(440px, 100vw); max-height: none; border-radius: 22px 0 0 22px; transform: translateX(100%); }
  .drawer.open .sheet { transform: none; }
  .drawer .grab { display: none; }
  .picker .sheet { left: var(--pk-x, auto); right: auto; top: var(--pk-y, 80px); bottom: auto; width: 440px; max-height: min(70vh, 640px); border-radius: 18px; transform: translateY(-8px); opacity: 0; transition: transform .25s ease, opacity .25s ease; box-shadow: 0 16px 50px rgba(16, 30, 60, .22); }
  .picker.open .sheet { transform: none; opacity: 1; transition: transform .25s cubic-bezier(.33, 1, .68, 1), opacity .25s ease; }
  .picker .ov-scrim { background: rgba(10, 18, 40, .08); }
  .picker .grab { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ov .sheet, .ov-scrim, :is(.ov, .cart-page) .cline { transition: none !important; }
  :is(.ov, .cart-page) .cline.flash { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .ov .sheet { background: var(--lg-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
