/* Vertix Studio – Tebex theme
   flat dark UI, one accent (logo purple), Geist + Geist Mono, Michroma only for the wordmark */

:root {
  --accent: #a516f5;
  --accent-hover: #b43dff;
  --accent-ink: #d9a8ff;

  --bg: #0c0b10;
  --surface: #131218;
  --surface-2: #1a1920;
  --surface-3: #22212a;
  --line: #26252e;
  --line-2: #33323d;
  --text: #ececf1;
  --text-2: #b9b8c4;
  --muted: #85848f;

  --ok: #4ade80;
  --warn: #facc15;
  --danger: #f87171;

  --r: 8px;
  --r-sm: 6px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --wordmark: "Michroma", var(--font);
  --shell: 1200px;
  color-scheme: dark;

  --tebex-legal-footer-background-color: #0c0b10;
  --tebex-legal-footer-text-color: #85848f;
  --tebex-legal-footer-border-color: #26252e;
  --tebex-legal-footer-logo-color: #b9b8c4;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--text); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font: 500 14px/1 var(--font);
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-3); color: #fff; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-plain { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-plain:hover { background: var(--surface-2); }
.btn-danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line-2)); }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- Header ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(12, 11, 16, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { height: 28px; width: auto; }
.wordmark { font-family: var(--wordmark); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--text); white-space: nowrap; }
.wordmark span { color: var(--muted); }

.nav { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav > li { flex: none; }
.nav a, .nav summary {
  display: inline-flex; align-items: center; gap: 4px; height: 60px; padding: 0 10px;
  color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; list-style: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.nav summary::-webkit-details-marker { display: none; }
.nav a:hover, .nav summary:hover { color: var(--text); }
.nav a.is-active, .nav details.is-active > summary { color: var(--text); border-bottom-color: var(--accent); }
.nav-drop { position: fixed; z-index: 45; min-width: 200px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.nav-drop a { display: flex; height: auto; padding: 8px 10px; border: 0; margin: 0; border-radius: var(--r-sm); color: var(--text-2); }
.nav-drop a:hover { background: var(--surface-3); color: #fff; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.select {
  appearance: none; -webkit-appearance: none; height: 38px; padding: 0 28px 0 10px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background-color: var(--surface-2); color: var(--text-2);
  font: 500 13px var(--mono); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2385848f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select option { background: var(--surface-2); }
.user { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 4px 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: 13px; color: var(--text-2); }
.user b { font-weight: 500; color: var(--text); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user a { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 4px; color: var(--muted); }
.user a:hover { background: var(--surface-3); color: var(--text); }
.cart-count { font-family: var(--mono); font-size: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 4px; background: rgba(255,255,255,.18); display: inline-grid; place-items: center; }

/* ---------- Page structure ---------- */
.page { padding: 32px 0 64px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.aside { display: grid; gap: 16px; }
.stack { display: grid; gap: 40px; }

.banner { width: 100%; height: clamp(220px, 34vw, 560px); overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface); }
.banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.banner img.drift { animation: drift 28s ease-in-out infinite alternate; transform-origin: 60% 50%; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.09) translateX(-1.5%); } }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 20px; }
.intro h1 { font-size: 22px; }
.intro p { color: var(--text-2); max-width: 60ch; margin-top: 6px; }
.intro .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.block-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.block-title h2 { font-size: 16px; }
.block-title a { font-size: 13px; color: var(--muted); }
.block-title a:hover { color: var(--text); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel-pad { padding: 20px; }
.panel-head { padding: 14px 20px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.page-head { padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 26px; }
.page-head .lead { color: var(--text-2); margin-top: 8px; max-width: 70ch; }
.crumbs { font: 12px var(--mono); color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

.prose { color: var(--text-2); }
.prose h1, .prose h2, .prose h3 { color: var(--text); margin: 1.2em 0 .5em; font-size: 1.1em; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose code { font: 13px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--surface-3); color: var(--text); }
.prose img { border-radius: var(--r-sm); }

/* ---------- Category list (home) ---------- */
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.cat-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 500; }
.cat-link:hover { border-color: var(--line-2); background: var(--surface-2); }
.cat-link svg { color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { color: var(--muted); transition: transform .15s; flex: none; }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq .answer { padding: 0 18px 16px; color: var(--text-2); font-size: 14px; }
.faq code { font: 13px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--surface-3); color: var(--text); }

/* ---------- Product cards ---------- */
/* toolbar above the products: search, count, sort */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.searchbox { position: relative; flex: 1 1 260px; min-width: 0; }
.searchbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox input { width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 14px var(--font); }
.searchbox input::placeholder { color: var(--muted); }
.searchbox input:focus { outline: none; border-color: var(--accent); }
.searchbox input::-webkit-search-cancel-button { filter: invert(.6); }
.toolbar .count { font: 13px var(--mono); color: var(--muted); margin-left: auto; white-space: nowrap; }
.subcats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); }
.chip:hover { color: #fff; border-color: var(--muted); }
.no-results { display: none; }
.no-results.is-visible { display: block; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.product { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color .15s, transform .15s, box-shadow .15s; }
.product:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: 0 14px 32px -18px rgba(0, 0, 0, .9); }
.product.in-basket { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); }
.product-media { position: relative; display: block; margin: 8px 8px 0; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 6px; background: var(--surface-2); cursor: pointer; overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product:hover .product-media img { transform: scale(1.035); }
.product-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); pointer-events: none; }
.product-media .noimg { display: grid; place-items: center; height: 100%; font: 12px var(--mono); color: var(--muted); }
.product-peek { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 4px; background: rgba(12, 11, 16, .88); border: 1px solid var(--line-2); font-size: 12px; color: var(--text); opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; }
.product:hover .product-peek, .product-media:focus-visible .product-peek { opacity: 1; transform: none; }
.tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 4px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 4px; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .03em; background: rgba(12, 11, 16, .85); border: 1px solid var(--line-2); color: var(--text-2); }
.tag-sale { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-ok { color: var(--ok); }
.tag-time { color: var(--warn); }
.product-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.product-kind { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.product-name { font-size: 17px; font-weight: 600; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: auto -16px 0; padding: 14px 16px 0; border-top: 1px solid var(--line); }
.product-actions { display: flex; gap: 6px; }
.price { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 500; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price .cur { color: var(--muted); font-size: 13px; }
.price del { color: var(--muted); font-size: 13px; }
.price .free { color: var(--ok); }

.rows { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.row { display: flex; align-items: center; gap: 16px; padding: 12px 14px; }
.row + .row { border-top: 1px solid var(--line); }
.row .thumb { width: 128px; aspect-ratio: 16 / 9; flex: none; overflow: hidden; border-radius: var(--r-sm); border: 1px solid var(--line); padding: 0; background: var(--surface-2); cursor: pointer; }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row .info { flex: 1; min-width: 0; }
.row .info .product-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .info .meta { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.row .info .tag { background: var(--surface-2); }
.row .actions { display: flex; gap: 6px; }

.empty { padding: 48px 24px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--muted); }
.empty h3 { color: var(--text); font-size: 15px; margin-bottom: 6px; }

/* ---------- Modules ---------- */
.module { padding: 18px; }
.module h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); }
.module h4 .tag { position: static; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); }
.progress-bar.is-striped { background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%); background-size: 12px 12px; }
.progress-bar.is-animated { animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 12px 0; } }
.progress-meta { display: flex; justify-content: space-between; margin-top: 8px; font: 12px var(--mono); color: var(--muted); }
.progress-meta b { color: var(--text); font-weight: 500; }
.payments-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.payments-list li { display: flex; align-items: center; gap: 10px; }
.payments-list .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payments-list .what { display: block; font-size: 12px; color: var(--muted); }
.avatar { width: 26px; height: 26px; border-radius: 4px; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font: 500 12px var(--mono); text-transform: uppercase; }
.feature-pkg { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.feature-pkg .thumb { aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.feature-pkg .thumb img { width: 100%; height: 100%; object-fit: cover; }
.feature-pkg .body { padding: 14px 18px 16px; display: grid; gap: 2px; }
.feature-pkg:hover .product-name { text-decoration: underline; text-underline-offset: 3px; }
.top-donor { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.top-donor .avatar { width: 38px; height: 38px; font-size: 14px; }
.status-box { font: 13px var(--mono); color: var(--text-2); }
.alert-inline { margin-top: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; }
.alert-inline.is-danger { color: var(--danger); }
.alert-inline.is-warning { color: var(--warn); }
.alert-inline.is-success { color: var(--ok); }

/* ---------- Checkout ---------- */
.lines { display: grid; }
.line { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.line + .line { border-top: 1px solid var(--line); }
.line .thumb { width: 88px; aspect-ratio: 16 / 9; flex: none; overflow: hidden; border-radius: 4px; border: 1px solid var(--line); background: var(--surface-2); }
.line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.line .info { flex: 1; min-width: 0; }
.line .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line .meta { font: 13px var(--mono); color: var(--muted); }
.qty { display: inline-flex; align-items: center; height: 34px; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.qty button { width: 30px; height: 100%; border: 0; background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.qty button:hover { background: var(--surface-3); color: #fff; }
.qty input { width: 34px; height: 100%; border: 0; border-inline: 1px solid var(--line-2); background: transparent; color: var(--text); text-align: center; font: 13px var(--mono); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; color: var(--text-2); }
.sum-row .mono { color: var(--text); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 600; }
.sum-total .mono { font-size: 20px; }
.note { font-size: 13px; color: var(--muted); margin-top: 14px; }
.note b { color: var(--text-2); font-weight: 500; }
.coupon { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 10px; border-radius: 4px; border: 1px solid var(--line-2); font: 12px var(--mono); color: var(--text-2); }
.coupon a { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 3px; color: var(--muted); }
.coupon a:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input, .field select, .field input[type="text"] {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); font: 14px var(--font);
}
.field select option { background: var(--surface-2); }
.input::placeholder, .field input::placeholder { color: var(--muted); }
.input:focus, .field select:focus, .field input:focus { outline: none; border-color: var(--accent); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }

/* ---------- Drawer ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .15s; }
.overlay.is-open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(400px, 100%); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .2s ease-out; }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 20px; height: 60px; border-bottom: 1px solid var(--line); font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; }
.drawer-body .line { padding: 12px 20px; }
.drawer-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.modal.is-open { opacity: 1; pointer-events: auto; }
/* backdrop inside .modal/.palette: inherits pointer-events from its parent, so it can't block clicks while closed */
.backdrop { position: absolute; inset: 0; z-index: 0; background: rgba(0, 0, 0, .6); }
.modal-box { position: relative; z-index: 1; width: min(860px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 24px 64px rgba(0,0,0,.6); }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 3; width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: rgba(12, 11, 16, .85); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.modal-close:hover { color: #fff; }
.modal-loading { padding: 80px 20px; display: grid; place-items: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--text); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pd-media { aspect-ratio: 16 / 9; max-height: 460px; width: 100%; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.pd-media img { width: 100%; height: 100%; object-fit: cover; }
.pd-media .noimg { display: grid; place-items: center; height: 100%; font: 12px var(--mono); color: var(--muted); }

/* Product gallery (built by store.js) */
.pd-media.has-gallery { aspect-ratio: auto; max-height: none; overflow: visible; display: flex; flex-direction: column; }
.gal-stage { position: relative; aspect-ratio: 16 / 9; max-height: 460px; width: 100%; background: #08070b; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.gal-stage .gal-img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.gal-nav, .gal-zoom {
  position: absolute; z-index: 2; display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: rgba(12, 11, 16, .78); color: var(--text-2); cursor: pointer;
  transition: background .12s, color .12s;
}
.gal-nav:hover, .gal-zoom:hover { background: var(--surface-3); color: #fff; }
.gal-nav { top: 50%; transform: translateY(-50%); }
.gal-prev { left: 12px; }
.gal-next { right: 12px; }
.gal-zoom { right: 12px; bottom: 12px; width: 34px; height: 34px; }
.gal-count { position: absolute; left: 12px; bottom: 12px; z-index: 2; padding: 3px 8px; border-radius: 4px; background: rgba(12, 11, 16, .78); border: 1px solid var(--line-2); font-size: 12px; color: var(--text-2); }
.gal-thumbs { display: flex; gap: 8px; padding: 10px 12px; overflow-x: auto; background: var(--surface-2); scrollbar-width: thin; }
.gal-thumb { flex: 0 0 auto; width: 96px; aspect-ratio: 16 / 9; padding: 0; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface-3); overflow: hidden; cursor: pointer; opacity: .55; transition: opacity .12s, border-color .12s; }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gal-thumb:hover { opacity: .85; }
.gal-thumb.is-active { opacity: 1; border-color: var(--accent); }
.gal-thumb { position: relative; }
.gal-thumb.is-video::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.8)); }
.gal-video { position: absolute; inset: 0; }
.gal-video[hidden], .gal-img[hidden] { display: none; }
.gal-video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* fullscreen view */
.pd-media.is-zoomed { position: fixed; inset: 0; z-index: 10; background: rgba(5, 5, 8, .97); border: 0; }
.pd-media.is-zoomed .gal-stage { flex: 1; aspect-ratio: auto; max-height: none; background: transparent; }
.pd-media.is-zoomed .gal-img { cursor: zoom-out; }
.pd-media.is-zoomed .gal-thumbs { justify-content: center; background: transparent; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
  .gal-nav { width: 34px; height: 34px; }
  .gal-thumb { width: 72px; }
}
.pd { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; padding: 24px; }
.pd h2 { font-size: 22px; margin-bottom: 12px; }
.pd .prose { font-size: 14.5px; }
.buy { display: grid; gap: 10px; align-content: start; }
.buy .price { font-size: 22px; }
.specs { list-style: none; margin: 6px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.specs li { display: flex; gap: 8px; }
.specs li::before { content: "+"; font-family: var(--mono); color: var(--accent-ink); }
.reason { font-size: 13px; color: var(--danger); }
.gift { border-top: 1px solid var(--line); padding-top: 12px; }
.gift summary { cursor: pointer; font-size: 13px; color: var(--text-2); list-style: none; }
.gift summary::-webkit-details-marker { display: none; }
.gift summary:hover { color: var(--text); }
.gift form { margin-top: 10px; }
.terms-body { padding: 28px 24px; }
.terms-body h2 { font-size: 18px; margin-bottom: 12px; padding-right: 40px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; z-index: 120; right: 16px; bottom: 16px; width: min(380px, calc(100% - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2); font-size: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.toast::before { content: ""; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.toast.is-success::before { background: var(--ok); }
.toast.is-danger::before, .toast.is-error::before { background: var(--danger); }
.toast.is-warning::before { background: var(--warn); }
.toast button { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.toast.is-hiding { opacity: 0; transition: opacity .2s; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- Language picker (header) ---------- */
.lang { position: relative; }
.lang summary { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 9px 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font-size: 13px; cursor: pointer; list-style: none; user-select: none; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { color: var(--text); background: var(--surface-3); }
.lang summary svg { color: var(--muted); transition: transform .15s; }
.lang[open] summary svg { transform: rotate(180deg); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 200px; padding: 4px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.lang-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px; color: var(--text-2); }
.lang-menu a:hover { background: var(--surface-3); color: #fff; }
.lang-menu a.is-current { color: #fff; }
.lang-menu a.is-current::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.lang-menu .mono { width: 22px; }
.lang-name { color: var(--muted); }
.lang-menu a:hover .lang-name { color: var(--text-2); }

/* flags drawn with gradients (Windows renders flag emoji as letters) */
.flag { display: inline-block; width: 20px; height: 14px; flex: none; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); background: var(--surface-3); }
.flag-de { background: linear-gradient(#000 0 33.3%, #dd0000 33.3% 66.6%, #ffce00 66.6%); }
.flag-at { background: linear-gradient(#ed2939 0 33.3%, #fff 33.3% 66.6%, #ed2939 66.6%); }
.flag-ch { background: linear-gradient(#fff, #fff) center / 8px 2.5px no-repeat, linear-gradient(#fff, #fff) center / 2.5px 8px no-repeat, #d52b1e; }
.flag-es { background: linear-gradient(#aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75%); }
.flag-fi { background: linear-gradient(90deg, transparent 0 28%, #002f6c 28% 46%, transparent 46%), linear-gradient(transparent 0 38%, #002f6c 38% 62%, transparent 62%), #fff; }
.flag-se { background: linear-gradient(90deg, transparent 0 30%, #fecc02 30% 46%, transparent 46%), linear-gradient(transparent 0 40%, #fecc02 40% 60%, transparent 60%), #006aa7; }
.flag-dk { background: linear-gradient(90deg, transparent 0 30%, #fff 30% 44%, transparent 44%), linear-gradient(transparent 0 42%, #fff 42% 58%, transparent 58%), #c8102e; }
.flag-no { background: linear-gradient(90deg, transparent 0 32%, #00205b 32% 42%, transparent 42%), linear-gradient(transparent 0 44%, #00205b 44% 56%, transparent 56%), linear-gradient(90deg, transparent 0 27%, #fff 27% 47%, transparent 47%), linear-gradient(transparent 0 36%, #fff 36% 64%, transparent 64%), #ba0c2f; }
.flag-fr { background: linear-gradient(90deg, #002395 0 33.3%, #fff 33.3% 66.6%, #ed2939 66.6%); }
.flag-it { background: linear-gradient(90deg, #009246 0 33.3%, #fff 33.3% 66.6%, #ce2b37 66.6%); }
.flag-nl { background: linear-gradient(#ae1c28 0 33.3%, #fff 33.3% 66.6%, #21468b 66.6%); }
.flag-pl { background: linear-gradient(#fff 0 50%, #dc143c 50%); }
.flag-cz { background: linear-gradient(to bottom right, #11457e 0 50%, transparent 50%) left top / 50% 50% no-repeat, linear-gradient(to top right, #11457e 0 50%, transparent 50%) left bottom / 50% 50% no-repeat, linear-gradient(#fff 0 50%, #d7141a 50%); }
.flag-pt { background: linear-gradient(90deg, #006600 0 40%, #ff0000 40%); }
.flag-br { background: radial-gradient(circle, #002776 0 22%, transparent 23%), linear-gradient(135deg, transparent 0 25%, #fedf00 25% 75%, transparent 75%) center / 70% 80% no-repeat, #009c3b; }
.flag-tr { background: radial-gradient(circle at 42% 50%, #fff 0 22%, transparent 23%), #e30a17; }
.flag-ru { background: linear-gradient(#fff 0 33.3%, #0039a6 33.3% 66.6%, #d52b1e 66.6%); }
.flag-us { background: linear-gradient(#3c3b6e, #3c3b6e) left top / 45% 54% no-repeat, repeating-linear-gradient(#b22234 0 7.69%, #fff 7.69% 15.38%); }
.flag-gb { background: linear-gradient(#c8102e, #c8102e) center / 100% 2.5px no-repeat, linear-gradient(#c8102e, #c8102e) center / 2.5px 100% no-repeat, linear-gradient(#fff, #fff) center / 100% 5px no-repeat, linear-gradient(#fff, #fff) center / 5px 100% no-repeat, linear-gradient(33deg, transparent 0 45%, #fff 45% 55%, transparent 55%), linear-gradient(-33deg, transparent 0 45%, #fff 45% 55%, transparent 55%), #012169; }

/* ---------- Global search (Ctrl+K palette) ---------- */
.product .product-name { margin-bottom: 12px; }
.search-trigger { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font: 13px var(--font); cursor: pointer; }
.search-trigger:hover { color: var(--text); border-color: var(--muted); }
kbd { font: 11px var(--mono); padding: 2px 5px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); }
.palette { position: fixed; inset: 0; z-index: 110; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; opacity: 0; pointer-events: none; transition: opacity .12s; }
.palette.is-open { opacity: 1; pointer-events: auto; }
.palette-box { position: relative; z-index: 1; width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: 0 24px 64px rgba(0, 0, 0, .65); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.palette-input svg { color: var(--muted); }
.palette-input input { flex: 1; min-width: 0; height: 52px; border: 0; background: transparent; color: var(--text); font: 16px var(--font); }
.palette-input input:focus { outline: none; }
.palette-input input::placeholder { color: var(--muted); }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.palette-item.is-active { background: var(--surface-2); }
.palette-item .thumb { width: 64px; aspect-ratio: 16 / 9; flex: none; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.palette-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.palette-item .info { flex: 1; min-width: 0; }
.palette-item .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .name mark { background: none; color: var(--accent-ink); }
.palette-item .cat { font: 12px var(--mono); color: var(--muted); }
.palette-item .price { font-size: 13px; }
.palette-msg { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.palette-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------- Icons ---------- */
.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 14px; height: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .pd { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 0 16px; }
  .topbar-actions { height: 40px; }
  .nav { order: 3; width: 100%; }
  .nav a, .nav summary { height: 44px; }
}
@media (max-width: 640px) {
  .shell { padding: 0 16px; }
  .wordmark, .hide-sm { display: none !important; }
  .page { padding: 20px 0 48px; }
  .banner { height: 200px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .row { flex-wrap: wrap; }
  .row .thumb { width: 100%; }
  .row .actions { width: 100%; }
  .row .actions .btn:last-child { flex: 1; }
  .line { flex-wrap: wrap; padding: 12px 16px; }
  .pd { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
