/* ===========================================================================
   COMMERCE — product pages, buy forms, basket, filters, comparison
   All WooCommerce-ready: the class names and data attributes match what a real
   cart needs, so the swap is a drop-in.
   ========================================================================= */

/* --- Product layout ------------------------------------------------------ */
/* minmax(0, …) rather than a bare fr: a bare fr track has a min-content floor,
   so one nowrap row inside the buy panel blows the whole column past the
   viewport on a phone. */
.product { display: grid; gap: clamp(2rem, 4vw, 4rem); grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: start; }
.product > * { min-width: 0; }
@media (max-width: 900px) { .product { grid-template-columns: minmax(0, 1fr); } }

.product__gallery { position: sticky; top: calc(var(--nav-h) + 1.5rem); display: grid; gap: .75rem; }
.product__main { position: relative; aspect-ratio: 1; border-radius: var(--r-xl); overflow: hidden; background: var(--chalk-deep); }
.product__main img { width: 100%; height: 100%; object-fit: cover; }
.product__thumbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr)); gap: .5rem; }
.product__thumb { aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; border: 2px solid transparent; background: var(--chalk-deep); }
.product__thumb.is-on { border-color: var(--accent); }
.product__thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .product__gallery { position: static; } }

.product__info > * + * { margin-top: 1.15rem; }
.product__title { font-size: var(--fs-xl); }
.product__sub { font-size: var(--fs-lead); color: var(--text-soft); line-height: 1.5; }
.product__rating { display: flex; align-items: center; gap: .5rem; font-size: var(--fs-sm); color: var(--text-soft); }
.product__rating .dse-icon { width: .95rem; height: .95rem; color: var(--corn-deep); fill: currentColor; stroke: none; }
.product__tags { display: flex; flex-wrap: wrap; gap: .4rem; }

/* --- Buy form ------------------------------------------------------------ */
.buy { display: grid; gap: 1rem; padding: 1.5rem; border-radius: var(--r-lg); background: var(--surface-raised); border: 1px solid var(--line); }
.buy__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .55rem; }
.buy__price strong { font-family: var(--font-display); font-size: var(--fs-l); font-weight: 700; line-height: 1; }
.buy__price s { color: var(--text-faint); font-size: 1.1rem; }
.buy__unit { font-size: var(--fs-sm); color: var(--text-faint); }
.buy__save { font-style: normal; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--claret); color: var(--chalk); padding: .2rem .5rem; border-radius: var(--r-pill); }

.buy__variants { display: grid; gap: .45rem; }
.buy__variant { display: flex; align-items: center; gap: .65rem; padding: .7rem .9rem; border: 1.5px solid var(--line-strong); border-radius: var(--r-md); cursor: pointer; transition: border-color var(--t-quick), background var(--t-quick); }
.buy__variant:hover { border-color: var(--accent); }
.buy__variant input { accent-color: var(--accent); }
.buy__variant span { flex: 1; font-weight: 600; font-size: .93rem; }
.buy__variant b { font-family: var(--font-mono); font-size: .93rem; }
.buy__variant:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }

.buy__row { display: flex; gap: .65rem; align-items: stretch; }
.qty { display: flex; align-items: center; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); overflow: hidden; flex: none; }
.qty__btn { width: 2.5rem; height: 100%; display: grid; place-items: center; color: var(--text-soft); transition: background var(--t-quick); }
.qty__btn:hover { background: var(--chalk-deep); color: var(--text); }
.qty__input { width: 2.6rem; text-align: center; border: 0; background: transparent; font-weight: 700; -moz-appearance: textfield; }
.qty__input::-webkit-outer-spin-button, .qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.btn--buy { flex: 1; }

.buy__note { display: flex; gap: .5rem; align-items: flex-start; font-size: var(--fs-xs); color: var(--text-faint); line-height: 1.5; }
.buy__note .dse-icon { flex: none; margin-top: .1rem; }
.buy__note--age { color: var(--claret); font-weight: 600; }
.buy__note--out { color: var(--text-soft); }
.buy__placeholder { display: flex; gap: .5rem; align-items: center; font-size: var(--fs-xs); color: var(--text-faint); padding-top: .6rem; border-top: 1px dashed var(--line-strong); font-style: italic; }

/* --- Quick add on cards -------------------------------------------------- */
.quick-add {
  position: absolute; right: .7rem; bottom: .7rem; z-index: 3;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--ochre); color: var(--ink); display: grid; place-items: center;
  box-shadow: var(--sh-md); opacity: 0; transform: translateY(6px) scale(.9);
  transition: opacity var(--t-quick), transform var(--t-quick) var(--ease-gate), background var(--t-quick);
}
.card:hover .quick-add, .quick-add:focus-visible { opacity: 1; transform: none; }
.quick-add:hover { background: var(--ochre-lift); }
.quick-add--out { background: var(--slate); color: var(--chalk); }
@media (hover: none) { .quick-add { opacity: 1; transform: none; } }

/* --- Product grid with filters ------------------------------------------ */
.shopfront { display: grid; gap: 2rem; grid-template-columns: 15rem 1fr; align-items: start; }
@media (max-width: 1000px) { .shopfront { grid-template-columns: 1fr; } }
.filters { position: sticky; top: calc(var(--nav-h) + 1.5rem); display: grid; gap: 1.5rem; }
@media (max-width: 1000px) { .filters { position: static; } }
.filter__title { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--text-soft); margin-bottom: .55rem; }
.filter__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.filter__list a { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .55rem; border-radius: var(--r-sm); font-size: .9rem; text-decoration: none; color: var(--text-soft); }
.filter__list a:hover, .filter__list a.is-on { background: var(--chalk-deep); color: var(--text); }
.filter__list em { font-style: normal; color: var(--text-faint); font-size: var(--fs-xs); }

.shop-bar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding-bottom: 1.15rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.shop-bar__count { font-size: var(--fs-sm); color: var(--text-faint); }
.shop-bar__sort { display: flex; align-items: center; gap: .5rem; font-size: var(--fs-sm); }
.shop-bar__sort select { padding: .45rem .7rem; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--paper); }

/* --- Basket drawer ------------------------------------------------------- */
.drawer {
  position: fixed; inset: 0 0 0 auto; z-index: var(--z-modal);
  width: min(26rem, 100vw); background: var(--surface); box-shadow: var(--sh-xl);
  display: flex; flex-direction: column;
  transform: translateX(100%); visibility: hidden;
  transition: transform var(--t-slow) var(--ease-paper), visibility var(--t-slow);
}
.drawer.is-open { transform: none; visibility: visible; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); }
.drawer__title { font-family: var(--font-display); font-size: 1.3rem; }
.drawer__body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }
.drawer__foot { padding: 1.25rem 1.5rem; border-top: 1px solid var(--line); background: var(--surface-raised); display: grid; gap: .75rem; }
.drawer__total { display: flex; justify-content: space-between; font-weight: 700; }
.drawer__empty { text-align: center; padding-block: 3rem; color: var(--text-faint); }
.drawer__empty .dse-beast { width: 9rem; margin: 0 auto 1rem; opacity: .25; color: var(--accent); }

.line { display: grid; grid-template-columns: 4rem 1fr auto; gap: .85rem; padding: .85rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.line__img { aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--chalk-deep); }
.line__t { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.line__m { font-size: var(--fs-xs); color: var(--text-faint); }
.line__p { font-family: var(--font-mono); font-weight: 700; font-size: .9rem; }
.line__x { color: var(--text-faint); }
.line__x:hover { color: var(--claret); }

.scrim { position: fixed; inset: 0; z-index: calc(var(--z-modal) - 1); background: rgba(35,33,30,.55); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity var(--t-base), visibility var(--t-base); }
.scrim.is-on { opacity: 1; visibility: visible; }

/* --- Price comparison table ---------------------------------------------- */
.compare { overflow-x: auto; }
.compare table { width: 100%; border-collapse: separate; border-spacing: .5rem 0; min-width: 44rem; }
.compare th, .compare td { padding: .9rem 1rem; text-align: left; vertical-align: middle; }
.compare thead th { background: var(--ink); color: var(--chalk); border-radius: var(--r-md) var(--r-md) 0 0; font-family: var(--font-display); font-size: 1.1rem; }
.compare thead th:first-child { background: transparent; }
.compare tbody td { background: var(--surface-raised); border-bottom: 1px solid var(--line); font-size: .92rem; }
.compare tbody td:first-child { background: transparent; font-weight: 700; }
.compare tbody tr:last-child td { border-radius: 0 0 var(--r-md) var(--r-md); border-bottom: 0; }
.compare .yes { color: var(--moss); }
.compare .no  { color: var(--text-faint); }
.compare .feat { font-weight: 800; color: var(--accent-deep); }

/* --- Tier cards ---------------------------------------------------------- */
.tiers { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); align-items: stretch; }
.tier { display: flex; flex-direction: column; gap: .85rem; padding: 1.75rem 1.5rem; border-radius: var(--r-lg); border: 2px solid var(--line); background: var(--surface-raised); position: relative; }
.tier.is-featured { border-color: var(--accent); box-shadow: var(--sh-lg); }
.tier.is-featured::before { content: attr(data-flag); position: absolute; top: -.75rem; left: 1.5rem; background: var(--accent); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: .25rem .7rem; border-radius: var(--r-pill); }
.tier__chapter { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); }
.tier__name { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; line-height: 1.05; }
.tier__price { font-family: var(--font-display); font-size: 2.25rem; font-weight: 900; line-height: 1; }
.tier__price small { font-family: var(--font-ui); font-size: .85rem; font-weight: 600; color: var(--text-faint); }
.tier__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; font-size: .9rem; }
.tier__list li { display: flex; gap: .5rem; align-items: flex-start; }
.tier__list .dse-icon { flex: none; margin-top: .18rem; width: 1rem; height: 1rem; color: var(--moss); }
.tier__cta { margin-top: auto; padding-top: .75rem; }

/* --- Booking widget ------------------------------------------------------ */
.booking { display: grid; gap: 1.25rem; padding: 1.75rem; border-radius: var(--r-lg); background: var(--surface-raised); border: 1px solid var(--line); }
.booking__row { display: flex; flex-wrap: wrap; gap: .75rem; }
.booking__slots { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); }
.slot { padding: .6rem .5rem; text-align: center; border-radius: var(--r-sm); border: 1.5px solid var(--line-strong); font-family: var(--font-mono); font-size: .88rem; font-weight: 700; transition: all var(--t-quick); }
.slot:hover:not(:disabled) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.slot.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.slot:disabled { opacity: .32; text-decoration: line-through; cursor: not-allowed; }

/* --- Stockist finder ----------------------------------------------------- */
.finder { display: grid; gap: 1.5rem; grid-template-columns: 20rem 1fr; }
@media (max-width: 900px) { .finder { grid-template-columns: 1fr; } }
.finder__list { display: grid; gap: .5rem; max-height: 30rem; overflow-y: auto; }
.finder__item { padding: .85rem 1rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-raised); }
.finder__item b { display: block; font-size: .95rem; }
.finder__item span { font-size: var(--fs-xs); color: var(--text-faint); }
.finder__map { border-radius: var(--r-lg); overflow: hidden; background: var(--chalk-deep); min-height: 22rem; position: relative; }
