:root {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #151515;
  --surface-2: #1a1a1a;
  --line: #303030;
  --text: #f2f2f2;
  --muted: #a1a1a1;
  --accent: #ff3830;
  --success: #21c45d;
  --radius: 18px;
  --ease: 180ms ease;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100dvh; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
button { touch-action: manipulation; }
button, input, textarea { outline: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible { box-shadow: 0 0 0 3px rgba(255, 56, 48, .38); }
.hidden { display: none !important; }
.shell { width: min(100% - 32px, 1120px); margin-inline: auto; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: #b9b9b9; font-size: 12px; font-weight: 650; letter-spacing: .13em; }

.topbar, .admin-topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.logo { width: 154px; height: 50px; object-fit: contain; }
.topbar-actions { display: flex; gap: 8px; }
.icon-button { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background var(--ease), border-color var(--ease); }
.icon-button:hover { background: #242424; border-color: #555; }
.cart-button { position: relative; }
.cart-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border: 2px solid var(--bg); border-radius: 999px; background: var(--accent); color: white; font-size: 11px; font-weight: 800; }

.hero { padding-block: 72px 58px; }
.hero .eyebrow { color: var(--text); }
.hero .eyebrow span { display: inline-block; width: 22px; height: 2px; margin: 0 6px 3px 0; background: var(--accent); }
.hero h1 { margin: 0; max-width: 780px; font-size: clamp(52px, 13vw, 126px); line-height: 1.02; letter-spacing: -.065em; font-weight: 900; font-style: italic; }
.hero-copy { max-width: 520px; margin: 30px 0 0; color: #b8b8b8; font-size: 17px; line-height: 1.55; }

.catalog { padding-bottom: 80px; }
.section-heading, .admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading h2, .admin-heading h1 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.counter { min-width: 40px; height: 40px; padding-inline: 12px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-variant-numeric: tabular-nums; }
.search { height: 54px; margin-bottom: 24px; padding-inline: 16px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; background: #111; color: var(--muted); transition: border-color var(--ease); }
.search:focus-within { border-color: #777; }
.search input { width: 100%; border: 0; background: none; color: var(--text); font-size: 16px; }
.search input::placeholder { color: #777; }

.product-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.product-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: border-color var(--ease), transform var(--ease); }
.product-card:hover { border-color: #4a4a4a; transform: translateY(-2px); }
.product-image { position: relative; aspect-ratio: 4 / 3; background: radial-gradient(circle at 50% 45%, #2d2d2d, #151515 64%); overflow: hidden; }
.product-image::after { content: "HASBULLS"; position: absolute; right: 12px; bottom: 10px; color: rgba(255,255,255,.14); font-size: 11px; font-weight: 800; font-style: italic; letter-spacing: .08em; }
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-content { padding: 18px; }
.product-content h3 { margin: 0 0 9px; font-size: 20px; line-height: 1.15; letter-spacing: -.02em; }
.product-price { margin: 0 0 12px; font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.product-description { margin: 0; color: var(--muted); line-height: 1.5; white-space: pre-line; }
.stock { margin-top: 18px; display: flex; align-items: center; gap: 8px; color: var(--success); font-size: 14px; font-weight: 600; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(33,196,93,.12); }
.stock.out { color: #ff6b65; }
.add-cart { width: 100%; margin-top: 18px; }
.empty { grid-column: 1 / -1; min-height: 260px; padding: 42px 24px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed #383838; border-radius: var(--radius); color: var(--muted); }
.empty svg { width: 38px; height: 38px; margin-bottom: 14px; color: #666; }
.empty h3 { margin: 0 0 6px; color: var(--text); }
.empty p { margin: 0; }

.footer { min-height: 140px; padding-block: 34px calc(34px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); }
.footer img { width: 150px; height: 48px; object-fit: contain; opacity: .48; }
.footer p { margin: 0; color: #666; font-size: 12px; line-height: 1.5; letter-spacing: .08em; text-align: right; }

.btn { min-height: 48px; padding: 12px 18px; border-radius: 13px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 650; cursor: pointer; transition: background var(--ease), color var(--ease), border-color var(--ease), opacity var(--ease); }
.btn:disabled { opacity: .45; cursor: wait; }
.btn-primary { background: var(--text); color: #0d0d0d; }
.btn-primary:hover { background: #d9d9d9; }
.btn-secondary { background: transparent; color: var(--text); border-color: #595959; }
.btn-secondary:hover { background: var(--surface-2); }

.choice { position: fixed; inset: 0; z-index: 100; padding: 24px; display: grid; place-items: center; background: rgba(0,0,0,.84); backdrop-filter: blur(16px); }
.choice-card { width: min(100%, 470px); padding: 34px; border: 1px solid #393939; border-radius: 24px; background: linear-gradient(145deg, #1b1b1b, #101010); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.choice-logo { width: 190px; height: 60px; margin-bottom: 44px; object-fit: contain; }
.choice-card h1 { margin: 0 0 10px; font-size: 36px; letter-spacing: -.04em; }
.choice-card .muted { margin: 0; line-height: 1.5; }
.choice-actions { margin-top: 28px; display: grid; gap: 10px; }

.admin-topbar { margin-bottom: 54px; }
.back-button { min-height: 44px; padding: 0; display: flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--text); cursor: pointer; }
.back-button svg { transform: rotate(180deg); }
.admin-badge { padding: 7px 10px; border-radius: 7px; background: var(--accent); color: white; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.admin-main { padding-bottom: 80px; }
.admin-tabs { margin-bottom: 34px; padding: 4px; display: inline-flex; gap: 4px; border: 1px solid var(--line); border-radius: 13px; background: #111; }
.admin-tab { min-height: 44px; padding: 8px 16px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 650; cursor: pointer; }
.admin-tab.active { background: var(--text); color: var(--bg); }
.admin-tab span { margin-left: 5px; }
.admin-heading { align-items: flex-end; margin-bottom: 34px; }
.admin-heading h1 { font-size: clamp(42px, 8vw, 72px); }
.admin-heading .muted { margin-bottom: 0; }
.admin-products { display: grid; gap: 12px; }
.admin-product { display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.admin-product img { width: 112px; height: 88px; border-radius: 10px; object-fit: cover; background: #222; }
.admin-product h3 { margin: 0 0 6px; font-size: 18px; }
.admin-product p { margin: 0; color: var(--muted); font-size: 14px; }
.admin-actions { display: flex; gap: 8px; }
.admin-actions .icon-button.delete { color: #ff6b65; }
.admin-orders { display: grid; gap: 12px; }
.order-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.order-header, .order-total { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.order-header h3 { margin: 0 0 5px; font-size: 19px; }
.order-header p, .order-card time { margin: 0; color: var(--muted); font-size: 13px; }
.order-status { padding: 6px 9px; border-radius: 999px; background: rgba(33,196,93,.12); color: var(--success); font-size: 12px; font-weight: 700; white-space: nowrap; }
.order-items { margin: 18px 0; padding: 14px 0; display: grid; gap: 10px; border-block: 1px solid var(--line); }
.order-item { display: flex; justify-content: space-between; gap: 16px; color: #d0d0d0; font-size: 14px; }
.order-item small { max-width: 640px; margin-top: 5px; display: block; color: var(--muted); line-height: 1.45; }
.order-item strong { white-space: nowrap; }
.order-total { align-items: center; }
.order-total strong { font-size: 20px; }

.product-dialog { width: min(calc(100% - 24px), 620px); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid #404040; border-radius: 22px; background: #121212; color: var(--text); box-shadow: 0 30px 90px #000; }
.product-dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(8px); }
.product-dialog form { padding: 24px; display: grid; gap: 18px; }
.cart-panel { padding: 24px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.dialog-heading h2 { margin: 0; font-size: 27px; }
.product-dialog label { display: grid; gap: 8px; color: #d0d0d0; font-size: 14px; font-weight: 600; }
.product-dialog input, .product-dialog textarea { width: 100%; min-height: 48px; padding: 13px 14px; border: 1px solid #3b3b3b; border-radius: 11px; background: #1b1b1b; color: var(--text); font-size: 16px; resize: vertical; }
.product-dialog input[type="file"] { padding: 10px; }
.product-dialog small { color: #777; font-weight: 400; }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 6px; }
.cart-items { margin-top: 20px; display: grid; gap: 10px; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.cart-item img { width: 64px; height: 64px; border-radius: 9px; object-fit: cover; }
.cart-item h3 { margin: 0 0 5px; font-size: 15px; }
.cart-item p { margin: 0; color: var(--muted); font-size: 13px; }
.quantity-control { display: flex; align-items: center; gap: 4px; }
.quantity-control button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #202020; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.quantity-control span { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-summary { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.cart-summary > div { margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.cart-summary strong { font-size: 24px; }
.cart-summary .btn { width: 100%; }
.cart-summary p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; text-align: center; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); padding: 13px 18px; border: 1px solid #3b3b3b; border-radius: 12px; background: #f2f2f2; color: #111; font-weight: 650; box-shadow: 0 16px 42px rgba(0,0,0,.42); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity var(--ease), transform var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--accent); color: white; border-color: var(--accent); }

@media (min-width: 640px) {
  .shell { width: min(100% - 48px, 1120px); }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .hero { padding-block: 100px 76px; }
}

@media (min-width: 980px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .product-content { min-height: 240px; display: flex; flex-direction: column; }
  .stock { margin-top: auto; padding-top: 20px; }
}

@media (max-width: 640px) {
  .hero { overflow: hidden; }
  .admin-heading { align-items: stretch; flex-direction: column; }
  .admin-heading .btn { width: 100%; }
  .admin-product { grid-template-columns: 82px 1fr; gap: 12px; }
  .admin-product img { width: 82px; height: 82px; }
  .admin-actions { grid-column: 1 / -1; }
  .admin-actions .icon-button { flex: 1; border-radius: 12px; }
  .choice-card { padding: 26px; }
  .choice-logo { margin-bottom: 32px; }
  .cart-item { grid-template-columns: 56px 1fr; }
  .cart-item img { width: 56px; height: 56px; }
  .quantity-control { grid-column: 1 / -1; justify-content: flex-end; }
  .order-total { align-items: stretch; flex-direction: column; }
  .order-total .btn { width: 100%; }
}

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