/* ==========================================================================
   The cart button and the mini-cart (assets/js/ui/mini-cart.js).
   --------------------------------------------------------------------------
   The button: a dark circle with a white bag, always visible in the sticky
   header, with an emerald count. The mini-cart: a 400 px panel under the
   header on a computer, a bottom sheet on a phone. Emerald (#50C878) is
   the purchase colour, with dark type on it (white on emerald is too faint).
   ========================================================================== */

/* ── the cart button ─────────────────────────────────────────────────── */
.site-storefront .nav .cart-btn {
  position: relative; width: 44px; height: 44px; min-width: 44px; padding: 0;
  display: inline-grid; place-items: center; border-radius: 50%;
  background: #17231D; color: #fff; border: 0; box-shadow: 0 1px 2px rgba(0,0,0,.12);
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.site-storefront .nav .cart-btn svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 1.6; fill: none; }
.site-storefront .nav .cart-btn:hover { background: #22332A; box-shadow: 0 4px 12px rgba(23,35,29,.22); }
@media (hover: hover) { .site-storefront .nav .cart-btn:hover { transform: translateY(-1px); } }
.site-storefront .nav .cart-btn:active { transform: scale(.94); transition-duration: 60ms; }
.site-storefront .nav .cart-btn:focus-visible { outline: 3px solid #50C878; outline-offset: 2px; }
.site-storefront .nav .cart-btn__count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px; border: 2px solid var(--surface, #fff);
  background: #50C878; color: #0A2313; font-size: 11px; font-weight: 800; line-height: 1;
}
.site-storefront .nav .cart-btn__count[data-empty="true"] { display: none; }
/* an arrival: one short pulse of the badge, no more */
.site-storefront .nav .cart-btn.is-bumped .cart-btn__count { animation: mc-badge 420ms ease; }
@keyframes mc-badge { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
:root[data-theme="dark"] .site-storefront .nav .cart-btn, :root[data-theme="dark"] .site-storefront .nav .cart-btn:hover { background: #F3F4F8; }
:root[data-theme="dark"] .site-storefront .nav .cart-btn svg { stroke: #0E0F13; }

/* ── the mini-cart ───────────────────────────────────────────────────── */
.mc {
  --mc-bg: var(--surface, #fff); --mc-text: var(--text, #0E0F13); --mc-dim: var(--text-2, #5B6660);
  --mc-line: var(--line, rgba(14,15,19,.10)); --mc-sunk: var(--surface-sunk, #F4F5F3);
  position: fixed; z-index: 95; right: 16px; top: var(--mc-top, 84px); width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}
.mc[hidden] { display: none; }
.mc__panel {
  max-height: calc(100vh - var(--mc-top, 84px) - 16px); max-height: calc(100dvh - var(--mc-top, 84px) - 16px);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
  background: var(--mc-bg); color: var(--mc-text); border: 1px solid var(--mc-line); border-radius: 22px;
  box-shadow: 0 24px 60px rgba(14,15,19,.18), 0 2px 8px rgba(14,15,19,.06);
  transform: translateX(calc(100% + 24px)); opacity: 0; transition: transform 260ms cubic-bezier(.2,.8,.2,1), opacity 200ms ease;
  pointer-events: auto; outline: none;
}
.mc.is-open .mc__panel { transform: none; opacity: 1; }
.mc__panel:focus-visible { box-shadow: 0 0 0 3px #50C878, 0 24px 60px rgba(14,15,19,.18); }
.mc__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 10px 20px; border-bottom: 1px solid var(--mc-line); }
.mc__title { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.mc__added { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: var(--green-ink, #0F7A45); font-size: .875rem; font-weight: 600; }
.mc__added svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; flex: none; }
.mc__close { width: 44px; height: 44px; display: grid; place-items: center; flex: none; border: 0; border-radius: 50%; background: var(--mc-sunk); color: inherit; cursor: pointer; }
.mc__close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.mc__scroll { overflow-y: auto; overscroll-behavior: contain; padding: 6px 20px 12px; }
.mc__lines { list-style: none; margin: 0; padding: 0; }
.mc__line { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) 44px; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--mc-line); }
.mc__line:last-child { border-bottom: 0; }
.mc__line.is-new { animation: mc-new 900ms ease; }
@keyframes mc-new { 0% { background: rgba(80,200,120,.16); } 100% { background: transparent; } }
.mc__thumb { width: 64px; height: 64px; border-radius: 12px; background: var(--mc-sunk); display: grid; place-items: center; overflow: hidden; }
.mc__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.mc__thumb--sm { width: 44px; height: 44px; border-radius: 10px; }
.mc__dot { width: 22px; height: 22px; border-radius: 50%; background: var(--art, #8A90A0); }
.mc__main { min-width: 0; display: grid; gap: 3px; align-content: start; }
.mc__name { font-weight: 650; font-size: .95rem; line-height: 1.25; }
.mc__detail { display: flex; align-items: center; gap: 6px; color: var(--mc-dim); font-size: .82rem; line-height: 1.3; }
.mc__swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); flex: none; }
.mc__incl { font-size: .82rem; color: var(--mc-dim); }
.mc__incl summary { cursor: pointer; min-height: 28px; display: flex; align-items: center; color: var(--mc-text); font-weight: 600; }
.mc__incl ul { margin: 2px 0 4px; padding-left: 18px; }
.mc__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.mc__stepper { display: inline-flex; align-items: center; border: 1px solid var(--mc-line); border-radius: 999px; background: var(--mc-sunk); }
.mc__stepper button { width: 44px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 999px; }
.mc__stepper button:disabled { opacity: .35; cursor: default; }
.mc__stepper svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.mc__qty { min-width: 2.2em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 650; }
.mc__amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mc__remove { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--mc-dim); cursor: pointer; border-radius: 50%; }
.mc__remove:hover { background: var(--mc-sunk); color: var(--mc-text); }
.mc__remove svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.5; fill: none; }
.mc__h3 { margin: 14px 0 6px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--mc-dim); }
.mc__addons ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mc__addon { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.mc__addon-name { display: grid; font-size: .88rem; font-weight: 600; }
.mc__addon-price { color: var(--mc-dim); font-weight: 500; font-size: .82rem; }
.mc__addon-btn { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--mc-line); background: var(--mc-bg); color: inherit; font-weight: 700; cursor: pointer; }
.mc__foot { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--mc-line); display: grid; gap: 8px; background: var(--mc-bg); }
.mc__summary { display: grid; gap: 8px; padding: 12px 0 4px; border-top: 1px solid var(--mc-line); }
.mc__sum { display: grid; gap: 4px; }
.mc__sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.mc__sum-row strong { font-variant-numeric: tabular-nums; }
.mc__sum-row.is-minus strong { color: var(--green-ink, #0F7A45); }
.mc__ship { display: grid; gap: 6px; padding: 10px 12px; border-radius: 14px; background: var(--mc-sunk); }
.mc__shiphead { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--mc-dim); }
.mc__country { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--mc-bg); border: 1px solid var(--mc-line); }
.mc__country button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: inherit; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.mc__country button[aria-checked="true"] { background: #17231D; color: #fff; }
.mc__where { margin: 0; font-weight: 600; color: var(--mc-text); }
.mc__note { margin: 0; color: var(--mc-dim); font-size: .8rem; line-height: 1.4; }
.mc__note--warn { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(245,166,35,.12); color: var(--mc-text); }
.mc__total { font-size: 1.05rem; align-items: baseline; }
.mc__total strong { font-size: 1.15rem; }
.mc__actions { display: grid; gap: 8px; margin-top: 4px; }
.mc__btn { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; }
.mc__btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.mc__btn--pay { border: 0; background: #50C878; color: #0A2313; }
.mc__btn--pay:hover { background: #45BC6D; }
.mc__btn--ghost { border: 1px solid var(--mc-line); background: transparent; color: inherit; min-height: 46px; }
.mc button:focus-visible { outline: 3px solid #50C878; outline-offset: 2px; }
.mc__empty { padding: 28px 4px; text-align: center; display: grid; gap: 6px; }
.mc__empty p { margin: 0; color: var(--mc-dim); }
.mc__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* a phone: a bottom sheet, never the whole catalogue */
@media (max-width: 760px) {
  .mc { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: min(72vh, 640px); }
  .mc__panel { max-height: min(72vh, 640px); max-height: min(72dvh, 640px); border-radius: 22px 22px 0 0; border-bottom: 0; transform: translateY(100%); }
  .mc__head { padding-bottom: 8px; }
  .mc__line { padding: 10px 0; }
  .mc__head { padding-top: 10px; position: relative; }
  .mc__head::before { content: ''; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--mc-line); }
  .mc__actions { grid-template-columns: 1fr; }
  html.mc-open .mobile-cart { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .mc__panel, .site-storefront .nav .cart-btn { transition: none; }
  .mc__line.is-new, .site-storefront .nav .cart-btn.is-bumped .cart-btn__count { animation: none; }
}
