:root {
  --bg: #07080c;
  --ink: #eef3f0;
  --muted: rgba(238, 243, 240, 0.62);
  --faint: rgba(238, 243, 240, 0.38);
  --line: rgba(210, 236, 228, 0.16);
  --glass: rgba(18, 22, 30, 0.58);
  --ice: #9ce8d2;
  --ice-dim: rgba(156, 232, 210, 0.14);
  --amber: #d7b08a;
  --violet: #b7a6e8;
  --danger: #ef9a9a;
  --ink-on-ice: #07110e;
  --radius: 20px;
  --radius-sm: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --wrap: 1080px;
  --ring: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --ring-ice: inset 0 0 0 1px rgba(156, 232, 210, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
html, body { min-height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: Manrope, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: -0.011em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button { cursor: pointer; }
:focus-visible {
  outline: 2px solid rgba(156, 232, 210, 0.55);
  outline-offset: 3px;
}

.haze {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 12% -8%, rgba(110, 210, 185, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 45% at 108% 4%, rgba(90, 110, 180, 0.22), transparent 50%),
    radial-gradient(ellipse 60% 40% at 70% 110%, rgba(180, 130, 80, 0.1), transparent 50%),
    var(--bg);
}
.haze::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 30% 20%, rgba(156, 232, 210, 0.08), transparent 36%);
  animation: haze-drift 18s var(--ease) infinite alternate;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding-bottom: calc(92px + var(--safe-b));
}
#app:has(.gate) { padding-bottom: 0; }

.glass {
  position: relative;
  background: linear-gradient(180deg, rgba(32, 38, 50, 0.55), rgba(14, 17, 24, 0.5));
  border-radius: var(--radius);
  box-shadow: var(--ring);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
}

.wrap { width: min(var(--wrap), 100%); margin: 0 auto; padding: 12px 16px 8px; }

.wordmark {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 600;
  font-size: 36px;
  font-optical-sizing: auto;
  letter-spacing: -0.04em;
  line-height: 0.95;
}
.wordmark span { color: var(--ice); }
.wordmark.sm { font-size: 24px; }

.kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.lead { color: var(--muted); font-size: 15px; line-height: 1.55; margin-top: 10px; }

.view-in { animation: rise 0.48s var(--ease) both; }
.view-in .sku {
  animation: rise 0.52s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 10) * 38ms);
}

.gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: var(--safe-t) 0 24px;
}
.gate .wrap { width: min(520px, 100%); }
.gate .panel { padding: 32px 24px 26px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.2s var(--ease), background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.975); }
.btn[disabled] { opacity: 0.38; pointer-events: none; }
.btn-ice {
  background: var(--ice);
  color: var(--ink-on-ice);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 8px 24px rgba(156, 232, 210, 0.16);
}
.btn-ghost {
  color: var(--muted);
  box-shadow: var(--ring);
}
.btn-glass {
  background: var(--ice-dim);
  color: var(--ice);
  box-shadow: var(--ring-ice);
}
.btn-block { width: 100%; }
.row-btns { display: flex; gap: 10px; margin-top: 22px; }
.row-btns .btn { flex: 1; }

.shop-hdr {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -12px -16px 14px;
  padding: calc(10px + var(--safe-t)) 16px 12px;
  background: rgba(7, 8, 12, 0.72);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}
.shop-hdr .kicker { margin: 0 0 4px; }

.cart-pill,
.back,
.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  box-shadow: var(--ring);
  background: rgba(16, 20, 28, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease, color 0.2s ease;
}
.cart-pill { padding: 0 8px 0 14px; }
.cart-pill b {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ice);
  color: var(--ink-on-ice);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.copy { color: var(--ice); font-size: 12px; letter-spacing: 0.02em; }

.channel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  margin: 10px 0 6px;
}
.channel .lead { color: var(--muted); }

.pickup {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 6px;
}
.pickup-addr { font-size: 14px; line-height: 1.4; }
.pickup-slots {
  color: var(--ice);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.shop-count {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.06em;
  margin: 4px 0 10px;
}

.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 16px 14px;
  margin: 0 -16px;
  scrollbar-width: none;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll .chip { flex-shrink: 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--ring);
  background: transparent;
  transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, transform 0.2s var(--ease);
}
.chip.on {
  color: var(--ice);
  background: var(--ice-dim);
  box-shadow: var(--ring-ice);
}
.chip.full { opacity: 0.38; }
.chip[disabled] { opacity: 0.3; }

.sku-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.sku-grid .empty { grid-column: 1 / -1; }

.sku {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 12px 48px;
  min-height: 0;
  text-align: left;
  color: inherit;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.28s var(--ease), box-shadow 0.28s ease;
}
.sku-art {
  position: relative;
  height: 76px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--sw, #9ce8d2) 22%, #10141c);
}
.sku-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sku-art .sku-real,
.detail .hero .sku-real {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.sku-art .sku-real.on,
.detail .hero .sku-real.on { opacity: 1; }
.sku-swatch { display: none; }
.sku h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sku-meta {
  color: var(--faint);
  font-size: 11px;
  margin: 8px 0 10px;
  line-height: 1.4;
}
.sku-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
}
.sku .price { font-size: 16px; font-weight: 600; }
.sku .avail { font-size: 11px; margin: 0; }
.sku-add {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ice);
  color: var(--ink-on-ice);
  font-size: 20px;
  font-weight: 500;
  line-height: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 6px 16px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s var(--ease);
}
.sku-add[disabled] { opacity: 0.28; pointer-events: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  padding: 16px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  width: 100%;
  transition: transform 0.28s var(--ease);
}
.card h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--muted);
  box-shadow: var(--ring);
}
.price { font-size: 20px; font-weight: 600; color: var(--ice); letter-spacing: -0.03em; }
.avail { color: var(--faint); font-size: 12px; margin-top: 4px; }
.avail.out { color: var(--danger); }

.detail-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.detail-top { display: grid; gap: 10px; }
.detail .hero {
  height: 140px;
  margin-bottom: 4px;
  position: relative;
  overflow: hidden;
}
.detail .hero img { width: 100%; height: 100%; object-fit: contain; position: relative; z-index: 1; }
.detail .hero .sku-real { z-index: 2; object-fit: cover; }
.blob {
  position: absolute;
  inset: -18%;
  filter: blur(8px);
  opacity: 0.85;
  animation: haze-drift 12s ease-in-out infinite alternate;
}

.stars { display: flex; gap: 6px; margin-top: 10px; }
.stars button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--ink);
  box-shadow: var(--ring);
  background: rgba(16, 20, 28, 0.35);
  transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease);
}
.review-note { margin-top: 10px; min-height: 72px; resize: vertical; }
.queue-slot { margin: 16px 0 8px; }
a.tg { color: var(--ice); text-decoration: none; }
.related { margin-top: 22px; }
.related .kicker { margin-bottom: 10px; }

.qty {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
}
.qty b { min-width: 1.5em; text-align: center; font-variant-numeric: tabular-nums; }
.round {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 20px;
  font-weight: 500;
  line-height: 0;
  box-shadow: var(--ring);
  background: rgba(16, 20, 28, 0.35);
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease;
}
.round:active, .sku-add:active, .chip:active, .cart-pill:active, .back:active, .copy:active {
  transform: scale(0.94);
}

.nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-b));
  width: auto;
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  z-index: 5;
}
.nav.admin { grid-template-columns: repeat(5, 1fr); }
.nav button {
  min-height: 44px;
  padding: 0 4px;
  border-radius: 14px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.22s ease, background 0.22s ease;
}
.nav button.on { color: var(--ice); background: var(--ice-dim); }

.line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 7px 0;
  color: var(--muted);
  font-size: 14px;
}
.total { color: var(--ink); font-size: 18px; font-weight: 600; margin-top: 8px; }

.toast {
  position: fixed;
  left: 50%;
  top: calc(14px + var(--safe-t));
  z-index: 20;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  max-width: min(90%, 420px);
  animation: toast-in 0.36s var(--ease) both;
}
.toast.ok { background: rgba(16, 40, 36, 0.92); color: var(--ice); box-shadow: var(--ring-ice); }
.toast.err { background: rgba(56, 18, 22, 0.92); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(239, 154, 154, 0.28); }

.search, .field {
  width: 100%;
  min-height: 44px;
  color: var(--ink);
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: var(--ring);
  transition: box-shadow 0.2s ease;
}
.search { margin: 0 0 12px; }
.search:focus, .field:focus { box-shadow: var(--ring-ice); }
.field {
  margin-top: 12px;
  border-radius: 16px;
  padding: 12px 14px;
  min-height: 46px;
}
select.field { cursor: pointer; }

.card.low { box-shadow: inset 0 0 0 1px rgba(215, 176, 138, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.card.off, .line.off { opacity: 0.48; }
.sku.out { opacity: 0.55; }
.sku.low { box-shadow: inset 0 0 0 1px rgba(215, 176, 138, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08); }

.receipt { padding: 22px 18px; margin-top: 8px; }
.receipt .code {
  font-size: 28px;
  letter-spacing: 0.14em;
  font-weight: 600;
  margin: 8px 0 12px;
}
.steps { margin-top: 14px; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.loyalty { padding: 16px; margin-top: 12px; }
.bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin-top: 10px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--ice);
  border-radius: 999px;
  transition: width 0.6s var(--ease);
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 4px 0 14px;
}
.admin-tabs .chip { padding: 0 4px; font-size: 12px; min-height: 40px; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.stat { padding: 16px; }
.stat .n { font-size: 22px; font-weight: 600; color: var(--ice); margin-top: 6px; letter-spacing: -0.03em; }
.stat .l { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

.queue-when { color: var(--ice); font-size: 15px; font-weight: 500; margin: 4px 0 8px; }
.low-flag { color: var(--amber); font-size: 12px; }
.stock-row { display: flex; gap: 8px; margin-top: 10px; }
.stock-row .btn { flex: 1; min-height: 40px; padding: 0 8px; font-size: 13px; }

.qty-mini {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
}

.cart-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  cursor: default;
  padding: 12px;
}
.cart-row .sku-art { height: 76px; margin: 0; }
.cart-row h3[data-open] { cursor: pointer; }
.cart-row .qty { margin: 10px 0 0; }
.stock-edit { margin-top: 12px; }
.field.tight { margin-top: 8px; min-height: 42px; padding: 8px 12px; }
.stock-edit .stock-row .field { flex: 1; margin-top: 0; }

.empty { color: var(--muted); padding: 28px 8px; text-align: center; }

.order { padding: 16px; margin-bottom: 12px; }
.order header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.status {
  color: var(--ice);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes haze-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4%, 3%, 0) scale(1.06); }
}

@media (hover: hover) and (pointer: fine) {
  .sku:hover { transform: translateY(-3px); }
  .sku-add:hover, .btn-ice:hover { filter: brightness(1.04); }
  .btn-ghost:hover, .btn-glass:hover,
  .chip:hover, .back:hover, .cart-pill:hover, .copy:hover, .round:hover, .stars button:hover {
    box-shadow: var(--ring-ice);
    color: var(--ice);
  }
  .nav button:hover { color: var(--ink); }
}

@media (min-width: 720px) {
  .sku-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sku { padding: 14px 14px 50px; }
  .sku h3 { font-size: 15px; }
  .sku-art { height: 92px; }
  .detail-top {
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 8px;
  }
  .detail .hero { height: 240px; margin: 0; }
}
@media (min-width: 980px) {
  .sku-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .haze::after, .blob, .view-in, .view-in .sku, .toast { animation: none; }
  .sku, .btn, .chip, .card, .bar > i { transition: none; }
}
