/* LILYSTORE: layout follows the e-commerce reference (notched hero, soft cards),
   in a black theme with violet accents and 8-bit details. Khmer-first typography. */

:root {
  color-scheme: dark;
  --bg: #060509;
  --bg-raised: #0c0a12;
  --surface: #111019;
  --surface-2: #181624;
  --surface-3: #221f33;
  --ink: #f4f2fb;
  --ink-2: #cdc8df;
  --muted: #8f8aa7;
  --line: rgb(255 255 255 / .08);
  --line-2: rgb(255 255 255 / .14);
  --accent: #a78bfa;
  --violet: #7c3aed;
  --violet-600: #6d28d9;
  --violet-300: #c4b5fd;
  --gold: #ffc52e;
  --orange: #ff7a2f;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --field: #0d0c14;
  --glow: radial-gradient(75% 60% at 50% 42%, rgb(139 92 246 / .16), transparent 72%);

  --font: "Inter", "Kantumruy Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Tight", "Inter", "Kantumruy Pro", system-ui, sans-serif;
  --font-pixel: "Silkscreen", ui-monospace, monospace;

  --radius-hero: 28px;
  --radius-card: 20px;
  --radius-field: 12px;
  --shadow: 0 20px 50px -24px rgb(0 0 0 / .8);
  --page-w: 1240px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: -0.02em; }
p { margin: 0; }
[hidden] { display: none !important; }
img.is-broken { visibility: hidden; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgb(139 92 246 / .45); }

.page {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 14px var(--gutter) 0;
}

/* Khmer script needs more vertical room and no negative tracking. */
:lang(km) body { line-height: 1.65; }
:lang(km) h2, :lang(km) h3 { letter-spacing: 0; line-height: 1.4; }
:lang(km) .eyebrow, :lang(km) .live-pill { font-family: var(--font); font-weight: 600; letter-spacing: 0; text-transform: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: background-color .2s, transform .2s, box-shadow .2s, opacity .2s;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--violet); color: #fff; box-shadow: 0 8px 24px -10px rgb(124 58 237 / .9); }
.btn--primary:hover:not(:disabled) { background: var(--violet-600); }
.btn--light { background: #fff; color: #0b0a10; }
.btn--light:hover:not(:disabled) { background: #e9e5f7; }
.btn--ghost { background: var(--surface-2); color: var(--ink); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--block { width: 100%; height: 48px; font-size: 15px; }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  transition: background-color .2s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn--glass { background: rgb(255 255 255 / .1); backdrop-filter: blur(8px); }
.icon-btn--glass:hover { background: rgb(255 255 255 / .2); }
.cart-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a1200;
  font: 700 11px/19px var(--font);
  text-align: center;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgb(255 255 255 / .1);
  backdrop-filter: blur(8px);
}
.lang-switch button {
  min-width: 44px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: rgb(255 255 255 / .75);
  font-size: 13px;
  font-weight: 600;
  transition: background-color .2s, color .2s;
}
.lang-switch button[aria-pressed="true"] { background: #fff; color: #0b0a10; }
.lang-switch button:hover:not([aria-pressed="true"]) { color: #fff; }

/* ---------- Notches: cut-outs in the page colour with inverted rounded corners ---------- */

.notch { position: absolute; z-index: 2; background: var(--bg); --r: 24px; }
.notch::before, .notch::after { content: ""; position: absolute; width: var(--r); height: var(--r); pointer-events: none; }
.notch--tl { top: 0; left: 0; border-bottom-right-radius: var(--r); }
.notch--tl::before { top: 0; left: 100%; }
.notch--tl::after { top: 100%; left: 0; }
.notch--tl::before, .notch--tl::after {
  background: radial-gradient(circle at 100% 100%, transparent calc(var(--r) - .6px), var(--bg) var(--r));
}
.notch--tr { top: 0; right: 0; border-bottom-left-radius: var(--r); }
.notch--tr::before { top: 0; right: 100%; }
.notch--tr::after { top: 100%; right: 0; }
.notch--tr::before, .notch--tr::after {
  background: radial-gradient(circle at 0 100%, transparent calc(var(--r) - .6px), var(--bg) var(--r));
}
.notch--br { right: 0; bottom: 0; border-top-left-radius: var(--r); }
.notch--br::before { bottom: 100%; right: 0; }
.notch--br::after { bottom: 0; right: 100%; }
.notch--br::before, .notch--br::after {
  background: radial-gradient(circle at 0 0, transparent calc(var(--r) - .6px), var(--bg) var(--r));
}

/* ---------- Hero ---------- */

.hero {
  --feature-w: 214px;
  --feature-h: 262px;
  position: relative;
  height: clamp(470px, 44vw, 590px);
  border-radius: var(--radius-hero);
  /* the artwork's black background picks up this violet glow through the blend below */
  background: radial-gradient(85% 120% at 70% 35%, #2e1b62 0%, #160e2e 46%, #0e0a1b 100%);
  overflow: hidden;
  isolation: isolate;
  color: #fff;
}
.hero-img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 32%;
  mix-blend-mode: lighten;
}

.hero-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 10px 30px 14px 4px;
  color: var(--ink);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 21px/1 var(--font-display);
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: flex; gap: 26px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.nav-links a { position: relative; padding: 4px 0; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

.hero-actions {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-title {
  position: absolute;
  left: 2.6%;
  bottom: calc(.21em + 6px); /* room for descenders like the "y" in lily */
  display: flex;
  align-items: flex-start;
  /* sized so a 9-letter name in capitals stays clear of the featured card on the right */
  font-size: clamp(56px, 12.5vw, 176px);
  font-weight: 800;
  line-height: .8;
  letter-spacing: -0.06em;
  white-space: nowrap;
  text-shadow: 0 6px 40px rgb(0 0 0 / .45);
}
.hero-title small:empty { display: none; }
.title-crown {
  width: .22em;
  height: .16em;
  margin: .02em 0 0 .04em;
  color: var(--gold);
  filter: drop-shadow(0 0 14px rgb(255 197 46 / .45));
}
.hero-title small {
  align-self: flex-end;
  margin: 0 0 .05em .14em;
  font-size: .2em;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero-stat {
  position: absolute;
  right: 26px;
  bottom: calc(var(--feature-h) + 34px);
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}
.hero-stat strong {
  font: 800 46px/1 var(--font-display);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.hero-stat span { font-size: 13px; font-weight: 500; color: rgb(255 255 255 / .75); }
.hero.no-feature .hero-stat { bottom: 30px; }

.hero-feature {
  width: var(--feature-w);
  height: var(--feature-h);
  padding: 12px 0 0 12px;
}
.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 10px 12px 12px;
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #1b1531 0%, #2a1a55 45%, #5b21b6 82%, #6d28d9 100%);
  text-align: center;
  overflow: hidden;
}
.feature-card img { width: 128px; height: 128px; object-fit: contain; filter: drop-shadow(0 10px 18px rgb(0 0 0 / .45)); }
.feature-card .feature-name { margin-top: auto; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.25; }
.feature-card .feature-stock { margin: 3px 0 9px; color: rgb(255 255 255 / .78); font-size: 11.5px; }
.feature-card .btn { width: 100%; height: 34px; font-size: 13px; }
.feature-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #fff;
  color: #0b0a10;
  font: 600 10px/1.3 var(--font);
}

/* ---------- Sections ---------- */

.section { margin-top: 64px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.section-head > div:first-child { padding-bottom: 14px; }
.section-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 27px; font-weight: 700; }
.section-head p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.link-arrow:hover { color: var(--ink); }
.link-arrow svg { width: 16px; height: 16px; transition: transform .2s; }
.link-arrow:hover svg { transform: translateX(3px); }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 3px;
  border-radius: 999px;
  background: rgb(52 211 153 / .12);
  color: var(--green);
  font: 400 10px/1.2 var(--font-pixel);
  letter-spacing: .06em;
  text-transform: uppercase;
}
:lang(km) .live-pill { font-size: 12px; }
.live-pill i { width: 7px; height: 7px; border-radius: 2px; background: var(--green); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- Categories ---------- */

.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.category {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  aspect-ratio: 1 / 1.08;
  padding: 18px 16px;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--glow), var(--surface);
  color: var(--ink);
  text-align: center;
  overflow: hidden;
  transition: background-color .25s;
}
.category:hover, .category.is-active { background: var(--glow), var(--surface-2); }
.category img {
  flex: 1;
  min-height: 0;
  width: 74%;
  object-fit: contain;
  filter: drop-shadow(0 16px 20px rgb(0 0 0 / .5));
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.category:hover img { transform: translateY(-4px) scale(1.04); }
.category .category-empty { flex: 1; width: 40%; color: var(--surface-3); }
.category h3 { margin-top: 6px; font-size: 19px; font-weight: 700; }
.category .category-meta { color: var(--muted); font-size: 12.5px; }
.category .notch { --r: 16px; padding: 0 0 8px 8px; }
.category .arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  transition: background-color .2s, color .2s, transform .2s;
}
.category .arrow svg { width: 16px; height: 16px; }
.category:hover .arrow, .category.is-active .arrow { background: var(--violet); color: #fff; transform: rotate(45deg); }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none;
  padding: 0 0 14px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  box-shadow: inset 0 -2px 0 transparent;
  transition: color .2s, box-shadow .2s;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- Products ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px 18px;
  align-items: start;
}
.grid-message { grid-column: 1 / -1; padding: 40px 0; color: var(--muted); text-align: center; }

.product { min-width: 0; }
.product-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1.06;
  border-radius: var(--radius-card);
  background: var(--glow), var(--surface);
  overflow: hidden;
}
.product-media img {
  width: 76%;
  height: 76%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgb(196 181 253 / .22)) drop-shadow(0 16px 18px rgb(0 0 0 / .55));
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.product:hover .product-media img { transform: scale(1.06) translateY(-4px); }
/* Roblox faces are black line art; show them on a light "head" disc so they read on dark cards. */
.product[data-category="faces"] .product-media img,
.category[data-category="faces"] img {
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #f1eefb 0%, #cfc8e6 58%, #b7aed6 70%, transparent 71%);
}
.product-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgb(0 0 0 / .55), transparent 46%);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.product:hover .product-media::after { opacity: 1; }
.price-tag { --r: 16px; padding: 4px 4px 9px 13px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--violet);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.badge--new { background: var(--orange); }
.badge--grail { background: linear-gradient(135deg, #ffd760, #f5a300); color: #2b1a00; }
.badge--8-bit { background: #fff; color: #0b0a10; font: 400 9.5px/1.3 var(--font-pixel); letter-spacing: .05em; }
.buy-pill {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 14px;
  height: 36px;
  padding: 0 18px;
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 8px);
}
.product:hover .buy-pill, .buy-pill:focus-visible { opacity: 1; transform: translate(-50%, 0); }
.product.is-sold-out .product-media img { filter: grayscale(1); opacity: .35; }
.product.is-sold-out .product-media::after { display: none; }
.product.is-sold-out .buy-pill { opacity: 1; transform: translate(-50%, 0); background: var(--surface-3); color: var(--muted); }

.product-info { display: grid; gap: 3px; padding: 12px 4px 0; }
.product-name {
  display: -webkit-box;
  overflow: hidden;
  font: 600 15px/1.3 var(--font);
  letter-spacing: -0.01em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.stock { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stock::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.stock--ok { color: var(--green); }
.stock--low { color: var(--amber); }
.stock--out { color: #6f6a86; }
.bump { animation: bump .9s ease-out; }
@keyframes bump {
  0% { transform: scale(1.18); color: var(--violet-300); }
  100% { transform: none; }
}

.promo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  aspect-ratio: 1 / 1.06;
  padding: 18px;
  border-radius: var(--radius-card);
  background: radial-gradient(90% 80% at 60% 30%, #2e1b62, #0e0a1b 75%);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.promo-card img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 66% 30%;
  transform: scale(1.35);
  transform-origin: 66% 30%;
  mix-blend-mode: lighten;
}
.promo-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgb(6 5 9 / .92) 10%, transparent 64%);
}
.promo-card h3 { font-size: 19px; line-height: 1.25; }
:lang(km) .promo-card h3 { font-size: 17px; line-height: 1.5; }
.promo-card .btn { align-self: center; width: 100%; height: 38px; font-size: 13px; }

/* ---------- Bottom promo row ---------- */

.promo-row { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; }
.how-card {
  position: relative;
  padding: 36px 36px 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background-color: var(--surface);
  background-image:
    radial-gradient(60% 80% at 100% 0%, rgb(139 92 246 / .18), transparent 70%),
    linear-gradient(rgb(255 255 255 / .03) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .03) 1px, transparent 1px);
  background-size: auto, 22px 22px, 22px 22px;
  overflow: hidden;
}
.how-crown {
  position: absolute;
  top: 30px;
  right: 34px;
  width: 88px;
  height: 64px;
  color: var(--gold);
  filter: drop-shadow(0 0 22px rgb(255 197 46 / .45));
}
.eyebrow { font: 400 11px/1.2 var(--font-pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
:lang(km) .eyebrow { font-size: 13px; }
.how-card h2 { max-width: 17ch; margin-top: 12px; font-size: 34px; line-height: 1.1; letter-spacing: -0.035em; }
:lang(km) .how-card h2 { max-width: 20ch; font-size: 28px; line-height: 1.45; letter-spacing: 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 30px 0 0; padding: 0; list-style: none; }
.steps li { display: grid; gap: 12px; align-content: start; padding-top: 16px; border-top: 1px solid var(--line-2); }
.step-n { font: 400 13px/1 var(--font-pixel); color: var(--violet-300); }
.steps h3 { font-size: 16px; font-weight: 700; }
.steps p { margin-top: 5px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
:lang(km) .steps p { line-height: 1.75; }

.drop-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 34px 30px;
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 100% 0%, #6d3bf0 0%, transparent 62%),
    radial-gradient(90% 80% at 0% 100%, #3b1d7a 0%, transparent 70%),
    #140f26;
}
.drop-card h2 { font-size: 28px; line-height: 1.12; letter-spacing: -0.03em; }
:lang(km) .drop-card h2 { font-size: 24px; line-height: 1.5; letter-spacing: 0; }
.drop-card p { color: rgb(255 255 255 / .78); font-size: 14px; }
.drop-card .btn { margin-top: auto; }

/* ---------- Footer ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 64px;
  padding: 26px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.brand--small { font-size: 17px; color: var(--ink); }
.brand--small .brand-mark { width: 24px; height: 24px; border-radius: 6px; }

/* ---------- Cart drawer ---------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgb(0 0 0 / .62);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .25s;
}
.drawer {
  position: fixed;
  z-index: 41;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(440px, 100vw);
  height: 100dvh;
  border-left: 1px solid var(--line);
  background: var(--bg-raised);
  box-shadow: -20px 0 60px -20px rgb(0 0 0 / .8);
  transform: translateX(104%);
  transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
.drawer.is-open { transform: none; }
.drawer-backdrop.is-open { opacity: 1; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 21px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 26px; }

.cart-lines { display: grid; gap: 12px; margin: 0 0 18px; padding: 0; list-style: none; }
.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface);
}
.cart-line img { width: 64px; height: 64px; padding: 6px; border-radius: 12px; background: var(--glow), var(--surface-2); object-fit: contain; }
.cart-line h3 { font: 600 14px/1.3 var(--font); letter-spacing: -0.01em; }
.cart-line p { color: var(--muted); font-size: 12.5px; }
.cart-line .remove { margin-top: 2px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; }
.cart-line .remove:hover { color: var(--red); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; background: var(--field); }
.qty button { width: 30px; height: 30px; border: 0; border-radius: 999px; background: none; font-size: 16px; line-height: 1; }
.qty button:hover:not(:disabled) { background: var(--surface-3); }
.qty button:disabled { opacity: .3; cursor: not-allowed; }
.qty output { min-width: 22px; font-size: 13px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }

.cart-empty { display: grid; justify-items: center; gap: 12px; padding: 50px 0 30px; color: var(--muted); text-align: center; }
.cart-empty img { width: 64px; height: 64px; border-radius: 16px; opacity: .85; }

.checkout { display: grid; gap: 14px; }
.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 2px 14px;
  border-bottom: 1px dashed var(--line-2);
  font-weight: 600;
}
.cart-total strong { font: 800 24px/1 var(--font-display); letter-spacing: -0.02em; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; }
.field em { color: var(--muted); font-style: normal; font-weight: 400; }
.field small { color: var(--muted); font-size: 12px; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-field);
  background: var(--field);
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder, .field textarea::placeholder { color: #5f5a76; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(139 92 246 / .22); }
.field.has-error input, .field.has-error select { border-color: var(--red); box-shadow: 0 0 0 3px rgb(248 113 113 / .16); }
.form-error { padding: 10px 12px; border-radius: 10px; background: rgb(248 113 113 / .12); color: #fecaca; font-size: 13.5px; }
.fine { color: var(--muted); font-size: 12px; text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.order-done { display: grid; align-content: start; justify-items: center; gap: 14px; padding-top: 60px; text-align: center; }
.order-done h3 { font-size: 24px; }
.order-done p { max-width: 34ch; color: var(--ink-2); }
.done-badge { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--violet); color: #fff; }
.done-badge svg { width: 30px; height: 30px; }

/* KHQR payment card: stays white on the dark theme so every bank app can scan it. */
.khqr-pay { display: grid; justify-items: center; gap: 12px; width: 100%; }
.khqr-lead { font-weight: 600; }
.khqr-card { width: min(100%, 290px); margin: 0; border-radius: 18px; background: #fff; color: #111; overflow: hidden; box-shadow: var(--shadow); }
.khqr-head { padding: 10px 0 9px; background: #e1232e; color: #fff; font: 800 20px/1 var(--font-display); letter-spacing: .08em; }
.khqr-body { display: grid; gap: 2px; padding: 14px 18px 18px; }
.order-done .khqr-card p { max-width: none; }
.order-done .khqr-name { color: #555; font-size: 13px; font-weight: 600; }
.order-done .khqr-amount { padding-bottom: 12px; border-bottom: 1px dashed #d7d7d7; color: #111; font: 800 28px/1.1 var(--font-display); letter-spacing: -0.02em; }
.khqr-code { margin-top: 14px; }
.khqr-code svg { width: 100%; height: auto; }
.khqr-steps { display: grid; gap: 6px; width: 100%; margin: 0; padding: 12px 14px 12px 32px; border-radius: 14px; background: var(--surface); text-align: left; font-size: 14px; }
.khqr-steps strong { color: var(--gold); font-variant-numeric: tabular-nums; }
.order-done { padding-top: 34px; }

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 24px;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 999px;
  background: #f4f2fb;
  color: #0b0a10;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 30px -10px rgb(0 0 0 / .7);
  transform: translateX(-50%);
  animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .promo-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero-nav { padding-right: 22px; }
  .steps { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 720px) {
  :root { --gutter: 14px; }
  .hero { height: 560px; border-radius: 24px; }
  .hero-img { object-position: 74% 40%; }
  .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgb(0 0 0 / .6), transparent 45%);
    pointer-events: none;
  }
  .hero-feature { display: none; }
  .hero-stat, .hero.no-feature .hero-stat {
    top: 64px;
    left: 12px;
    right: auto;
    bottom: auto;
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgb(0 0 0 / .5);
    backdrop-filter: blur(8px);
  }
  .hero-stat strong { font-size: 17px; }
  .hero-stat span { font-size: 12px; }
  .hero-title { left: 14px; font-size: 16.5vw; }
  .hero-actions { top: 12px; right: 12px; gap: 8px; }
  .hero-actions .btn { height: 40px; padding: 0 15px; }
  .hero-nav { padding: 9px 16px 12px 2px; }
  .brand { font-size: 18px; gap: 8px; }
  .brand-mark { width: 26px; height: 26px; }

  .section { margin-top: 48px; }
  .section-head { flex-direction: column; align-items: stretch; gap: 6px; }
  .section-head h2 { font-size: 23px; }
  .section-head > div:first-child { padding-bottom: 4px; }
  .link-arrow { margin-bottom: 14px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .category h3 { font-size: 16px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .product-name { font-size: 14px; }
  .product-meta { flex-direction: column; align-items: flex-start; gap: 0; }
  .price-tag { font-size: 13px; padding-left: 10px; }
  .how-card { padding: 28px 22px; }
  .how-card h2, :lang(km) .how-card h2 { font-size: 24px; }
  .how-crown { top: 24px; right: 22px; width: 56px; height: 41px; }
  .drop-card { padding: 28px 22px; }
  .drop-card h2 { font-size: 22px; }
  .footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .hero-shop { display: none; }
}

@media (hover: none) {
  .buy-pill { opacity: 1; transform: translate(-50%, 0); }
  .product-media::after { opacity: 1; background: linear-gradient(0deg, rgb(0 0 0 / .45), transparent 40%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Admin ---------- */

.admin-page { max-width: 1100px; margin: 0 auto; padding: 22px var(--gutter) 60px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.admin-top .brand small { margin-left: 4px; color: var(--muted); font: 500 14px/1 var(--font); letter-spacing: 0; }
.admin-top-actions { display: flex; gap: 10px; }
.admin-login {
  display: grid;
  gap: 14px;
  max-width: 360px;
  margin: 12vh auto 0;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.admin-login h1 { font-size: 24px; }
.admin-login p { color: var(--muted); font-size: 14px; }
.admin-tabs { margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.admin-tabs .count { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; }
.admin-panel, .admin-orders { display: grid; gap: 14px; }
.admin-empty { padding: 40px 0; color: var(--muted); text-align: center; list-style: none; }

.order-card { display: grid; gap: 12px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.order-card.is-pending { border-color: rgb(167 139 250 / .5); box-shadow: 0 0 0 3px rgb(124 58 237 / .12); }
.order-card header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.order-card header h3 { font: 700 16px/1 var(--font); letter-spacing: 0; }
.order-card time { color: var(--muted); font-size: 13px; }
.status { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.status--pending { background: rgb(139 92 246 / .18); color: var(--violet-300); }
.status--completed { background: rgb(52 211 153 / .14); color: #6ee7b7; }
.status--cancelled { background: rgb(255 255 255 / .06); color: var(--muted); }
.order-who { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.order-who span { color: var(--muted); }
.order-who a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.order-who em { color: var(--muted); font-style: normal; }
.order-items { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.order-items li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line-2); }
.order-items li:last-child { border-bottom: 0; font-weight: 700; }
.order-note { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.order-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.add-item { display: grid; grid-template-columns: 2fr 1fr 1fr auto; align-items: end; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.add-item .btn { height: 44px; }
.inv-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.inv-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 120px 150px 120px 36px;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.inv-row img { width: 56px; height: 56px; padding: 4px; border-radius: 12px; background: var(--glow), var(--surface-2); object-fit: contain; }
.inv-row h3 { overflow: hidden; font: 600 14.5px/1.3 var(--font); letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.inv-row .inv-sub { color: var(--muted); font-size: 12.5px; }
.inv-row .saved { color: var(--green); }
.inv-row input, .inv-row select { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--field); font-size: 14px; }
.inv-row label, .inv-row .ctl { display: grid; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.stepper { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; height: 38px; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.stepper button { height: 100%; border: 0; background: var(--surface-2); color: var(--ink); font-size: 17px; }
.stepper button:hover { background: var(--surface-3); }
.stepper input { height: 100%; border: 0; border-radius: 0; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-row .delete { width: 36px; height: 36px; background: none; color: var(--muted); }
.inv-row .delete:hover { background: rgb(248 113 113 / .12); color: var(--red); }

@media (max-width: 860px) {
  .add-item { grid-template-columns: 1fr 1fr; }
  .add-item .field:first-child, .add-item .btn { grid-column: 1 / -1; }
  .inv-row { grid-template-columns: 56px minmax(0, 1fr) 36px; }
  .inv-row .inv-controls { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
}
@media (min-width: 861px) {
  .inv-row .inv-controls { display: contents; }
}
