/* ==========================================================================
   SHOP:START  (shop.css)
   Storefront styles for /shop, /shop/p/<slug>, and /shop/checkout/. Layered on
   top of styles.css (which provides :root tokens, .topbar, .button*, footer,
   and the skeleton system) — the shop pages link BOTH stylesheets, so this file
   only adds shop-specific classes and never edits styles.css. Remove this file
   + the /shop pages to fully revert (see SHOP_ROLLBACK.md).
   Strict CSP safe: classes only, no inline styles anywhere.
   ========================================================================== */

:root {
  --shop-max: 1240px;
  --shop-gap: clamp(16px, 2.4vw, 28px);
  --shop-card-radius: 22px;
  --shop-line: rgba(17, 22, 21, 0.10);
  --shop-star: #f0a92b;
  --shop-sale: #d1483b;
  --shop-z-drawer: 1000;
}

.shop-body {
  background: #f8faf9;
  color: var(--ink);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --- Top bar cart button ------------------------------------------------- */
.shop-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cart-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--shop-line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 650;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.cart-button:hover { background: var(--mist); }
.cart-button:active { transform: scale(0.96); }
.cart-button svg { width: 20px; height: 20px; }
.cart-button .cart-button-label { display: none; }
@media (min-width: 640px) { .cart-button .cart-button-label { display: inline; } }

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--sea);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 20px;
  text-align: center;
  transform: scale(0);
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cart-badge.is-visible { transform: scale(1); }
.cart-badge.is-bumped { animation: cartBump 380ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cartBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.45); }
  100% { transform: scale(1); }
}

/* --- Page frame ---------------------------------------------------------- */
.shop-main { display: block; }
.shop-container {
  width: min(100% - 40px, var(--shop-max));
  margin-inline: auto;
}
.shop-section { padding-block: clamp(30px, 5vw, 56px); }
.shop-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.shop-section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  margin: 4px 0 0;
}
.shop-section-head .shop-count { color: var(--muted); font-weight: 600; font-size: 0.95rem; }

/* --- Hero ---------------------------------------------------------------- */
.shop-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  margin: clamp(16px, 3vw, 30px) 0 8px;
  padding: clamp(30px, 6vw, 64px);
  background:
    radial-gradient(120% 120% at 85% 10%, rgba(42, 169, 138, 0.16), transparent 60%),
    linear-gradient(155deg, #0f1917, #16302a 60%, #0f1917);
  color: #f2fbf8;
  isolation: isolate;
}
.shop-hero .eyebrow { color: #8fe6cf; }
.shop-hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  margin: 10px 0 14px;
  max-width: 16ch;
}
.shop-hero p { color: rgba(238, 250, 246, 0.82); max-width: 52ch; font-size: 1.05rem; }
.shop-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.shop-hero-figure {
  position: absolute;
  inset: 0 0 0 auto;
  width: 52%;
  min-width: 280px;
  z-index: 0;
  opacity: 1;
  /* Gentle left-edge fade so the media blends into the headline side but is
     clearly visible across the right half — for any image or animation. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 26%);
  mask-image: linear-gradient(90deg, transparent, #000 26%);
}
.shop-hero > :not(.shop-hero-figure) { position: relative; z-index: 1; }
.shop-hero-figure img, .shop-hero-figure video { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .shop-hero-figure { display: none; } }

/* --- Toolbar: search / sort / filter ------------------------------------ */
.shop-toolbar {
  position: sticky;
  top: 70px;
  z-index: 30;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 0;
  background: rgba(248, 250, 249, 0.86);
  backdrop-filter: blur(16px) saturate(140%);
}
.shop-search {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
}
.shop-search svg {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.shop-search input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 44px;
  border: 1px solid var(--shop-line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 1rem;
  color: var(--ink);
}
.shop-search input:focus-visible {
  outline: none;
  border-color: var(--sea);
  box-shadow: 0 0 0 4px rgba(42, 169, 138, 0.18);
}
.shop-search .shop-search-clear {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  border: none; background: transparent;
  width: 34px; height: 34px;
  border-radius: 999px;
  cursor: pointer; color: var(--muted);
  display: none;
}
.shop-search.has-value .shop-search-clear { display: inline-flex; align-items: center; justify-content: center; }

.shop-sort, .shop-filter-toggle {
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--shop-line);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.shop-filter-toggle svg { width: 18px; height: 18px; }
.shop-filter-toggle .shop-filter-count {
  background: var(--sea); color: #fff;
  border-radius: 999px; font-size: 0.72rem; font-weight: 750;
  min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px;
}

/* --- Category chips ------------------------------------------------------ */
.shop-categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 10px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.shop-chip {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 1px solid var(--shop-line);
  border-radius: 999px;
  background: var(--paper);
  color: #3f4946;
  font-weight: 620;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.shop-chip:hover { background: var(--mist); }
.shop-chip.is-active { background: var(--dark); color: #fff; border-color: var(--dark); }

/* --- Layout: sidebar filters + grid ------------------------------------- */
.shop-layout { display: block; }
@media (min-width: 960px) {
  .shop-layout { display: grid; grid-template-columns: 244px 1fr; gap: 32px; align-items: start; }
}
.shop-filters {
  border: 1px solid var(--shop-line);
  border-radius: var(--radius-md);
  background: var(--paper);
  padding: 18px;
}
.shop-filters h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 10px; }
.shop-filter-group { padding: 14px 0; border-top: 1px solid var(--shop-line); }
.shop-filter-group:first-of-type { border-top: none; padding-top: 0; }
.shop-check {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; cursor: pointer; font-size: 0.95rem;
}
.shop-check input { width: 18px; height: 18px; accent-color: var(--sea); cursor: pointer; }
.shop-price-range { display: flex; gap: 8px; align-items: center; }
.shop-price-range input {
  width: 100%; height: 40px; padding: 0 10px;
  border: 1px solid var(--shop-line); border-radius: 12px; font-size: 0.92rem;
}
.shop-filters-actions { margin-top: 12px; }
.shop-filters-actions button {
  width: 100%; height: 42px; border: 1px solid var(--shop-line);
  border-radius: 12px; background: var(--mist); font-weight: 650; cursor: pointer;
}

/* Desktop filters as sidebar; mobile filters as a drawer */
@media (max-width: 959px) {
  .shop-filters {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(88vw, 360px);
    z-index: var(--shop-z-drawer);
    border-radius: 0;
    transform: translateX(101%);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    box-shadow: -20px 0 60px rgba(16, 23, 22, 0.24);
  }
  .shop-filters.is-open { transform: translateX(0); }
  .shop-filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .shop-filters-head button { border: none; background: transparent; font-size: 1.4rem; cursor: pointer; width: 44px; height: 44px; }
}
@media (min-width: 960px) {
  .shop-filter-toggle { display: none; }
  .shop-filters-head { display: none; }
}

/* --- Product grid + cards ----------------------------------------------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--shop-gap);
}
.shop-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--shop-gap);
}
.shop-scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 82%);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.shop-scroller > * { scroll-snap-align: start; }
@media (min-width: 720px) { .shop-scroller { grid-auto-columns: minmax(240px, 1fr); overflow: visible; } }

.shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--shop-line);
  border-radius: var(--shop-card-radius);
  background: var(--paper);
  overflow: hidden;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease, border-color 220ms ease;
}
.shop-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(26, 45, 40, 0.14);
  border-color: rgba(42, 169, 138, 0.35);
}
.shop-card:focus-within { border-color: var(--sea); }
.shop-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, #eef4f1, #e2ece8);
  overflow: hidden;
}
.shop-card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.shop-card:hover .shop-card-media img { transform: scale(1.05); }

/* Branded placeholder for missing imagery */
.shop-ph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(42,169,138,0.16), transparent 55%),
    linear-gradient(160deg, #eef4f1, #dbe8e3);
}
.shop-ph svg { width: 44%; height: 44%; color: rgba(19, 116, 95, 0.5); }
.shop-ph .shop-ph-mark { position: absolute; bottom: 12px; font-weight: 800; letter-spacing: -0.02em; color: rgba(16,23,22,0.35); font-size: 0.82rem; }

.shop-card-badges {
  position: absolute; top: 12px; left: 12px;
  display: flex; flex-direction: column; gap: 6px; z-index: 2;
}
.shop-badge {
  padding: 5px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 750; letter-spacing: 0.02em;
  background: var(--dark); color: #fff;
}
.shop-badge.is-sale { background: var(--shop-sale); }
.shop-badge.is-new { background: var(--sea); }
.shop-badge.is-featured { background: #1b2a27; }

.shop-wish {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 40px; height: 40px; border-radius: 999px;
  border: none; background: rgba(255,255,255,0.9); backdrop-filter: blur(6px);
  cursor: pointer; display: grid; place-items: center; color: #3f4946;
  transition: transform 160ms ease, color 160ms ease;
}
.shop-wish:hover { transform: scale(1.08); }
.shop-wish svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.shop-wish.is-saved { color: var(--shop-sale); }
.shop-wish.is-saved svg { fill: currentColor; stroke: currentColor; }
.shop-wish.is-pulse { animation: wishPulse 380ms cubic-bezier(0.34,1.56,0.64,1); }
@keyframes wishPulse { 0%{transform:scale(1);} 45%{transform:scale(1.35);} 100%{transform:scale(1);} }

.shop-card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 18px; flex: 1; }
.shop-card-cat { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sea-dark); font-weight: 700; }
.shop-card-title { font-size: 1.06rem; letter-spacing: -0.02em; margin: 0; line-height: 1.15; }
.shop-card-title a { color: inherit; }
.shop-card-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.45; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-card-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.shop-rating { display: inline-flex; align-items: center; gap: 3px; font-size: 0.82rem; color: var(--muted); }
.shop-rating .shop-stars { color: var(--shop-star); letter-spacing: 1px; }
.shop-stock { font-size: 0.8rem; font-weight: 650; }
.shop-stock.in_stock { color: #1f8f5f; }
.shop-stock.low_stock { color: #c07a1a; }
.shop-stock.out_of_stock { color: var(--muted); }
.shop-stock.preorder, .shop-stock.made_to_order { color: var(--sea-dark); }

.shop-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; }
.shop-price { display: inline-flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.shop-price .now { font-size: 1.18rem; font-weight: 750; letter-spacing: -0.02em; }
.shop-price .was { font-size: 0.92rem; color: var(--muted); text-decoration: line-through; }

.shop-add {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px;
  border: none; border-radius: 999px;
  background: var(--dark); color: #fff;
  font-weight: 680; font-size: 0.92rem; cursor: pointer;
  transition: background 160ms ease, transform 140ms ease;
}
.shop-add:hover { background: #000; }
.shop-add:active { transform: scale(0.96); }
.shop-add:disabled { background: #b9c3bf; cursor: not-allowed; }
.shop-add.is-added { background: var(--sea); }
.shop-add svg { width: 18px; height: 18px; }

/* --- States: skeleton / empty / error ----------------------------------- */
.shop-empty, .shop-error {
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--shop-line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.shop-empty svg, .shop-error svg { width: 56px; height: 56px; color: var(--sea); margin-bottom: 12px; }
.shop-empty h3, .shop-error h3 { font-size: 1.3rem; margin: 0 0 6px; }
.shop-empty p, .shop-error p { color: var(--muted); margin: 0 auto 18px; max-width: 46ch; }
.shop-card-skeleton { border: 1px solid var(--shop-line); border-radius: var(--shop-card-radius); overflow: hidden; background: var(--paper); }
.shop-card-skeleton .sk-media { aspect-ratio: 1/1; border-radius: 0; }
.shop-card-skeleton .sk-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.shop-card-skeleton .sk-body span { display: block; }
.shop-card-skeleton .sk-body span:nth-child(1) { height: 14px; width: 40%; }
.shop-card-skeleton .sk-body span:nth-child(2) { height: 18px; width: 80%; }
.shop-card-skeleton .sk-body span:nth-child(3) { height: 34px; width: 100%; }
.shop-ship-est { color: var(--muted); }
.cart-line-end { text-align: right; }
.pdp-sk-lines { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.pdp-sk-lines span { display: block; }
.pdp-sk-lines span:nth-child(1) { height: 16px; width: 30%; }
.pdp-sk-lines span:nth-child(2) { height: 34px; width: 70%; }
.pdp-sk-lines span:nth-child(3) { height: 20px; width: 50%; }

/* Self-contained shimmer (uses shared --sk-* tokens from styles.css) */
.shop-sk { position: relative; overflow: hidden; background: var(--sk-base); border-radius: var(--sk-radius); }
.shop-sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--sk-sheen), transparent);
  animation: shopSkShimmer var(--sk-speed) infinite;
}
@keyframes shopSkShimmer { 100% { transform: translateX(100%); } }

/* --- Cart drawer --------------------------------------------------------- */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(16, 23, 22, 0.5);
  opacity: 0; visibility: hidden;
  transition: opacity 240ms ease, visibility 240ms ease;
  z-index: var(--shop-z-drawer);
}
.cart-overlay.is-open { opacity: 1; visibility: visible; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(94vw, 420px);
  background: var(--paper);
  z-index: calc(var(--shop-z-drawer) + 1);
  transform: translateX(101%);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column;
  box-shadow: -24px 0 70px rgba(16, 23, 22, 0.28);
}
.cart-drawer.is-open { transform: translateX(0); }
.cart-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--shop-line); }
.cart-head h2 { font-size: 1.2rem; margin: 0; }
.cart-close { border: none; background: var(--mist); width: 40px; height: 40px; border-radius: 999px; cursor: pointer; font-size: 1.2rem; }
/* Items sit directly above the totals (grow with content, scroll when long) —
   no big empty gap when the cart holds only a few lines. */
.cart-items { flex: 0 1 auto; overflow-y: auto; padding: 8px 20px; }
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--shop-line); }
.cart-line-media { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--mist); position: relative; }
.cart-line-media img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-title { font-weight: 650; font-size: 0.95rem; line-height: 1.2; margin: 0 0 4px; }
.cart-line-price { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.cart-qty { display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; border: 1px solid var(--shop-line); border-radius: 999px; }
.cart-qty button { width: 32px; height: 32px; border: none; background: transparent; cursor: pointer; font-size: 1.1rem; border-radius: 999px; }
.cart-qty button:hover { background: var(--mist); }
.cart-qty span { min-width: 26px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.cart-line-remove { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.82rem; text-decoration: underline; padding: 0; align-self: start; }
.cart-line-sum { font-weight: 700; font-variant-numeric: tabular-nums; }

.cart-foot { flex: 0 0 auto; border-top: 1px solid var(--shop-line); padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); background: var(--paper); }
.cart-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.95rem; }
.cart-row.total { font-size: 1.15rem; font-weight: 750; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--shop-line); }
.cart-row .muted { color: var(--muted); }
.cart-row var { font-variant-numeric: tabular-nums; font-style: normal; }
.cart-checkout { display: block; width: 100%; margin-top: 12px; min-height: 52px; border: none; border-radius: 16px; background: var(--dark); color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer; text-align: center; }
.cart-checkout:hover { background: #000; }
.cart-clear { display: block; width: 100%; margin-top: 8px; border: none; background: transparent; color: var(--muted); cursor: pointer; text-decoration: underline; padding: 6px; font-size: 0.85rem; }
.cart-empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.cart-empty svg { width: 52px; height: 52px; color: var(--sea); margin-bottom: 10px; }
.cart-note { font-size: 0.78rem; color: var(--muted); text-align: center; margin-top: 10px; }

/* Fly-to-cart micro animation */
.cart-fly {
  position: fixed; z-index: calc(var(--shop-z-drawer) + 5);
  width: 46px; height: 46px; border-radius: 12px; object-fit: cover;
  pointer-events: none; box-shadow: var(--shadow);
  transition: transform 620ms cubic-bezier(0.5, -0.3, 0.7, 0.6), opacity 620ms ease, width 620ms ease, height 620ms ease;
}

/* --- Product detail ------------------------------------------------------ */
.pdp { padding-block: clamp(20px, 4vw, 40px); }
.pdp-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 620; margin-bottom: 18px; }
.pdp-back:hover { color: var(--ink); }
.pdp-grid { display: grid; gap: clamp(24px, 4vw, 48px); }
@media (min-width: 900px) { .pdp-grid { grid-template-columns: 1.05fr 0.95fr; align-items: start; } }

.pdp-gallery { position: sticky; top: 90px; }
.pdp-main-media { position: relative; aspect-ratio: 1/1; border-radius: var(--radius-lg); overflow: hidden; background: linear-gradient(160deg, #eef4f1, #e2ece8); border: 1px solid var(--shop-line); }
.pdp-main-media img, .pdp-main-media video { width: 100%; height: 100%; object-fit: cover; }
.pdp-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pdp-thumb { width: 72px; height: 72px; border-radius: 14px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--mist); padding: 0; }
.pdp-thumb.is-active { border-color: var(--sea); }
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp-thumb.is-video { position: relative; }
.pdp-thumb.is-video::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,0.3); font-size: 0.9rem; }

.pdp-info h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 6px 0 10px; }
.pdp-cat { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sea-dark); font-weight: 700; }
.pdp-summary { color: var(--muted); font-size: 1.05rem; line-height: 1.55; }
.pdp-price { display: flex; align-items: baseline; gap: 12px; margin: 16px 0; font-variant-numeric: tabular-nums; }
.pdp-price .now { font-size: 1.9rem; font-weight: 780; letter-spacing: -0.03em; }
.pdp-price .was { font-size: 1.1rem; color: var(--muted); text-decoration: line-through; }
.pdp-price .save { background: rgba(209,72,59,0.12); color: var(--shop-sale); font-weight: 700; font-size: 0.82rem; padding: 4px 10px; border-radius: 999px; }

.pdp-meta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; color: var(--muted); font-size: 0.92rem; }
.pdp-buy { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.pdp-qty { display: inline-flex; align-items: center; border: 1px solid var(--shop-line); border-radius: 14px; overflow: hidden; }
.pdp-qty button { width: 48px; height: 54px; border: none; background: var(--paper); font-size: 1.3rem; cursor: pointer; }
.pdp-qty button:hover { background: var(--mist); }
.pdp-qty span { min-width: 44px; text-align: center; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.pdp-addbtn { flex: 1 1 220px; min-height: 54px; border: none; border-radius: 14px; background: var(--dark); color: #fff; font-weight: 720; font-size: 1.05rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background 160ms ease, transform 140ms ease; }
.pdp-addbtn:hover { background: #000; }
.pdp-addbtn:active { transform: scale(0.98); }
.pdp-addbtn.is-added { background: var(--sea); }
.pdp-addbtn:disabled { background: #b9c3bf; cursor: not-allowed; }

.pdp-trust { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--shop-line); color: var(--muted); font-size: 0.88rem; }
.pdp-trust span { display: inline-flex; align-items: center; gap: 6px; }
.pdp-trust svg { width: 18px; height: 18px; color: var(--sea); }

/* Collapsible sections */
.pdp-accordion { margin-top: 26px; border-top: 1px solid var(--shop-line); }
.pdp-acc { border-bottom: 1px solid var(--shop-line); }
.pdp-acc summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 2px; font-weight: 680; font-size: 1.02rem;
}
.pdp-acc summary::-webkit-details-marker { display: none; }
.pdp-acc summary::after { content: "+"; font-size: 1.4rem; color: var(--sea-dark); transition: transform 200ms ease; }
.pdp-acc[open] summary::after { content: "\2013"; }
.pdp-acc-body { padding: 0 2px 20px; color: #3a4441; line-height: 1.6; }
.pdp-spec { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.pdp-spec div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--shop-line); }
.pdp-spec dt { color: var(--muted); }
.pdp-spec dd { margin: 0; font-weight: 620; text-align: right; }

/* Reviews */
.pdp-reviews { margin-top: 12px; }
.pdp-review { padding: 14px 0; border-bottom: 1px solid var(--shop-line); }
.pdp-review-head { display: flex; align-items: center; gap: 10px; }
.pdp-review .shop-stars { color: var(--shop-star); }
.review-form { margin-top: 16px; display: grid; gap: 12px; max-width: 520px; }
.review-form input, .review-form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--shop-line); border-radius: 12px; font: inherit; }
.review-stars-input { display: inline-flex; gap: 4px; font-size: 1.6rem; color: #d9e0dd; cursor: pointer; }
.review-stars-input .on { color: var(--shop-star); }

/* --- Checkout ------------------------------------------------------------ */
.checkout { padding-block: clamp(20px, 4vw, 40px); }
.checkout-grid { display: grid; gap: clamp(20px, 4vw, 40px); }
@media (min-width: 900px) { .checkout-grid { grid-template-columns: 1.15fr 0.85fr; align-items: start; } }
.checkout-card { border: 1px solid var(--shop-line); border-radius: var(--radius-lg); background: var(--paper); padding: clamp(18px, 3vw, 28px); }
.checkout-card + .checkout-card { margin-top: 20px; }
.checkout-card h2 { font-size: 1.2rem; margin: 0 0 4px; }
.checkout-card .step-eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sea-dark); font-weight: 750; }
.form-grid { display: grid; gap: 14px; margin-top: 16px; }
@media (min-width: 560px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
.field label { display: block; font-size: 0.86rem; font-weight: 640; margin-bottom: 6px; }
.field label .req { color: var(--shop-sale); }
.field input, .field select {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--shop-line); border-radius: 12px; font: inherit; color: var(--ink); background: var(--paper);
}
.field input:focus-visible, .field select:focus-visible { outline: none; border-color: var(--sea); box-shadow: 0 0 0 4px rgba(42,169,138,0.16); }
.field.has-error input { border-color: var(--shop-sale); }
.field-error { color: var(--shop-sale); font-size: 0.8rem; margin-top: 5px; display: none; }
.field.has-error .field-error { display: block; }

.summary-line { display: flex; justify-content: space-between; padding: 8px 0; font-variant-numeric: tabular-nums; }
.summary-items { max-height: 260px; overflow-y: auto; margin-bottom: 8px; }
.summary-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--shop-line); align-items: center; }
.summary-item img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--mist); }
.summary-item .q { color: var(--muted); font-size: 0.82rem; }
.summary-total { display: flex; justify-content: space-between; font-size: 1.3rem; font-weight: 780; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--shop-line); }
.checkout-trust { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 0.84rem; }
.checkout-trust span { display: inline-flex; align-items: center; gap: 6px; }
.checkout-trust svg { width: 18px; height: 18px; color: var(--sea); }
.checkout-policies { margin-top: 12px; font-size: 0.82rem; color: var(--muted); }
.checkout-policies a { color: var(--sea-dark); text-decoration: underline; }

/* Payment panel reuses the portal look: opaque skeleton over live checkout */
.pay-region { position: relative; min-height: 220px; margin-top: 8px; }
.pay-sk-a { height: 48px; }
.pay-sk-b { height: 120px; }
.pay-sk-c { height: 52px; }
#checkoutRight .summary-card { position: sticky; top: 90px; }
.pay-skeleton { position: absolute; inset: 0; background: var(--paper); display: grid; gap: 12px; align-content: start; padding: 6px; z-index: 3; transition: opacity 300ms ease; }
.pay-skeleton.is-hidden { opacity: 0; pointer-events: none; }
#payElement { min-height: 120px; }
.pay-express { margin-bottom: 14px; }
/* Block (not flex) so the PayPal button iframe flows at its natural full height
   and is never clipped. */
.pay-paypal { display: block; margin-top: 14px; min-height: 48px; }
.pay-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.8rem; margin: 16px 0; }
.pay-divider::before, .pay-divider::after { content: ""; flex: 1; height: 1px; background: var(--shop-line); }
.pay-submit { width: 100%; min-height: 54px; margin-top: 16px; border: none; border-radius: 14px; background: var(--dark); color: #fff; font-weight: 720; font-size: 1.05rem; cursor: pointer; }
.pay-submit:disabled { background: #b9c3bf; cursor: progress; }
.checkout-status { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 0.92rem; display: none; }
.checkout-status.show { display: block; }
.checkout-status.err { background: rgba(209,72,59,0.1); color: #a3392e; }
.checkout-status.ok { background: rgba(42,169,138,0.12); color: var(--sea-dark); }

.checkout-success { text-align: center; padding: 50px 20px; }
.checkout-success .ok-mark { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 999px; background: var(--sea); color: #fff; display: grid; place-items: center; }
.checkout-success .ok-mark svg { width: 40px; height: 40px; }

/* Safe staggered entrance (defaults visible; `both` fill holds 0% during delay) */
.shop-anim-in { animation: shopIn 460ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes shopIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* --- Toast --------------------------------------------------------------- */
.shop-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--dark); color: #fff; padding: 12px 18px; border-radius: 14px;
  font-weight: 640; box-shadow: var(--shadow); z-index: calc(var(--shop-z-drawer) + 10);
  opacity: 0; pointer-events: none; transition: opacity 220ms ease, transform 220ms ease;
  max-width: 90vw;
}
.shop-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- Sticky mobile add-to-cart ------------------------------------------ */
.pdp-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none; gap: 12px; align-items: center;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.94); backdrop-filter: blur(16px);
  border-top: 1px solid var(--shop-line);
  transform: translateY(110%); transition: transform 260ms ease;
}
.pdp-sticky.is-visible { transform: translateY(0); }
.pdp-sticky .sticky-price { font-weight: 780; font-variant-numeric: tabular-nums; }
.pdp-sticky .pdp-addbtn { flex: 1; min-height: 48px; }
@media (max-width: 899px) { .pdp-sticky.enabled { display: flex; } }

/* --- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .shop-card, .shop-card-media img, .cart-drawer, .cart-overlay, .shop-filters,
  .cart-badge, .shop-add, .pdp-addbtn, .shop-toast, .pdp-sticky, .cart-fly, .shop-wish,
  .shop-anim-in, .shop-sk::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   Owner admin (shop-admin.js) — scoped under #shopPanel + the editor modal.
   ========================================================================== */
.shopx-muted { color: var(--muted); font-size: 0.9rem; }
.shopx-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; border-bottom: 1px solid var(--shop-line); }
.shopx-tab { border: none; background: transparent; padding: 12px 14px; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.shopx-tab.is-active { color: var(--ink); border-bottom-color: var(--sea); }

.shopx-list { display: flex; flex-direction: column; gap: 10px; }
.shopx-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--shop-line); border-radius: 16px; background: var(--paper); }
.shopx-row-media { width: 54px; height: 54px; border-radius: 12px; overflow: hidden; background: var(--mist); display: grid; place-items: center; flex: 0 0 auto; font-weight: 800; color: var(--sea-dark); }
.shopx-row-media img { width: 100%; height: 100%; object-fit: cover; }
.shopx-row-main { flex: 1; min-width: 200px; }
.shopx-row-title { font-weight: 700; }
.shopx-row-sub { color: var(--muted); font-size: 0.86rem; margin-top: 2px; }
.shopx-row-sub s { color: #b7bebb; }
.shopx-stock { text-transform: capitalize; }
.shopx-row-badges { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.shopx-row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.shopx-mini { border: 1px solid var(--shop-line); background: var(--paper); border-radius: 999px; padding: 7px 12px; font-size: 0.82rem; font-weight: 620; cursor: pointer; min-height: 36px; }
.shopx-mini:hover { background: var(--mist); }
.shopx-mini.danger { color: var(--shop-sale); border-color: rgba(209,72,59,0.3); font-size: 1rem; line-height: 1; width: 36px; }
.shopx-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 750; background: var(--dark); color: #fff; }
.shopx-badge.muted { background: rgba(17,22,21,0.08); color: var(--muted); }
.shopx-badge.sea { background: var(--sea); }
.shopx-badge.sale { background: var(--shop-sale); }
.shopx-review-body { color: #3a4441; font-size: 0.9rem; margin: 6px 0 0; }

/* Settings */
.shopx-settings { max-width: 760px; }
.shopx-section { border: 1px solid var(--shop-line); border-radius: 16px; padding: 14px 18px 18px; margin: 0 0 16px; }
.shopx-section legend { padding: 0 8px; font-weight: 750; font-size: 0.86rem; color: var(--sea-dark); text-transform: uppercase; letter-spacing: 0.05em; }
.shopx-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--shop-line); }
.shopx-toggle:last-child { border-bottom: none; }
.shopx-toggle input { width: 20px; height: 20px; accent-color: var(--sea); cursor: pointer; }

/* Editor modal */
.shopx-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(16,23,22,0.55); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity 200ms ease; }
.shopx-modal.is-open { opacity: 1; }
.shopx-modal-card { width: min(1080px, 96vw); max-height: 92vh; background: var(--paper); border-radius: 22px; overflow: hidden; transform: translateY(14px); transition: transform 220ms cubic-bezier(0.22,1,0.36,1); display: flex; flex-direction: column; }
.shopx-modal.is-open .shopx-modal-card { transform: none; }
.shopx-editor { display: flex; flex-direction: column; max-height: 92vh; }
.shopx-editor-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--shop-line); }
.shopx-editor-head h2 { margin: 0; font-size: 1.25rem; }
.shopx-close { border: none; background: var(--mist); width: 40px; height: 40px; border-radius: 999px; font-size: 1.3rem; cursor: pointer; }
.shopx-editor-grid { display: grid; grid-template-columns: 1fr; gap: 0; overflow: hidden; }
@media (min-width: 860px) { .shopx-editor-grid { grid-template-columns: 1.35fr 0.65fr; } }
.shopx-form { overflow-y: auto; padding: 18px 22px; }
.shopx-field { display: block; margin-bottom: 14px; }
.shopx-flabel { display: block; font-size: 0.82rem; font-weight: 640; margin-bottom: 6px; }
.shopx-form input[type="text"], .shopx-form input[type="number"], .shopx-form input[type="url"], .shopx-form textarea, .shopx-form select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--shop-line); border-radius: 12px; font: inherit; color: var(--ink); background: var(--paper);
}
.shopx-form input:focus-visible, .shopx-form textarea:focus-visible, .shopx-form select:focus-visible { outline: none; border-color: var(--sea); box-shadow: 0 0 0 4px rgba(42,169,138,0.16); }
.shopx-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shopx-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.shopx-check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.92rem; cursor: pointer; }
.shopx-check input { width: 18px; height: 18px; accent-color: var(--sea); }
.shopx-related { max-height: 160px; overflow-y: auto; border: 1px solid var(--shop-line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.shopx-images { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.shopx-imgchip { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; border: 1px solid var(--shop-line); }
.shopx-imgchip img { width: 100%; height: 100%; object-fit: cover; }
.shopx-imgchip button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border: none; border-radius: 999px; background: rgba(0,0,0,0.6); color: #fff; cursor: pointer; font-size: 0.9rem; line-height: 1; }
.shopx-imgmain { position: absolute; bottom: 0; left: 0; right: 0; background: var(--sea); color: #fff; font-size: 0.62rem; font-weight: 750; text-align: center; padding: 1px; }
.shopx-media-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.shopx-media-actions input { flex: 1 1 200px; min-width: 160px; }
.shopx-upload { cursor: pointer; position: relative; }
.shopx-libpicker { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border: 1px dashed var(--shop-line); border-radius: 12px; margin-bottom: 10px; max-height: 200px; overflow-y: auto; }
.shopx-libitem { width: 70px; height: 70px; border: 1px solid var(--shop-line); border-radius: 10px; overflow: hidden; cursor: pointer; padding: 0; background: var(--mist); }
.shopx-libitem img, .shopx-libitem video { width: 100%; height: 100%; object-fit: cover; }
.shopx-hero-preview { margin-top: 10px; position: relative; display: inline-block; max-width: 280px; border-radius: 12px; overflow: hidden; }
.shopx-hero-preview img, .shopx-hero-preview video { display: block; width: 100%; max-height: 150px; object-fit: cover; border-radius: 12px; background: var(--mist); }
.shopx-hero-preview .shopx-badge { position: absolute; top: 8px; left: 8px; }
.shopx-specs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.shopx-spec-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 8px; }
.shopx-spec-row button { border: 1px solid var(--shop-line); background: var(--paper); border-radius: 10px; cursor: pointer; }
.shopx-preview { background: var(--mist); padding: 18px; border-left: 1px solid var(--shop-line); overflow-y: auto; }
.shopx-preview #e_preview { max-width: 280px; }
.shopx-preview-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* Import */
.shopx-import { max-width: 720px; }
.shopx-import-row { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.shopx-import-row input { flex: 1 1 300px; padding: 12px 14px; border: 1px solid var(--shop-line); border-radius: 12px; font: inherit; }
.shopx-import-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 14px 0; }
.shopx-import-loading .shop-sk { width: 120px; border-radius: 8px; }
.shopx-import-result { border: 1px solid var(--shop-line); border-radius: 16px; padding: 16px; background: var(--paper); }
.shopx-import-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.shopx-import-img { max-width: 160px; border-radius: 12px; margin-bottom: 12px; }
.shopx-import-field { padding: 6px 0; border-bottom: 1px solid var(--shop-line); font-size: 0.92rem; }
.shopx-import-actions { margin-top: 14px; }
.shopx-import-err { color: var(--shop-sale); font-weight: 600; }
/* SHOP:END */
