/* =========================================================
   Shop grid, cart drawer, product page
   ========================================================= */
.btn-block { width: 100%; }
.btn-grow { flex: 1; }
.btn-sep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; }
body.no-scroll { overflow: hidden; }

/* ---------- Filter chips ---------- */
.chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: -24px 0 48px; }
.chip {
  padding: 10px 20px; border-radius: 999px; border: 1.5px solid var(--line-strong);
  background: transparent; color: var(--olive); font-weight: 600; font-size: 14px;
  transition: background .25s, color .25s, border-color .25s;
}
.chip:hover { border-color: var(--olive); }
.chip[aria-pressed="true"] { background: var(--olive); border-color: var(--olive); color: var(--cream); }
.product[hidden] { display: none; }
.products { row-gap: 32px; }

/* Product card refinements */
.product-img { display: block; }
.product-meta h3 a { transition: color .2s; }
.product-meta h3 a:hover { color: var(--amber); }
.quick-view {
  position: absolute; left: 50%; bottom: 16px; z-index: 2;
  padding: 10px 18px; border-radius: 999px;
  background: rgba(255, 253, 246, .92); color: var(--olive); font-size: 13.5px; font-weight: 600;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transform: translate(-50%, 12px); opacity: 0;
  transition: opacity .35s, transform .45s var(--ease);
}
.product:hover .quick-view, .product-img:focus-visible .quick-view { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Cart drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(42, 33, 3, .42); backdrop-filter: blur(3px); opacity: 0; transition: opacity .4s; }
.drawer-scrim.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(440px, 100%); display: flex; flex-direction: column;
  background: var(--paper); box-shadow: -30px 0 80px -30px rgba(42, 33, 3, .5);
  transform: translateX(100%); transition: transform .5s var(--ease);
}
.drawer:not(.open) { box-shadow: none; visibility: hidden; transition: transform .5s var(--ease), visibility 0s .5s, box-shadow 0s .5s; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 16px 28px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 22px; letter-spacing: -.02em; color: var(--olive); }
.drawer-head h2 span { font-weight: 500; color: var(--muted); font-size: 16px; }
.ship-meter { padding: 16px 28px; background: var(--butter); font-size: 14px; color: var(--olive); }
.ship-meter[hidden], .drawer-foot[hidden] { display: none; }
.ship-track { height: 6px; border-radius: 6px; background: rgba(91, 74, 12, .12); margin-top: 10px; overflow: hidden; }
.ship-fill { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--amber-light), var(--amber)); transition: width .6s var(--ease); }
.drawer-items { list-style: none; margin: 0; padding: 8px 28px; overflow-y: auto; flex: 1; }
.drawer-items:empty { display: none; }
.line { display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.line-img { width: 76px; height: 76px; border-radius: 14px; overflow: hidden; background: var(--butter-deep); }
.line-img img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.line-name { display: block; font-weight: 600; color: var(--olive); line-height: 1.3; }
.line-meta { display: block; font-size: 13px; color: var(--muted); margin: 2px 0 10px; }
.line-end { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.line-end strong { color: var(--olive); font-variant-numeric: tabular-nums; }
.line-remove { border: 0; background: none; padding: 0; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.line-remove:hover { color: var(--olive); }
.drawer-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 40px 32px; text-align: center; }
.drawer-empty[hidden] { display: none; }
.drawer-empty svg { width: 56px; height: 56px; fill: var(--butter-deep); }
.drawer-empty p { color: var(--muted); font-size: 15px; }
.drawer-empty strong { display: block; color: var(--olive); font-size: 18px; margin-bottom: 4px; }
.drawer-foot { padding: 20px 28px 28px; border-top: 1px solid var(--line); background: var(--cream); }
.drawer-row { display: flex; justify-content: space-between; font-size: 17px; color: var(--olive); }
.drawer-fine { font-size: 13px; color: var(--muted); margin: 4px 0 16px; }

/* Quantity stepper */
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line-strong); border-radius: 999px; height: 50px; }
.qty button { width: 44px; height: 100%; border: 0; background: none; font-size: 18px; color: var(--olive); border-radius: 999px; }
.qty button:hover:not(:disabled) { background: rgba(91, 74, 12, .06); }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty span { min-width: 28px; text-align: center; font-weight: 600; color: var(--olive); font-variant-numeric: tabular-nums; }
.qty-sm { height: 34px; }
.qty-sm button { width: 32px; font-size: 16px; }

/* ---------- Product page ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 28px; padding: 0; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.crumbs a:hover { color: var(--olive); }
.crumbs [aria-current] { color: var(--olive); font-weight: 600; }

.pdp { padding-bottom: 110px; }
.pdp-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.gallery { position: sticky; top: 104px; }
.gallery-main {
  position: relative; aspect-ratio: 1 / 1.05; border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(160deg, #F8E7B5, #EDD28A); box-shadow: var(--shadow); isolation: isolate;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transition: opacity .25s, transform .6s var(--ease); }
.gallery-main img.fading { opacity: 0; transform: scale(1.02); }
.gallery-main .tag { top: 20px; left: 20px; }
.gallery-nav { position: absolute; right: 20px; bottom: 20px; display: flex; gap: 8px; }
.gallery-nav button { width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 253, 246, .9); color: var(--olive); box-shadow: var(--shadow-sm); backdrop-filter: blur(8px); transition: background .25s, color .25s; }
.gallery-nav button:hover { background: var(--olive); color: var(--cream); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.thumb { padding: 0; border: 2px solid transparent; border-radius: 18px; overflow: hidden; aspect-ratio: 1.3; background: var(--butter-deep); transition: border-color .25s, opacity .25s; opacity: .7; isolation: isolate; }
.thumb img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.thumb:hover { opacity: 1; }
.thumb[aria-pressed="true"] { border-color: var(--olive); opacity: 1; }

.buy { padding-top: 8px; }
.buy-rating { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.buy-rating strong { color: var(--olive-ink); }
.buy-rating:hover { color: var(--olive); }
.buy h1 { font-size: clamp(38px, 4.4vw, 56px); font-weight: 800; letter-spacing: -.04em; color: var(--olive); margin-bottom: 8px; }
.buy-note { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--muted); margin-bottom: 22px; }
.buy-price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.buy-price strong { font-size: 32px; font-weight: 700; color: var(--olive-ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.buy-price s { color: var(--muted); font-size: 18px; }
.buy-price s[hidden] { display: none; }
.unit { font-size: 14px; color: var(--muted); }
.buy-desc { color: var(--muted); font-size: 16px; max-width: 52ch; padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }

.opt { border: 0; margin: 0 0 24px; padding: 0; min-width: 0; }
.opt legend { font-size: 14px; font-weight: 700; color: var(--olive); margin-bottom: 12px; padding: 0; }
.opt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opt-stack { display: grid; gap: 10px; }
.opt-card {
  position: relative; cursor: pointer; border: 1.5px solid var(--line-strong); border-radius: 16px;
  background: var(--paper); transition: border-color .25s, background .25s, box-shadow .25s;
}
.opt-card:hover { border-color: var(--olive); }
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.opt-card:has(input:checked) { border-color: var(--olive); background: var(--butter); box-shadow: 0 0 0 1px var(--olive) inset; }
.opt-card:has(input:focus-visible) { outline: 2.5px solid var(--amber); outline-offset: 2px; }
.opt-size { display: flex; flex-direction: column; padding: 14px 16px; }
.opt-size strong { font-size: 16px; color: var(--olive); }
.opt-size span { font-size: 14px; color: var(--olive-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.opt-size small { font-size: 12px; color: var(--muted); margin-top: 2px; }
.opt-row { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 14px; padding: 16px 18px; }
.opt-dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.opt-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--olive); transform: scale(0); transition: transform .3s var(--ease); }
.opt-card:has(input:checked) .opt-dot { border-color: var(--olive); }
.opt-card:has(input:checked) .opt-dot::after { transform: scale(1); }
.opt-text strong { display: block; font-size: 15px; color: var(--olive); }
.opt-text small { font-size: 13px; color: var(--muted); }
.opt-price { font-weight: 700; color: var(--olive); font-variant-numeric: tabular-nums; }

.buy-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.save-btn { width: 50px; height: 50px; border: 1.5px solid var(--line-strong); flex: none; }
.save-btn[aria-pressed="true"] { color: #C2410C; border-color: currentColor; }
.save-btn[aria-pressed="true"] svg { fill: currentColor; }
.ship-hint { font-size: 14px; color: var(--muted); margin: 14px 0 24px; }
.ship-hint strong { color: var(--olive); }
.buy-perks { list-style: none; margin: 0 0 28px; padding: 18px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border-block: 1px solid var(--line); }
.buy-perks li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--olive); font-weight: 500; line-height: 1.3; }
.buy-perks svg { flex: none; width: 22px; height: 22px; color: var(--amber); }

.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  padding: 18px 0; font-weight: 600; color: var(--olive);
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; font-size: 22px; font-weight: 400; transition: transform .3s var(--ease); }
.accordion details[open] summary::after { transform: rotate(45deg); }
.accordion details p { color: var(--muted); font-size: 15px; padding-bottom: 20px; max-width: 58ch; }

/* Profile */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; align-items: stretch; }
.panel { background: var(--paper); border-radius: var(--radius-md); padding: 32px; box-shadow: var(--shadow-sm); border: 1px solid rgba(255,255,255,.8); }
.panel h3 { font-size: 18px; color: var(--olive); margin-bottom: 22px; letter-spacing: -.015em; }
.panel-image { padding: 0; overflow: hidden; min-height: 360px; position: relative; }
.panel-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.meters { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.meter-label { display: flex; justify-content: space-between; font-size: 14px; color: var(--olive); font-weight: 600; margin-bottom: 8px; }
.meter-label span:last-child { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.meter i { height: 8px; border-radius: 8px; background: rgba(91, 74, 12, .1); }
.meter i.on { background: linear-gradient(90deg, var(--amber-light), var(--amber)); }
.specs { margin: 0; display: grid; }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--line-strong); font-size: 14px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; color: var(--olive); font-weight: 600; text-align: right; }
.pairs-title { margin-top: 28px; }
.pairs { list-style: none; margin: -8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pairs li { padding: 7px 14px; border-radius: 999px; background: var(--butter); color: var(--olive); font-size: 13.5px; font-weight: 500; }

/* Reviews */
.rv-grid { display: grid; grid-template-columns: 320px 1fr; gap: 56px; align-items: start; }
.rv-summary { position: sticky; top: 110px; padding: 32px; border-radius: var(--radius-md); background: var(--butter); text-align: center; }
.rv-score { display: block; font-size: 64px; font-weight: 800; letter-spacing: -.04em; color: var(--olive); line-height: 1; }
.rv-stars { justify-content: center; margin: 10px 0 6px; }
.rv-stars svg { width: 18px; height: 18px; }
.rv-summary > p { font-size: 14px; color: var(--muted); }
.rv-bars { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 10px; }
.rv-bars li { display: grid; grid-template-columns: 48px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; color: var(--olive); font-variant-numeric: tabular-nums; }
.rv-bars li span:last-child { text-align: right; color: var(--muted); }
.rv-track { height: 8px; border-radius: 8px; background: rgba(91, 74, 12, .12); overflow: hidden; }
.rv-track div { height: 100%; border-radius: 8px; background: var(--amber); }
.rv-summary > .rv-recommend { padding-top: 18px; border-top: 1px solid var(--line-strong); color: var(--olive); }
.rv-list { list-style: none; margin: 0; padding: 0; display: grid; }
.rv-item { padding: 28px 0; border-bottom: 1px solid var(--line); }
.rv-item:first-child { padding-top: 0; }
.rv-head { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; margin-bottom: 14px; }
.rv-head .avatar { width: 44px; height: 44px; font-size: 14px; }
.rv-head strong { display: block; color: var(--olive); font-size: 15px; }
.rv-verified { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: #4D7C0F; font-weight: 500; }
.rv-head time { font-size: 13px; color: var(--muted); }
.rv-item h3 { font-size: 18px; color: var(--olive); margin: 10px 0 6px; letter-spacing: -.015em; }
.rv-item p { color: var(--muted); font-size: 15.5px; max-width: 64ch; }
.rv-item small { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); }

/* Sticky buy bar (mobile) */
.sticky-buy { display: none; }

@media (max-width: 1000px) {
  .pdp-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .gallery { position: static; }
  .profile-grid { grid-template-columns: 1fr 1fr; }
  .panel-image { grid-column: 1 / -1; grid-row: 1; min-height: 300px; }
  .rv-grid { grid-template-columns: 1fr; gap: 40px; }
  .rv-summary { position: static; }
}

@media (max-width: 820px) {
  .sticky-buy {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
    padding: 8px; border-radius: 20px;
    background: rgba(255, 253, 246, .95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line); box-shadow: 0 20px 40px -16px rgba(42, 33, 3, .45);
    transform: translateY(calc(100% + 24px)); transition: transform .45s var(--ease);
  }
  .sticky-buy.show { transform: none; }
  .sticky-buy img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
  .sticky-buy div { flex: 1; min-width: 0; line-height: 1.3; }
  .sticky-buy strong { display: block; font-size: 14px; color: var(--olive); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sticky-buy span { font-size: 13px; color: var(--muted); }
  .pdp-page ~ .toast { bottom: 92px; }
}

@media (max-width: 560px) {
  .chips { margin-top: -12px; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .chip { flex: none; }
  .buy-note { font-size: 21px; }
  .opt-grid { gap: 8px; }
  .opt-size { padding: 12px; }
  .buy-actions { flex-wrap: wrap; }
  .buy-actions .btn-grow { order: 3; flex-basis: 100%; }
  .buy-actions .qty { flex: 1; justify-content: space-between; }
  .buy-perks { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .panel { padding: 24px; }
  .line { grid-template-columns: 64px 1fr auto; gap: 12px; }
  .line-img { width: 64px; height: 64px; }
  .drawer-head, .ship-meter, .drawer-foot { padding-left: 20px; padding-right: 20px; }
  .drawer-items { padding: 4px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
