/* haptic3D — "Candy Workshop" design system.
   Playful storefront: cream paper, chunky ink outlines with offset shadows,
   candy colour tiles, rounded Bricolage Grotesque display type. Every class
   hook from earlier sheets is preserved so product/cart/checkout/legal/admin
   keep rendering. Fonts are self-hosted (no third-party requests). */

@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(../fonts/bricolage-grotesque-latin-wght-normal.woff2) format('woff2-variations'), url(../fonts/bricolage-grotesque-latin-wght-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/inter-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/jetbrains-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/jetbrains-mono-latin-500-normal.woff2) format('woff2'); }

:root {
  --ink: #1c1330;
  --ink-2: #463c5e;
  --muted: #7b7191;
  --line: #ecdfcf;
  --paper: #fff8ee;
  --paper-2: #fcefdd;
  --night: #2b1553;
  --night-2: #3a1f6b;
  --night-line: #4d3383;
  --accent: #ff4f9a;
  --accent-dark: #d62d78;
  --grape: #6b3cff;
  --tile-pink: #ffd3e6;  --pop-pink: #ff4f9a;
  --tile-sun: #fff0a0;   --pop-sun: #ffc928;
  --tile-lime: #ddf7b2;  --pop-lime: #9fe03a;
  --tile-mint: #c8f2e0;  --pop-mint: #38d3a0;
  --tile-sky: #cfe6ff;   --pop-sky: #3aa8ff;
  --tile-lilac: #e4d8ff; --pop-lilac: #8b5cff;
  --radius: 24px;
  --radius-sm: 12px;
  --outline: 2px solid var(--ink);
  --pop: 0 5px 0 var(--ink);
  --pop-lg: 0 9px 0 var(--ink);
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --display: 'Bricolage Grotesque', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --maxw: 1220px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 750; letter-spacing: -0.03em; line-height: 1.02; }
::selection { background: var(--accent); color: #fff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.muted { color: var(--muted); font-size: .92em; }
.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 248, 238, 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: var(--outline);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { font-family: var(--display); font-size: 1.7rem; font-weight: 800; color: var(--ink); letter-spacing: -.04em; white-space: nowrap; display: inline-block; transition: transform .35s var(--bounce); }
.logo:hover { transform: rotate(-4deg) scale(1.05); }
.logo:hover { text-decoration: none; }
.logo-accent { display: inline-block; margin-left: 2px; padding: 0 7px; background: var(--accent); color: #fff; border: var(--outline); border-radius: 10px; transform: rotate(-6deg); box-shadow: 0 3px 0 var(--ink); font-size: .82em; }
.main-nav { display: flex; gap: 6px; align-items: center; }
.main-nav a { color: var(--ink); font-size: .95rem; font-weight: 600; position: relative; white-space: nowrap; padding: 7px 13px; border-radius: 999px; transition: background .2s, transform .25s var(--bounce); }
.main-nav a:hover { text-decoration: none; background: var(--tile-sun); transform: rotate(-3deg); }
.header-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.cart-link { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--ink); font-weight: 700; background: #fff; border: var(--outline); border-radius: 999px; padding: 7px 14px; box-shadow: 0 3px 0 var(--ink); transition: transform .15s, box-shadow .15s; }
.cart-link:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.cart-link:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.cart-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: .74rem; font-weight: 700; font-family: var(--mono);
  animation: badgePop .5s var(--bounce);
}
.cart-badge[hidden] { display: none; }
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }
/* Hamburger — hidden on desktop, shown on mobile (see @media below) */
.menu-toggle { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 36px; height: 40px; padding: 0; background: none; border: 0; cursor: pointer; }
.menu-toggle-bar { display: block; height: 2px; width: 22px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .2s; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile header: collapse nav into a dropdown, keep logo + cart + hamburger */
@media (max-width: 760px) {
  .header-inner { height: 58px; }
  .logo { font-size: 1.25rem; }
  .menu-toggle { display: flex; }
  .cart-link .cart-label { display: none; } /* keep this hook even if unused now */
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: var(--outline);
    box-shadow: 0 14px 30px -18px rgba(22,20,15,.3);
    padding: 6px 28px 14px;
    transform: scaleY(0); transform-origin: top; opacity: 0; pointer-events: none;
    transition: transform .2s ease, opacity .18s ease;
  }
  .main-nav.open { transform: scaleY(1); opacity: 1; pointer-events: auto; }
  .main-nav a { padding: 12px 6px; border-bottom: 1px dashed var(--line); border-radius: 0; font-size: 1.05rem; }
  .main-nav a:hover { transform: none; }
  .cart-link { padding: 6px 11px; }
  .main-nav a:last-child { border-bottom: 0; }
  .main-nav a::after { display: none; }
}

/* Notices */
.notice { background: #fdeef5; border: 1px solid #f6c6dd; color: #8d1d56; border-radius: var(--radius-sm); padding: 12px 16px; margin: 18px 0; font-size: .94rem; }
.notice-info { background: var(--paper-2); border-color: var(--line); color: var(--ink-2); }

/* Shipping bar */
.ship-bar {
  text-align: center; font-family: var(--display); font-size: .9rem; font-weight: 650; letter-spacing: .01em;
  color: var(--ink); padding: 8px 16px; background: var(--pop-sun);
}

/* Catalog */
.page-title { margin: 40px 0 8px; font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
.page-sub { margin: 0 0 36px; color: var(--muted); font-size: 1.05rem; max-width: 56ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 34px 26px; margin-bottom: 64px; }
.card { display: block; color: var(--ink); position: relative; }
.card:hover { text-decoration: none; }
.card-img {
  aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--paper-2);
  width: 100%; transition: transform .45s var(--bounce);
}
/* Colour tile: the card image sits on a candy tile with an ink outline */
.card-tile {
  display: block; position: relative; aspect-ratio: 1; border-radius: var(--radius);
  background: var(--tile, var(--paper-2)); border: var(--outline); box-shadow: var(--pop);
  overflow: hidden; transition: transform .35s var(--bounce), box-shadow .25s;
}
.card-tile .card-img { width: 100%; height: 100%; border-radius: 0; background: transparent; }
.card-tile--cut .card-img { object-fit: contain; padding: 13%; filter: drop-shadow(0 14px 12px rgba(28,19,48,.22)); }
.card-tile--cut::before {
  content: ''; position: absolute; inset: 18% 18% 12%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,.75), rgba(255,255,255,0));
}
.card:hover .card-tile { transform: rotate(-2deg) translateY(-4px); box-shadow: var(--pop-lg); }
.card:hover .card-tile--cut .card-img { transform: rotate(8deg) scale(1.08); }
.card:nth-child(even):hover .card-tile { transform: rotate(2deg) translateY(-4px); }
.card:nth-child(even):hover .card-tile--cut .card-img { transform: rotate(-8deg) scale(1.08); }
.card--pink  { --tile: var(--tile-pink);  --pop-c: var(--pop-pink); }
.card--sun   { --tile: var(--tile-sun);   --pop-c: var(--pop-sun); }
.card--lime  { --tile: var(--tile-lime);  --pop-c: var(--pop-lime); }
.card--mint  { --tile: var(--tile-mint);  --pop-c: var(--pop-mint); }
.card--sky   { --tile: var(--tile-sky);   --pop-c: var(--pop-sky); }
.card--lilac { --tile: var(--tile-lilac); --pop-c: var(--pop-lilac); }
.sticker {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  font-family: var(--display); font-weight: 750; font-size: .8rem; letter-spacing: .01em;
  background: #fff; color: var(--ink); border: var(--outline); border-radius: 999px;
  padding: 3px 11px; transform: rotate(-5deg); box-shadow: 0 2px 0 var(--ink);
}
.badge-3d {
  position: absolute; bottom: 12px; right: 12px; z-index: 1;
  font-family: var(--display); font-weight: 800; font-size: .78rem;
  background: var(--ink); color: #fff; border-radius: 10px; padding: 3px 8px; transform: rotate(4deg);
}
.card-title { display: block; margin: 16px 0 3px; font-family: var(--display); font-weight: 700; font-size: 1.18rem; letter-spacing: -.02em; line-height: 1.2; }
.card-price { color: var(--ink); font-size: 1rem; font-family: var(--display); font-weight: 650; }
.card-soldout { color: var(--accent-dark); font-size: .9rem; font-weight: 700; font-family: var(--display); }

/* Product */
.product { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; margin: 48px 0 72px; }
@media (max-width: 820px) { .product { grid-template-columns: 1fr; gap: 28px; } }
.gallery-main {
  border-radius: var(--radius); background: var(--paper-2); aspect-ratio: 1; object-fit: cover;
  width: 100%; cursor: zoom-in; border: var(--outline); box-shadow: var(--pop-lg);
}
.thumbs { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.thumbs img { width: 68px; height: 68px; object-fit: cover; border-radius: 14px; cursor: pointer; border: 2px solid var(--line); transition: border-color .2s, transform .25s var(--bounce); }
.thumbs img:hover { transform: translateY(-3px) rotate(-4deg); }
.thumbs img.active { border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.product-title { margin: 0 0 10px; font-size: clamp(2rem, 4vw, 2.9rem); }
.price { display: inline-block; font-size: 1.6rem; font-weight: 800; margin: 10px 0 8px; font-family: var(--display); background: var(--pop-sun); border: var(--outline); border-radius: 14px; padding: 2px 14px; transform: rotate(-2deg); box-shadow: 0 3px 0 var(--ink); }
.price-note { font-size: .84rem; color: var(--muted); margin-bottom: 22px; line-height: 1.5; }
.price-note a { color: var(--muted); text-decoration: underline; }
.opt-row { margin: 16px 0; }
.opt-row label { display: block; font-weight: 700; font-size: 1rem; margin-bottom: 6px; font-family: var(--display); }
select, input[type=text], input[type=email], input[type=number], textarea {
  width: 100%; padding: 12px 14px; border: var(--outline); border-radius: var(--radius-sm);
  font: inherit; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(255,79,154,.3); }
.qty-row { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.qty-row input { width: 90px; }
.qty-row label { font-family: var(--display); font-size: 1rem; font-weight: 700; color: var(--ink); }
.btn {
  display: inline-block; border: var(--outline); cursor: pointer; font-family: var(--display); font-weight: 750; font-size: 1.05rem;
  background: var(--accent); color: #fff; padding: 13px 28px; border-radius: 999px; box-shadow: var(--pop);
  transition: background .18s, transform .15s, box-shadow .15s; letter-spacing: -.005em; text-align: center;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn[disabled] { background: #d9d2e4; color: var(--muted); cursor: not-allowed; transform: none; box-shadow: 0 2px 0 var(--muted); border-color: var(--muted); }
.btn-accent { background: var(--grape); }
.btn-accent:hover { background: #5427e0; }
.btn-secondary { background: #fff; color: var(--ink); }
.btn-secondary:hover { background: var(--tile-sun); }
.btn-block { display: block; width: 100%; text-align: center; }
.desc { margin-top: 40px; color: var(--ink-2); line-height: 1.7; max-width: 60ch; }
.desc h2 { font-size: 1.2rem; margin-top: 1.8em; }
.desc p { margin: 1em 0; }
.desc strong { color: var(--ink); font-weight: 700; background: linear-gradient(transparent 60%, var(--tile-pink) 60%); }

/* Cart & checkout tables */
.cart-table { width: 100%; border-collapse: collapse; margin: 28px 0; }
.cart-table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); font-family: var(--mono); }
.cart-table td { padding: 18px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 14px; border: var(--outline); }
.cart-item-title { font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.cart-item-variant { color: var(--muted); font-size: .86rem; }
.cart-qty-form { display: flex; gap: 8px; align-items: center; }
.cart-qty-form input { width: 64px; padding: 8px 10px; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: .82rem; text-decoration: underline; padding: 0; }
.linkbtn:hover { color: var(--accent-dark); }
.totals { max-width: 400px; margin-left: auto; }
.totals-row { display: flex; justify-content: space-between; padding: 8px 0; color: var(--ink-2); }
.totals-row.grand { border-top: var(--outline); margin-top: 8px; padding-top: 16px; font-weight: 800; font-size: 1.3rem; font-family: var(--display); color: var(--ink); }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 32px 0 72px; flex-wrap: wrap; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; margin: 24px 0; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-field label { display: block; font-weight: 700; font-size: .98rem; margin-bottom: 6px; font-family: var(--display); }
.form-field.full { grid-column: 1 / -1; }
.field-error { color: #b00020; font-size: .84rem; margin-top: 4px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0; }
.check-row input { margin-top: 5px; width: auto; }

/* Review / legal / boxes */
.box { border: var(--outline); border-radius: var(--radius); padding: 22px 24px; margin: 22px 0; background: #fff; box-shadow: var(--pop); }
.box h2 { margin: 0 0 12px; font-size: 1.1rem; }
.legal-body { max-width: 780px; margin: 48px auto 80px; line-height: 1.75; color: var(--ink-2); }
.legal-body h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); color: var(--ink); margin-bottom: .4em; }
.legal-body h2 { font-size: 1.2rem; margin-top: 1.8em; color: var(--ink); }
.legal-body p, .legal-body li { margin: .8em 0; }

/* Footer */
.site-footer { border-top: var(--outline); background: var(--night); color: #eee6ff; margin-top: 64px; }
.site-footer .muted { color: #b9aed6; }
.site-footer a { color: #fff; }
.footer-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; padding: 52px 28px 40px; font-size: .92rem; }
.footer-col strong { font-family: var(--display); font-size: 1.6rem; font-weight: 800; }
.footer-col a { display: block; color: #eee6ff; margin-bottom: 8px; }
.footer-col a:hover { color: var(--pop-sun); }
.footer-bottom { border-top: 1px solid var(--night-line); padding: 18px 28px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .9rem; color: #b9aed6; font-family: var(--display); font-weight: 600; }

/* Status pages */
.status-page { max-width: 560px; margin: 80px auto; text-align: center; }
.status-page h1 { font-size: clamp(2rem, 5vw, 2.8rem); }

/* Lightbox (product image zoom) */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(28,19,48,.92); display: flex; align-items: center; justify-content: center; padding: 32px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: min(92vw, 1000px); max-height: 88vh; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; cursor: pointer; font-size: 2rem; padding: 12px; opacity: .8; }
.lightbox button:hover { opacity: 1; }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
/* ---- Slide-in cart drawer (Phase 4) ---- */
.drawer-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(28,19,48,.5); opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; z-index: 91; width: min(420px, 92vw); height: 100vh; background: var(--paper); border-left: var(--outline); box-shadow: -20px 0 60px -30px rgba(28,19,48,.4); transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.7,.2,1); display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
body.drawer-open, body.modal-open { overflow: hidden; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: var(--outline); background: var(--tile-sun); }
.drawer-title { font-family: var(--display); font-size: 1.5rem; font-weight: 800; }
.drawer-close { background: none; border: 0; font-size: 1.7rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.drawer-close:hover { color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 22px 22px; }
.drawer-loading, .drawer-empty { color: var(--muted); padding: 24px 0; text-align: center; }
.drawer-notice { background: #fdeef5; border: 1px solid #f6c6dd; color: #8d1d56; border-radius: 8px; padding: 10px 12px; font-size: .86rem; margin-bottom: 14px; }
.drawer-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.drawer-item-img img { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; border: var(--outline); }
.drawer-item-main { min-width: 0; }
.drawer-item-title { font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--ink); display: block; }
.drawer-item-title:hover { color: var(--accent-dark); }
.drawer-item-variant { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.drawer-item-row { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.drawer-qty { display: inline-flex; align-items: center; gap: 0; border: var(--outline); border-radius: 999px; overflow: hidden; }
.drawer-qty button { width: 28px; height: 26px; border: 0; background: var(--paper-2); cursor: pointer; font-family: var(--mono); color: var(--ink); }
.drawer-qty button:hover { background: var(--paper); color: var(--accent-dark); }
.drawer-qty-val { min-width: 30px; text-align: center; font-family: var(--mono); font-size: .88rem; }
.drawer-remove { font-size: .76rem; }
.drawer-item-line { font-family: var(--mono); font-size: .9rem; color: var(--ink); text-align: right; }
.drawer-totals { margin: 18px 0 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.drawer-totals .totals-row { font-size: .92rem; }
.drawer-fullpage { display: block; text-align: center; margin-top: 12px; font-family: var(--mono); font-size: .76rem; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }

/* ---- Quick-view modal (Phase 4) ---- */
.modal-overlay { position: fixed; inset: 0; z-index: 95; background: rgba(28,19,48,.6); opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal { position: fixed; top: 50%; left: 50%; z-index: 96; transform: translate(-50%, -48%) scale(.98); background: var(--paper); border-radius: var(--radius); border: var(--outline); width: min(880px, 94vw); max-height: 88vh; overflow: auto; box-shadow: var(--pop-lg), 0 30px 80px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-close { position: absolute; top: 14px; right: 16px; z-index: 2; background: #fff; border: var(--outline); width: 36px; height: 36px; border-radius: 999px; cursor: pointer; font-size: 1.4rem; color: var(--ink); }
.modal-close:hover { background: var(--paper-2); }
.qv { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 28px; }
@media (max-width: 640px) { .qv { grid-template-columns: 1fr; padding: 20px; } }
.qv-gallery .gallery-main { border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; width: 100%; background: var(--paper-2); cursor: default; }
.qv-info { display: flex; flex-direction: column; }
.qv-title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 8px; }
.qv-desc { color: var(--muted); font-size: .9rem; margin-top: 16px; line-height: 1.6; }
.qv-full { margin-top: 14px; font-family: var(--display); font-size: 1rem; font-weight: 700; color: var(--accent-dark); }

/* ---- Catalog filter bar + restructured cards (Phase 4) ---- */
.filterbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 32px; padding: 14px 18px; background: #fff; border: var(--outline); border-radius: var(--radius); box-shadow: var(--pop); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: var(--outline); background: #fff; color: var(--ink); padding: 6px 15px; border-radius: 999px; cursor: pointer; font-family: var(--display); font-size: .95rem; font-weight: 650; transition: background .15s, color .15s, transform .25s var(--bounce); }
.chip:hover { background: var(--tile-sun); transform: rotate(-3deg); }
.chip.active { background: var(--ink); color: #fff; }
.filter-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.filter-search { width: 200px; padding: 8px 14px; border: var(--outline); border-radius: 999px; font-size: .9rem; background: var(--paper); }
.filter-search:focus { outline: none; box-shadow: 0 0 0 4px rgba(255,79,154,.3); }
.filter-stock { font-size: .9rem; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.filter-stock input { width: auto; margin: 0; }
.filter-empty { text-align: center; color: var(--muted); padding: 40px 0; font-family: var(--display); font-size: 1.2rem; font-weight: 650; }

.card-link { display: block; color: var(--ink); }
.card-link:hover { text-decoration: none; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.card-quick { background: #fff; border: var(--outline); color: var(--ink); padding: 5px 12px; border-radius: 999px; cursor: pointer; font-family: var(--display); font-size: .84rem; font-weight: 650; transition: background .15s, color .15s, transform .25s var(--bounce); }
.card-quick:hover { background: var(--ink); color: #fff; }
.card:hover .card-quick { background: var(--pop-c, var(--tile-sun)); transform: rotate(-3deg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.sticker--inline { position: static; display: inline-block; margin-bottom: 12px; }
.sticker--dreht   { background: var(--tile-mint); }
.sticker--wackelt { background: var(--tile-lime); }
.sticker--klappt  { background: var(--tile-sun); }
.sticker--rollt   { background: var(--tile-pink); }
.sticker--leuchtet { background: var(--tile-sky); }
.card-tile .sticker { background-color: #fff; }
a.card { color: var(--ink); }
a.card:hover { text-decoration: none; }
a.card .card-price { display: block; }

/* ==== Product page: 3D preview ==== */
.view-toggle { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.view-toggle .chip.active { background: var(--ink); color: #fff; }
.model-stage {
  position: relative; aspect-ratio: 1; border: var(--outline); border-radius: var(--radius); box-shadow: var(--pop-lg);
  background: radial-gradient(circle at 50% 40%, #fff, var(--tile, var(--tile-lilac)) 70%); overflow: hidden;
}
.model-stage[hidden] { display: none; }
.model-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.model-stage canvas:active { cursor: grabbing; }
.model-note { position: absolute; left: 12px; right: 12px; bottom: 10px; font-size: .78rem; color: var(--ink-2); text-align: center; background: rgba(255,255,255,.82); border-radius: 10px; padding: 5px 10px; }
.model-loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 750; font-size: 1.2rem; }

/* ==== Language switch ==== */
.lang-switch { display: inline-flex; border: var(--outline); border-radius: 999px; overflow: hidden; background: #fff; box-shadow: 0 3px 0 var(--ink); }
.lang-switch a { font-family: var(--display); font-weight: 750; font-size: .85rem; color: var(--ink); padding: 6px 10px; line-height: 1; }
.lang-switch a:hover { text-decoration: none; background: var(--tile-sun); }
.lang-switch a.active { background: var(--ink); color: #fff; }
.notice-lang { background: var(--tile-sky); border: var(--outline); color: var(--ink); font-weight: 600; }
@media (max-width: 760px) {
  .header-right { gap: 10px; }
  .lang-switch a { padding: 6px 8px; font-size: .8rem; }
  .cart-link .cart-label { display: none; }
  .cart-link::before { content: ''; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--bag-icon) center / contain no-repeat; mask: var(--bag-icon) center / contain no-repeat; }
}
:root { --bag-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 7h12l1 14H5L6 7z'/%3E%3Cpath d='M9 7a3 3 0 0 1 6 0'/%3E%3C/svg%3E"); }

/* ==== Discount code box (review page) ==== */
.code-box { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.code-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.code-form label { font-family: var(--display); font-weight: 700; width: 100%; }
.code-form input[type=text] { flex: 1 1 200px; max-width: 280px; text-transform: uppercase; }
.code-form .btn { padding: 10px 20px; font-size: .95rem; }
.code-form .sticker--inline { margin: 0; background: var(--tile-lime); }

/* ==== Reviews ==== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stars { --size: 1.35rem; --pct: calc(var(--rating) / 5 * 100%); display: inline-block; font-size: var(--size); line-height: 1; letter-spacing: 2px; font-family: Arial, sans-serif; }
.stars::before { content: '★★★★★'; background: linear-gradient(90deg, var(--pop-sun) var(--pct), #d9d2e4 var(--pct)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 1px var(--ink); }
.stars--sm { --size: 1.05rem; }
.stars--xs { --size: .85rem; letter-spacing: 1px; }
.card-rating { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--ink-2); margin-top: 2px; }
.product-rating { display: inline-flex; align-items: center; gap: 8px; margin: -2px 0 8px; color: var(--ink-2); font-weight: 600; }
.product-rating:hover { text-decoration: none; color: var(--ink); }

.reviews { margin: 0 0 72px; padding-top: 40px; border-top: 2px dashed var(--line); }
.reviews-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.reviews-head h2 { margin: 0; font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
.reviews-empty { font-family: var(--display); font-size: 1.15rem; font-weight: 600; color: var(--ink-2); background: var(--tile-sun); border: var(--outline); border-radius: var(--radius); padding: 18px 22px; }
.reviews-summary { display: grid; grid-template-columns: auto minmax(0, 320px); gap: 28px 48px; align-items: center; margin-bottom: 28px; }
@media (max-width: 640px) { .reviews-summary { grid-template-columns: 1fr; } }
.reviews-avg { display: flex; flex-direction: column; gap: 6px; }
.reviews-avg-num { font-family: var(--display); font-weight: 800; font-size: 3.2rem; line-height: 1; }
.reviews-dist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.reviews-dist li { display: grid; grid-template-columns: 38px 1fr 28px; gap: 10px; align-items: center; }
.reviews-dist .bar { height: 10px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); overflow: hidden; }
.reviews-dist .bar span { display: block; height: 100%; background: var(--pop-sun); }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.review { background: #fff; border: var(--outline); border-radius: var(--radius); padding: 18px 22px; box-shadow: 0 3px 0 var(--ink); }
.review-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.review-title { font-family: var(--display); font-size: 1.1rem; }
.review-body { margin: 10px 0; color: var(--ink-2); }
.review-meta { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.review-badge { background: var(--tile-lime); color: var(--ink); border-radius: 999px; padding: 1px 9px; font-weight: 700; }
.review-source { background: var(--paper-2); border-radius: 999px; padding: 1px 9px; }
.review-reply { margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--paper); border-radius: 0 12px 12px 0; }
.review-reply p { margin: 4px 0 0; }
.reviews-policy { margin-top: 22px; font-size: .9rem; color: var(--ink-2); }
.reviews-policy summary { cursor: pointer; font-weight: 700; }

/* review form */
.rate .box { max-width: 760px; }
.rate-form--focus { box-shadow: 0 0 0 4px rgba(255, 79, 154, .35), var(--pop); }
.rate-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.rate-head img { width: 72px; height: 72px; object-fit: contain; border-radius: 14px; background: var(--tile-lilac); border: var(--outline); }
.rate-head h2 { margin: 0; font-size: 1.4rem; }
.star-input { border: 0; padding: 0; margin: 8px 0 12px; }
.star-input legend { font-family: var(--display); font-weight: 700; margin-bottom: 4px; padding: 0; }
.star-row { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 2.2rem; line-height: 1; cursor: pointer; color: #d9d2e4; -webkit-text-stroke: 1px var(--ink); transition: transform .15s var(--bounce); }
.star-input label:hover, .star-input label:hover ~ label,
.star-input input:checked ~ label { color: var(--pop-sun); }
.star-input label:hover { transform: scale(1.15) rotate(-8deg); }
.star-input input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.rate-policy { max-width: 760px; margin-top: 24px; }
.rate-forget { margin-top: 12px; }
