/* Ultima webstore: Studio app design system on the web (dark neon, owner 29 Nov 2026).
   Cards: ink outline + soft dark drop. Brand surfaces glow red. Big type gets a centred soft glow, never an offset fringe. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/23px var(--font-body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--primary); color: var(--on-primary); padding: 8px 12px; border-radius: var(--r-control); }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--s-lg); }

/* type (studio tokens.ts) */
.caption { font: 12px/16px var(--font-bold); letter-spacing: .8px; margin: 0; }
.heading { font: 21px/26px var(--font-display); letter-spacing: 1.1px; margin: var(--s-xl) 0 var(--s-md); }
.display { font: clamp(32px, 6vw, 48px)/1.12 var(--font-display-bold); letter-spacing: .3px; margin: 0; text-shadow: 0 0 12px var(--glow); }
.title { font: 20px/26px var(--font-display); letter-spacing: .2px; margin: 0; }
.muted { color: var(--text-muted); }
.accent { color: var(--accent); }
.small { font-size: 14px; line-height: 20px; }

/* controls */
.btn { min-height: var(--touch); display: inline-flex; align-items: center; justify-content: center; gap: var(--s-sm); padding: 0 var(--s-xl); border-radius: var(--r-control); border: 1px solid var(--ink); background: var(--surface2); font-family: var(--font-bold); cursor: pointer; transition: transform .12s ease-out, box-shadow .18s ease-out, background .18s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary-text); color: var(--on-primary); box-shadow: 0 0 16px var(--glow); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 0 24px var(--glow); }
.btn.ghost { background: none; border-color: transparent; color: var(--primary-text); padding: 0 var(--s-md); }
.btn:disabled { background: var(--surface2); border-color: var(--border); color: var(--text-muted); box-shadow: none; cursor: not-allowed; } /* flat grey, not faded red */
.btn.wide { width: 100%; justify-content: space-between; }
.icon-btn { position: relative; width: var(--touch); height: var(--touch); flex: none; display: grid; place-items: center; border-radius: var(--r-control); border: 1px solid var(--ink); background: var(--surface); cursor: pointer; }
.icon-btn svg, .search svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn b { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); font: 12px/22px var(--font-bold); box-shadow: 0 0 10px var(--glow); }
.chip { min-height: 40px; padding: 0 var(--s-lg); border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); font-family: var(--font-bold); font-size: 15px; white-space: nowrap; cursor: pointer; transition: transform .12s ease-out; }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary-text); color: var(--on-primary); box-shadow: 0 0 8px var(--glow); }
.select select { min-height: 40px; padding: 0 36px 0 var(--s-md); border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 18px; appearance: none; font-family: var(--font-bold); font-size: 15px; cursor: pointer; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(8,8,13,.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.top-row { display: flex; align-items: center; gap: var(--s-md); height: 64px; }
.logo img { height: 40px; width: auto; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s-sm); height: var(--touch); padding: 0 var(--s-md); border-radius: var(--r-control); border: 1px solid var(--ink); background: var(--surface); color: var(--text-muted); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); }

/* hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; opacity: .55; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 8%, rgba(8,8,13,.6) 55%, rgba(8,8,13,.2)), linear-gradient(0deg, var(--bg), transparent 45%); }
.hero-body { position: relative; z-index: 1; display: grid; gap: var(--s-md); justify-items: start; padding-top: 56px; padding-bottom: 48px; max-width: 1200px; }
.hero-body .display { max-width: 12ch; }
.lede { margin: 0; max-width: 42ch; color: var(--text-muted); font-size: 18px; line-height: 26px; }

.trust { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-sm); margin: var(--s-lg) auto 0; }
.trust li { display: grid; gap: 2px; padding: var(--s-md); border-radius: var(--r-control); background: var(--surface); border: 1px solid var(--border); }
.trust b { font-family: var(--font-bold); font-size: 15px; }
.trust span { color: var(--text-muted); font-size: 13px; line-height: 18px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-sm); margin-top: var(--s-lg); }
.chips { display: flex; gap: var(--s-sm); overflow-x: auto; scrollbar-width: none; padding: 6px 2px; margin: -6px -2px; }
.filters { display: flex; gap: var(--s-sm); }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--s-lg); padding-bottom: 64px; }
.card { position: relative; display: flex; flex-direction: column; border-radius: var(--r-card); border: 1px solid var(--ink); background: var(--surface); overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.55); transition: transform .18s ease-out, border-color .18s; }
.card:hover { transform: translateY(-2px); border-color: var(--border); }
.card .hit { position: absolute; inset: 0; z-index: 1; border: 0; background: none; cursor: pointer; border-radius: inherit; }
.art { position: relative; aspect-ratio: 3 / 4; background: radial-gradient(circle at 50% 35%, var(--surface2), var(--surface)); display: grid; place-items: center; overflow: hidden; }
.art img { width: 100%; height: 100%; object-fit: cover; }
.art .ph { display: grid; justify-items: center; gap: var(--s-sm); color: var(--text-muted); font: 20px var(--font-display); letter-spacing: 1px; }
.art .ph img { width: 56px; height: 56px; object-fit: contain; opacity: .35; filter: grayscale(1); }
.badges { position: absolute; top: var(--s-sm); left: var(--s-sm); display: flex; gap: 4px; flex-wrap: wrap; }
.badge { padding: 3px 8px; border-radius: var(--r-pill); font: 11px/14px var(--font-bold); letter-spacing: .6px; background: rgba(8,8,13,.82); border: 1px solid var(--ink); color: var(--accent); }
.badge.new { color: var(--success); }
.badge.low { color: var(--warning); }
.body { display: flex; flex-direction: column; gap: 6px; padding: var(--s-md); flex: 1; }
.plat { font: 12px/16px var(--font-bold); letter-spacing: .8px; color: var(--text-muted); }
.name { margin: 0; font: 15px/20px var(--font-bold); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-row { display: flex; align-items: baseline; gap: var(--s-sm); margin-top: auto; padding-top: 4px; }
.price { font: 20px/24px var(--font-display); color: var(--primary-text); }
.was { color: var(--text-muted); text-decoration: line-through; font-size: 13px; }
.stock { font-size: 13px; line-height: 18px; color: var(--success); }
.stock.out { color: var(--text-muted); }
.stock.low { color: var(--warning); }
.add { position: relative; z-index: 2; margin-top: var(--s-sm); width: 100%; padding: 0; }
.more-row { grid-column: 1 / -1; display: flex; justify-content: center; }

/* states */
.skeleton .art, .skeleton .line { background: linear-gradient(90deg, var(--surface2) 0%, #24243a 50%, var(--surface2) 100%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton .line { height: 14px; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.state { grid-column: 1 / -1; display: grid; justify-items: center; gap: var(--s-md); padding: 48px var(--s-lg); text-align: center; border-radius: var(--r-card); border: 1px solid var(--ink); background: var(--surface); }
.state img { width: 96px; height: 96px; object-fit: contain; }
.state p { margin: 0; max-width: 40ch; }

/* sheets (bottom sheet on phones, centred panel on desktop) */
.sheet { padding: 0; border: 1px solid var(--ink); border-radius: var(--r-card); background: var(--surface); color: var(--text); width: min(560px, 100vw - 32px); max-height: min(88vh, 820px); box-shadow: 0 12px 48px rgba(0,0,0,.7); }
.sheet::backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
.sheet[open] { animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: var(--s-md); padding: var(--s-md) var(--s-md) var(--s-md) var(--s-xl); background: var(--surface); border-bottom: 1px solid var(--border); }
.sheet-body { padding: var(--s-xl); display: grid; gap: var(--s-lg); }
.close { width: var(--touch); height: var(--touch); border: 0; background: none; color: var(--text-muted); font-size: 22px; cursor: pointer; border-radius: var(--r-control); }
.p-hero { display: grid; grid-template-columns: 140px 1fr; gap: var(--s-lg); align-items: start; }
.p-hero .art { border-radius: var(--r-control); border: 1px solid var(--ink); }
.p-meta { display: grid; gap: var(--s-sm); }
.desc { white-space: pre-line; color: var(--text-muted); margin: 0; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--ink); border-radius: var(--r-control); background: var(--surface2); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font: 20px var(--font-bold); cursor: pointer; }
.stepper button:disabled { color: var(--border); cursor: not-allowed; }
.stepper output { min-width: 32px; text-align: center; font-family: var(--font-bold); }
.buy-row { display: flex; gap: var(--s-md); align-items: center; }
.buy-row .btn { flex: 1; }

.steps { display: flex; gap: var(--s-sm); font: 12px/16px var(--font-bold); letter-spacing: .8px; color: var(--text-muted); }
.steps .on { color: var(--accent); }
.line-item { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--s-md); align-items: center; padding-bottom: var(--s-md); border-bottom: 1px solid var(--border); }
.line-item .art { aspect-ratio: 3/4; border-radius: 8px; }
.line-item .art .ph { font-size: 11px; }
.line-item .art .ph img { display: none; }
.li-name { margin: 0 0 6px; font: 15px/20px var(--font-bold); }
.li-price { font-family: var(--font-display); color: var(--primary-text); text-align: right; }
.totals { display: grid; gap: 6px; padding: var(--s-lg); border-radius: var(--r-control); background: var(--surface2); border: 1px solid var(--border); }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font: 20px/26px var(--font-display); padding-top: 6px; border-top: 1px solid var(--border); }
.field { display: grid; gap: 6px; }
.field > span { font-family: var(--font-bold); font-size: 15px; }
.field input, .field textarea { min-height: var(--touch); padding: 12px var(--s-md); border-radius: var(--r-control); border: 1px solid var(--ink); background: var(--surface2); outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.field [aria-invalid="true"] { border-color: var(--primary-text); }
.field .err { color: var(--primary-text); font-size: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-sm); }
.seg label { display: grid; gap: 2px; padding: var(--s-md); border-radius: var(--r-control); border: 1px solid var(--ink); background: var(--surface2); cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--primary-text); background: var(--surface-soft); box-shadow: 0 0 10px var(--glow); }
.seg input { position: absolute; opacity: 0; }
.seg b { font-family: var(--font-bold); }
.seg span { color: var(--text-muted); font-size: 13px; }
.notice { padding: var(--s-md); border-radius: var(--r-control); border: 1px solid rgba(255,181,71,.35); background: rgba(255,181,71,.08); color: var(--warning); font-size: 14px; line-height: 20px; }
.done { text-align: center; justify-items: center; }
.done img { width: 112px; height: 112px; object-fit: contain; }
.code { font: 28px/34px var(--font-display-bold); letter-spacing: 1.5px; color: var(--accent); text-shadow: 0 0 12px var(--accent-glow); }

/* sticky cart bar (phones) + toast */
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: var(--s-sm) var(--s-lg) max(var(--s-sm), env(safe-area-inset-bottom)); background: rgba(8,8,13,.92); backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
.toast { position: fixed; left: 50%; bottom: 88px; z-index: 30; transform: translateX(-50%); display: flex; align-items: center; gap: var(--s-md); min-height: var(--touch); padding: 0 var(--s-sm) 0 var(--s-lg); border-radius: var(--r-control); background: var(--surface2); border: 1px solid var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.6); font-family: var(--font-bold); animation: rise .2s ease-out; max-width: calc(100vw - 32px); }
.toast .btn { min-height: 40px; }

.foot { display: flex; align-items: center; gap: var(--s-lg); padding-top: var(--s-xl); padding-bottom: 120px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 14px; }
.foot p { margin: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 var(--s-lg); margin-bottom: var(--s-sm); }
.foot-links a { display: inline-flex; align-items: center; min-height: 40px; color: var(--text); font-family: var(--font-bold); text-decoration: none; }
.foot-links a:hover { color: var(--accent); }

/* small helpers */
.lang { font: 13px var(--font-bold); letter-spacing: .5px; }
.grow { flex: 1; }
.center { text-align: center; }
.price.big { font-size: 28px; line-height: 34px; }
.badges.static { position: static; }
.nudge { margin: 0; padding: var(--s-sm) var(--s-md); border-radius: var(--r-control); background: rgba(34,211,238,.08); border: 1px solid rgba(34,211,238,.3); color: var(--accent); font: 14px/20px var(--font-bold); }
fieldset.seg { border: 0; padding: 0; margin: 0; }
.seg legend { padding: 0; margin-bottom: 6px; font-family: var(--font-bold); font-size: 15px; }
.seg label { position: relative; }

/* order + track views */
.view { display: grid; gap: var(--s-lg); padding-top: var(--s-xl); padding-bottom: 64px; max-width: 640px; }
.view .heading { margin: var(--s-sm) 0 0; }
.order-card { display: grid; gap: var(--s-md); padding: var(--s-xl); border-radius: var(--r-card); border: 1px solid var(--ink); background: var(--surface); box-shadow: 0 4px 16px rgba(0,0,0,.55); }
.order-card.narrow { max-width: 480px; }
.order-card .line { height: 16px; border-radius: 6px; }
.order-card .code { margin: 0; }
.order-msg p { margin: 0 0 var(--s-md); }
.celebrate { display: grid; justify-items: center; gap: var(--s-sm); text-align: center; }
.celebrate img { width: 112px; height: 112px; object-fit: contain; }
.pill { justify-self: start; margin: 0; padding: 4px 12px; border-radius: var(--r-pill); background: var(--surface2); border: 1px solid var(--accent); color: var(--accent); font: 14px/20px var(--font-bold); }
.pill.good { border-color: var(--success); color: var(--success); }
.pill.bad { border-color: var(--border); color: var(--text-muted); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; }
.timeline li { flex: 1; display: grid; justify-items: center; gap: 6px; position: relative; color: var(--text-muted); font: 12px/16px var(--font-bold); text-align: center; }
.timeline li span { width: 14px; height: 14px; border-radius: 50%; background: var(--surface2); border: 2px solid var(--border); z-index: 1; }
.timeline li::before { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.timeline li:first-child::before { display: none; }
.timeline li.on { color: var(--text); }
.timeline li.on span { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.timeline li.on::before { background: var(--accent); }
.line-row { display: flex; justify-content: space-between; gap: var(--s-md); padding-bottom: var(--s-sm); border-bottom: 1px solid var(--border); }
.order-actions { display: flex; flex-wrap: wrap; gap: var(--s-sm); }
.order-actions .btn:first-child { flex: 1; }
.sheet-body.flush { padding: 0; }
.recent { display: flex; flex-wrap: wrap; gap: var(--s-sm); }
a.btn { text-decoration: none; color: inherit; }
a.btn.ghost { color: var(--primary-text); }

/* legal pages */
.legal { max-width: 760px; padding-top: var(--s-xl); padding-bottom: 64px; }
.legal .display { font-size: clamp(28px, 5vw, 40px); margin-bottom: var(--s-lg); }
.legal p, .legal li { color: var(--text-muted); }
.legal b { color: var(--text); }
.legal li { margin-bottom: var(--s-sm); }
.top-row > .btn { margin-left: auto; }

@media (min-width: 768px) {
  .cart-bar { display: none; }
  .toast { bottom: 32px; }
  .foot { padding-bottom: var(--s-xxl); }
}
@media (max-width: 767px) {
  .sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-card) var(--r-card) 0 0; border-bottom: 0; max-height: 92vh; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-md); }
  .trust { grid-template-columns: 1fr 1fr 1fr; }
  .trust span { display: none; }
  .trust li { padding: var(--s-sm) var(--s-md); text-align: center; }
  .trust b { font-size: 13px; line-height: 18px; }
  .p-hero { grid-template-columns: 112px 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .filters { justify-content: space-between; }
  .hero-body { padding-top: 40px; padding-bottom: 32px; }
  .top-row { gap: var(--s-sm); }
  .logo img { height: 30px; }
  .order-card { padding: var(--s-lg); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
