/* Eli's Shop — shared styles for storefront, admin and success page */

:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #f9f8f5;
  --ink: #111111;
  --ink-2: #3a3a38;
  --muted: #74736e;
  --line: #e5e3dc;
  --line-2: #d6d3ca;
  --accent: #ff4d1c;
  --accent-ink: #ffffff;
  --accent-soft: #ffe9e1;
  --ok: #1d9a5b;
  --ok-soft: #dff5e9;
  --warn: #c98600;
  --warn-soft: #fff3d6;
  --danger: #d4372a;
  --danger-soft: #fde5e2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 10px 30px -14px rgba(17, 17, 17, .18);
  --shadow-lg: 0 24px 60px -20px rgba(17, 17, 17, .35);
  --warn-ink: #8a5c00;
  --on-ink: #ffffff;            /* text that sits on an --ink background */
  --on-ink-line: rgba(255, 255, 255, .3);
  --glass: rgba(244, 243, 239, .85);
  --arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --header-h: 68px;
  color-scheme: light;
}

/* Dark mode: follows the device setting unless the user picked one with the toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #131313;
  --surface: #1c1c1b;
  --surface-2: #232322;
  --ink: #f3f2ed;
  --ink-2: #d3d1ca;
  --muted: #8e8d87;
  --line: #2b2b2a;
  --line-2: #3b3b39;
  --accent: #ff5a2c;
  --accent-soft: #3d2016;
  --ok: #3ccf7f;
  --ok-soft: #14301f;
  --warn: #f0b429;
  --warn-soft: #3a2c0a;
  --warn-ink: #f2c14e;
  --danger: #ff6b5e;
  --danger-soft: #3d1a17;
  --on-ink: #111111;
  --on-ink-line: rgba(17, 17, 17, .25);
  --glass: rgba(19, 19, 19, .82);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
  --arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f3f2ed' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131313;
  --surface: #1c1c1b;
  --surface-2: #232322;
  --ink: #f3f2ed;
  --ink-2: #d3d1ca;
  --muted: #8e8d87;
  --line: #2b2b2a;
  --line-2: #3b3b39;
  --accent: #ff5a2c;
  --accent-soft: #3d2016;
  --ok: #3ccf7f;
  --ok-soft: #14301f;
  --warn: #f0b429;
  --warn-soft: #3a2c0a;
  --warn-ink: #f2c14e;
  --danger: #ff6b5e;
  --danger-soft: #3d1a17;
  --on-ink: #111111;
  --on-ink-line: rgba(17, 17, 17, .25);
  --glass: rgba(19, 19, 19, .82);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
  --arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f3f2ed' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; margin: 0; line-height: 1.1; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: min(1240px, 100% - 40px); margin-inline: auto; }
@media (max-width: 640px) { .container { width: min(1240px, 100% - 28px); } }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid transparent;
  background: var(--ink); color: var(--on-ink); font-weight: 600; font-size: 14px;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn:disabled:hover { background: var(--ink); color: var(--on-ink); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #e8400f; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); color: var(--ink); transform: none; }
.btn-ghost:disabled:hover { background: transparent; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 26px; font-size: 15px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); transition: border-color .15s, background .15s, color .15s;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.icon-btn svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,17,17,.08); }
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: var(--arrow); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input-money { position: relative; }
.input-money::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.input-money .input { padding-left: 28px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); border: none; padding: 0; transition: background .15s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.3; background: var(--surface); border: 1px solid var(--line); }
.badge-ink { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.badge-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-muted { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); overflow: hidden; }
.stepper button { width: 36px; height: 36px; border: none; background: transparent; font-size: 18px; font-weight: 500; transition: background .12s; }
.stepper button:hover:not(:disabled) { background: var(--surface-2); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output, .stepper input { width: 40px; text-align: center; font-weight: 600; font-size: 14px; border: none; background: transparent; padding: 0; }
.stepper input { outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.price { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
.price-was { color: var(--muted); text-decoration: line-through; font-weight: 500; font-size: .88em; margin-left: 6px; }
.price-sale { color: var(--accent); }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(420px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toast-in .25s ease; pointer-events: auto; text-align: center; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- storefront: header ---------- */
.announce { background: var(--ink); color: var(--on-ink); text-align: center; font-size: 13px; font-weight: 500; padding: 8px 16px; letter-spacing: .01em; }
.header { position: sticky; top: 0; z-index: 50; background: var(--glass); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 20px; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.03em; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.logo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
.search { flex: 1; max-width: 460px; margin-left: auto; position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search .input { padding-left: 40px; border-radius: 999px; background: var(--surface); }
.cart-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 14px; transition: border-color .15s; }
.cart-btn:hover { border-color: var(--ink); }
.cart-btn svg { width: 18px; height: 18px; }
.cart-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cart-count.is-zero { background: var(--line-2); color: var(--ink-2); }
@media (max-width: 720px) {
  .header-inner { gap: 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin: 0 0 10px; }
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 12px; }
  .cart-btn span.label { display: none; }
}

/* ---------- storefront: hero ---------- */
.hero { padding: 56px 0 28px; }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: end; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: .98; letter-spacing: -0.04em; max-width: 14ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 17px; color: var(--muted); max-width: 46ch; margin: 18px 0 24px; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; min-width: 120px; }
.stat b { display: block; font-family: var(--font-display); font-size: 26px; letter-spacing: -0.03em; line-height: 1; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 500; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-stats { justify-content: flex-start; } .hero { padding-top: 36px; } }

/* ---------- storefront: toolbar + grid ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 0 20px; position: sticky; top: var(--header-h); z-index: 40; background: linear-gradient(var(--bg) 80%, transparent); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 600; white-space: nowrap; transition: all .12s; }
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.toolbar .select { width: auto; padding: 9px 36px 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
@media (max-width: 720px) { .toolbar { position: static; } }
.results-line { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 18px; padding-bottom: 72px; }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 16px 10px; } }

.product { background: transparent; border: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 10px; cursor: pointer; color: inherit; }
.product-media { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.product:hover .product-media img { transform: scale(1.04); }
.product-media .placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--line-2); }
.product-media .placeholder svg { width: 40px; height: 40px; }
.product-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.product.sold .product-media img { filter: grayscale(1) brightness(.85); opacity: .7; }
.sold-stamp { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: .08em; color: #fff; text-transform: uppercase; }
.sold-stamp span { background: rgba(17,17,17,.85); padding: 8px 18px; border-radius: 999px; }
.product-body { display: flex; flex-direction: column; gap: 3px; padding: 0 2px; }
.product-name { font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-meta { font-size: 12.5px; color: var(--muted); }
.product-price { font-size: 16px; margin-top: 2px; }

.empty { text-align: center; padding: 80px 20px; color: var(--muted); grid-column: 1 / -1; }
.empty h3 { font-size: 22px; margin-bottom: 8px; color: var(--ink); }

/* ---------- storefront: footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 13.5px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.footer .logo { font-size: 18px; color: var(--ink); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; font-weight: 500; color: var(--ink-2); }
.footer-links a:hover { color: var(--accent); }
.footer-policy { flex-basis: 100%; }

/* ---------- overlays: modal & drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(17,17,17,.45); z-index: 100; opacity: 0; transition: opacity .2s; backdrop-filter: blur(2px); }
.overlay.open { opacity: 1; }

.modal { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 20px; pointer-events: none; }
.modal-box { position: relative; width: min(980px, 100%); max-height: min(92vh, 900px); background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; display: grid; grid-template-columns: 1.1fr 1fr; pointer-events: auto; transform: translateY(12px) scale(.98); opacity: 0; transition: transform .22s cubic-bezier(.2,.7,.2,1), opacity .18s; }
.modal.open .modal-box { transform: none; opacity: 1; }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--surface); }
.gallery { background: var(--surface-2); display: flex; flex-direction: column; min-height: 0; }
.gallery-main { flex: 1; min-height: 320px; position: relative; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.gallery-thumbs { display: flex; gap: 8px; padding: 12px; overflow-x: auto; background: var(--surface); border-top: 1px solid var(--line); }
.gallery-thumbs button { width: 60px; height: 60px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--surface-2); flex-shrink: 0; }
.gallery-thumbs button.active { border-color: var(--ink); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.modal-info { padding: 36px 34px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; position: relative; }
.modal-info h2 { font-size: 28px; line-height: 1.08; padding-right: 32px; }
.modal-info .product-price { font-size: 24px; }
.modal-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.modal-desc { color: var(--ink-2); white-space: pre-wrap; font-size: 14.5px; }
.modal-actions { margin-top: auto; display: flex; gap: 12px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.modal-actions .btn { flex: 1; }
.stock-line { font-size: 13px; font-weight: 600; }
.stock-line.low { color: var(--accent); }
.stock-line.out { color: var(--muted); }
@media (max-width: 800px) {
  .modal { padding: 0; align-items: end; }
  .modal-box { grid-template-columns: 1fr; max-height: 94vh; border-radius: 22px 22px 0 0; overflow-y: auto; }
  .gallery-main { min-height: 0; aspect-ratio: 1; flex: none; }
  .modal-info { padding: 22px 20px 28px; overflow: visible; }
}

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface); z-index: 110; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.7,.2,1); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 22px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 22px; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-item img, .cart-item .thumb { width: 72px; height: 84px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.cart-item .name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.cart-item .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cart-item .controls { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.cart-item .remove { background: none; border: none; color: var(--muted); font-size: 12.5px; padding: 0; text-decoration: underline; }
.cart-item .remove:hover { color: var(--danger); }
.cart-item .line-price { font-weight: 700; font-family: var(--font-display); text-align: right; }
.drawer-foot { padding: 18px 22px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }
.totals { display: flex; flex-direction: column; gap: 6px; font-size: 14px; margin-bottom: 14px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-weight: 700; font-size: 17px; font-family: var(--font-display); padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.drawer-empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.secure-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.secure-note svg { width: 13px; height: 13px; }

/* ---------- success page ---------- */
.success-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.success-card { width: min(520px, 100%); padding: 40px 36px; text-align: center; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 18px; }
.success-icon svg { width: 30px; height: 30px; }
.success-card h1 { font-size: 30px; margin-bottom: 8px; }
.success-card p { color: var(--muted); }
.order-lines { text-align: left; margin: 22px 0; border-top: 1px solid var(--line); }
.order-lines div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.order-lines .total { font-weight: 700; font-family: var(--font-display); font-size: 16px; }

/* ---------- admin ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); padding: 36px 32px; display: flex; flex-direction: column; gap: 18px; }
.login-card h1 { font-size: 26px; }
.login-card p { margin: 0; color: var(--muted); font-size: 14px; }

.admin-header { position: sticky; top: 0; z-index: 50; background: var(--glass); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.admin-header-inner { height: 64px; display: flex; align-items: center; gap: 22px; }
.admin-nav { display: flex; gap: 4px; margin-left: 8px; }
.admin-nav button { padding: 8px 14px; border-radius: 999px; border: none; background: transparent; font-weight: 600; font-size: 14px; color: var(--muted); transition: all .12s; }
.admin-nav button:hover { color: var(--ink); }
.admin-nav button.active { background: var(--ink); color: var(--on-ink); }
.admin-header .spacer { flex: 1; }
.admin-header .link { text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.admin-header .link:hover { color: var(--accent); }
@media (max-width: 640px) {
  .admin-header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 10px; }
  .admin-nav { order: 3; flex-basis: 100%; margin: 0; }
}
.admin-main { padding: 28px 0 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; }
.page-head .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-head .search { margin: 0; max-width: 300px; flex: initial; width: 260px; }

.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 64px 1fr 110px 150px 70px auto; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row.hidden-row { opacity: .55; }
.row .thumb { width: 64px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--line-2); }
.row .thumb svg { width: 22px; height: 22px; }
.row .name { font-weight: 600; font-size: 15px; }
.row .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row .stock-cell { display: flex; align-items: center; gap: 8px; }
.row .stock-cell .stepper output { width: 44px; }
.row .row-actions { display: flex; gap: 6px; }
.rows-head { display: grid; grid-template-columns: 64px 1fr 110px 150px 70px auto; gap: 16px; padding: 10px 18px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
@media (max-width: 820px) {
  .rows-head { display: none; }
  .row { grid-template-columns: 56px 1fr; grid-template-areas: "thumb info" "stock stock" "actions actions"; gap: 10px 14px; }
  .row .thumb { grid-area: thumb; width: 56px; height: 64px; }
  .row .info { grid-area: info; }
  .row .price-cell { display: none; }
  .row .stock-cell { grid-area: stock; }
  .row .vis-cell { display: none; }
  .row .row-actions { grid-area: actions; justify-content: flex-end; }
  .row .row-actions .vis-inline { display: inline-flex; margin-right: auto; }
}
.vis-inline { display: none; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

/* slide-over editor */
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100%); background: var(--surface); z-index: 110; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.7,.2,1); display: flex; flex-direction: column; }
.panel.open { transform: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 22px; }
.panel-body { flex: 1; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.panel-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }

.dropzone { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); font-size: 13.5px; transition: all .15s; cursor: pointer; background: var(--surface-2); }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.dropzone strong { color: var(--ink); }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.image-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.image-tile img { width: 100%; height: 100%; object-fit: cover; }
.image-tile .x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(17,17,17,.8); color: #fff; display: grid; place-items: center; font-size: 14px; line-height: 1; }
.image-tile .x:hover { background: var(--danger); }
.image-tile .cover { position: absolute; bottom: 6px; left: 6px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.92); color: #111; }
.image-tile.uploading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.6); }
.image-tile .spin { position: absolute; inset: 0; display: grid; place-items: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

/* orders */
.order { padding: 18px 20px; display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; margin-bottom: 12px; }
.order .who { font-weight: 600; font-size: 15px; }
.order .when { font-size: 12.5px; color: var(--muted); }
.order .items { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.order .items div { padding: 3px 0; }
.order .addr { font-size: 13px; color: var(--muted); white-space: pre-line; margin-top: 8px; }
.order .side { text-align: right; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.order .amount { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
@media (max-width: 560px) { .order { grid-template-columns: 1fr; } .order .side { align-items: flex-start; text-align: left; } }

.settings-form { max-width: 620px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.settings-form h3 { font-size: 16px; margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- storefront: drops, featured, offers, codes ---------- */
.drop-banner { margin-top: 6px; }
.drop-banner-inner { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: var(--radius); background: var(--ink); color: var(--on-ink); flex-wrap: wrap; }
.drop-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(255,77,28,.6); animation: pulse 1.6s infinite; flex-shrink: 0; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,77,28,.6); } 70% { box-shadow: 0 0 0 10px rgba(255,77,28,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,28,0); } }
.drop-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.drop-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .6; font-weight: 600; }
.drop-text strong { font-family: var(--font-display); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-clock { margin-left: auto; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--accent); }
.drop-banner .btn-ghost { color: var(--on-ink); border-color: var(--on-ink-line); }
.drop-banner .btn-ghost:hover { background: var(--on-ink); color: var(--ink); border-color: var(--on-ink); }
@media (max-width: 560px) { .drop-clock { margin-left: 0; flex-basis: 100%; } }

.section-head { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 14px; }
.section-head h2 { font-size: 24px; }
.featured-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.product.feat .product-media { aspect-ratio: 5 / 4; }
.product.feat .product-name { font-size: 17px; }
.product.feat .product-price { font-size: 18px; }
@media (max-width: 860px) {
  .featured-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; padding-bottom: 6px; scrollbar-width: none; margin-inline: -14px; padding-inline: 14px; }
  .featured-row::-webkit-scrollbar { display: none; }
  .product.feat { flex: 0 0 78%; scroll-snap-align: start; }
}
.product.upcoming .product-media img { opacity: .85; }
.stock-line.drop { color: var(--ink); }
.stock-line.drop span { color: var(--accent); font-variant-numeric: tabular-nums; }

.offer-toggle { align-self: flex-start; background: none; border: none; padding: 0; font-weight: 600; font-size: 13.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; margin-top: -4px; }
.offer-toggle:hover { color: var(--accent); }
.offer-form { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.offer-head { display: flex; flex-direction: column; gap: 2px; }
.offer-actions { display: flex; justify-content: flex-end; gap: 8px; }

.code-box { display: flex; gap: 8px; margin-bottom: 12px; }
.code-box .input { flex: 1; padding: 9px 14px; text-transform: uppercase; }
.code-box .input::placeholder { text-transform: none; }
.code-applied { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); margin-bottom: 12px; }
.code-applied .remove { background: none; border: none; color: var(--ok); font-size: 12.5px; text-decoration: underline; padding: 0; }
.totals #discountRow { color: var(--ok); font-weight: 600; }

/* ---------- admin: dashboard ---------- */
.admin-nav { overflow-x: auto; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav button { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.admin-nav .badge { padding: 1px 7px; font-size: 11px; }
.setup { padding: 14px 18px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; background: var(--warn-soft); border-color: transparent; font-size: 13.5px; }
.setup strong { margin-right: 4px; }
.setup .step { display: inline-flex; align-items: center; gap: 6px; }
.setup .step.ok { color: var(--ok); }
.setup .step.todo { color: var(--warn-ink); }
.range { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; }
.range button { border: none; background: transparent; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.range button.active { background: var(--ink); color: var(--on-ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { padding: 16px 18px; }
.tile .label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tile .value { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.tile.accent .value { color: var(--accent); }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.panel-card { padding: 18px 20px; }
.panel-card h3 { font-size: 15px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; }
.panel-card h3 span { font-size: 12.5px; color: var(--muted); font-weight: 500; font-family: var(--font-body); }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.chart .bar { fill: var(--accent); transition: opacity .12s; }
.chart .bar.dim { opacity: .35; }
.chart .bar-hit { fill: transparent; cursor: pointer; }
.chart .val-label { fill: var(--ink); font-size: 11px; font-weight: 600; font-family: var(--font-body); }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--on-ink); font-size: 12px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .1s; }
.chart-tip.show { opacity: 1; }
.chart-tip b { display: block; font-size: 13px; }
.chart-empty { color: var(--muted); font-size: 13.5px; padding: 30px 0; text-align: center; }
.ranked { display: flex; flex-direction: column; gap: 10px; }
.ranked .r { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13.5px; }
.ranked .r .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranked .r .v { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }
.ranked .r .bar-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.ranked .r .bar-fill { height: 100%; border-radius: 3px; background: var(--accent); }
.ranked .r .s { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -2px; }
.mini-orders { display: flex; flex-direction: column; }
.mini-orders .o { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mini-orders .o:last-child { border-bottom: none; }
.mini-orders .o .who { font-weight: 600; }
.mini-orders .o .what { color: var(--muted); font-size: 12.5px; }
.mini-orders .o .amt { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }

/* ---------- admin: offers & codes ---------- */
.offer-row { padding: 16px 18px; display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; margin-bottom: 10px; }
.offer-row .thumb { width: 56px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.offer-row .amounts { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.offer-row .amounts .offer-amt { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.offer-row .amounts .asking { font-size: 13px; color: var(--muted); }
.offer-row .buyer { font-size: 13.5px; margin-top: 2px; }
.offer-row .msg { font-size: 13px; color: var(--ink-2); font-style: italic; margin-top: 6px; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; }
.offer-row .when { font-size: 12px; color: var(--muted); margin-top: 6px; }
.offer-row .side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.offer-row .side .actions { display: flex; gap: 6px; }
.offer-row .link-box { font-size: 12px; color: var(--muted); max-width: 240px; word-break: break-all; }
.offer-row.done { opacity: .7; }
@media (max-width: 600px) { .offer-row { grid-template-columns: 56px 1fr; } .offer-row .side { grid-column: 1 / -1; align-items: flex-start; } }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.code-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.code-row:last-child { border-bottom: none; }
.code-row .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: 15px; letter-spacing: .04em; }
.code-row .desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.code-row .uses { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.code-row.off { opacity: .55; }
@media (max-width: 600px) { .code-row { grid-template-columns: 1fr auto; } .code-row .uses { grid-column: 1 / -1; } }
.code-form { padding: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; align-items: end; margin-bottom: 18px; }
.code-form .field { min-width: 0; }
.kind-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.kind-toggle button { border: none; background: var(--surface); padding: 10px 14px; font-weight: 600; font-size: 13px; color: var(--muted); }
.kind-toggle button.active { background: var(--ink); color: var(--on-ink); }
.copy-btn { font-size: 12px; }

/* ---------- theme toggle ---------- */
.theme-btn .sun, .theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root:not([data-theme="dark"]) .theme-btn .moon { display: block; }

/* ---------- video ---------- */
.product-media video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.media-badge { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: rgba(17,17,17,.78); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; backdrop-filter: blur(4px); }
.media-badge svg { width: 10px; height: 10px; fill: currentColor; }
.gallery-main video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.gallery-thumbs button { position: relative; }
.gallery-thumbs video { width: 100%; height: 100%; object-fit: cover; background: #000; pointer-events: none; }
.play-ico { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.play-ico span { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; }
.play-ico svg { width: 10px; height: 10px; fill: #111; margin-left: 2px; }
.image-tile video { width: 100%; height: 100%; object-fit: cover; background: #000; pointer-events: none; }
.image-tile .kind { position: absolute; bottom: 6px; left: 6px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(17,17,17,.8); color: #fff; }
.image-tile .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(17,17,17,.25); }
.image-tile .prog i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.image-tile.uploading .pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink); }
