:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #121923;
  --panel-soft: #172231;
  --line: #253247;
  --text: #eef4f8;
  --muted: #8ea0b5;
  --accent: #56d6c2;
  --accent-strong: #78f0d4;
  --danger: #ff7373;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(86, 214, 194, 0.11), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 16px 12px 92px;
}

.view {
  display: none;
}

.view-active {
  display: block;
}

.topbar {
  padding: 10px 2px 14px;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(1.45rem, 7vw, 2.05rem);
  line-height: 1.05;
}

h2 {
  font-size: 1.35rem;
}

.search {
  display: block;
  margin-bottom: 12px;
}

.search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 25, 35, 0.96);
  color: var(--text);
  padding: 0 15px;
  outline: none;
}

.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(86, 214, 194, 0.14);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 0.87rem;
}

.product-list,
.cart-list {
  display: grid;
  gap: 9px;
}

.product-card,
.cart-card,
.empty-state,
.cart-total,
.group-card,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 25, 35, 0.95);
  box-shadow: var(--shadow);
}

.product-card,
.cart-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.product-main,
.cart-main {
  min-width: 0;
}

.product-title,
.cart-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.product-meta,
.cart-subline,
.group-meta {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.product-price,
.cart-line-total {
  color: var(--accent-strong);
  font-weight: 820;
}

.group-card {
  overflow: hidden;
}

.group-toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 13px;
  text-align: left;
  cursor: pointer;
}

.group-title {
  font-size: 1rem;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.group-chevron {
  color: var(--accent);
  font-size: 1.2rem;
  align-self: center;
}

.group-products {
  display: grid;
  gap: 8px;
  padding: 0 9px 9px;
}

.quantity-row {
  display: grid;
  grid-template-columns: 46px minmax(56px, 1fr) 46px;
  gap: 8px;
  align-items: center;
}

.quantity-row button,
.quantity-input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: center;
}

.quantity-row button {
  cursor: pointer;
  font-size: 1.22rem;
  font-weight: 850;
}

.quantity-row button:active {
  transform: translateY(1px);
}

.quantity-input {
  width: 100%;
  appearance: textfield;
  font-weight: 850;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.page-header {
  padding: 10px 2px 14px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 13px 0 12px;
  padding: 14px;
}

.primary-action,
.secondary-action,
.empty-action {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 850;
  cursor: pointer;
}

.primary-action {
  border: 0;
  background: linear-gradient(135deg, var(--accent), #9cf6da);
  color: #07120f;
}

.primary-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.secondary-action,
.empty-action {
  border: 1px solid rgba(86, 214, 194, 0.35);
  background: rgba(86, 214, 194, 0.1);
  color: var(--text);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin: 0 0 14px;
}

.notice {
  margin: 12px 0;
  padding: 14px;
  color: var(--accent-strong);
  font-weight: 760;
  text-align: center;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(37, 50, 71, 0.9);
  background: rgba(11, 15, 20, 0.96);
  backdrop-filter: blur(16px);
}

.nav-item {
  position: relative;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
}

.nav-item.active {
  border-color: rgba(86, 214, 194, 0.35);
  background: rgba(86, 214, 194, 0.14);
  color: var(--text);
}

.badge {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #07120f;
  font-size: 0.74rem;
  font-weight: 900;
}

.badge[hidden] {
  display: none;
}

@media (min-width: 600px) {
  .product-card,
  .cart-card {
    grid-template-columns: 1fr 190px;
    align-items: center;
  }
}

.checkout-form {display:grid;gap:14px;}
.checkout-form label {display:grid;gap:6px;}
.checkout-form input,.checkout-form select {width:100%;box-sizing:border-box;min-height:46px;border:1px solid #34445b;border-radius:8px;padding:12px;background:var(--bg);color:var(--text);font:inherit;}
#checkout-review,#checkout-success {margin:20px 0;padding:16px;border:1px solid #34445b;border-radius:10px;overflow-wrap:anywhere;}
#checkout-error {color:#ff9999;}
#checkout-success a {color:var(--accent);}

.availability-note.unavailable {display:inline-block;padding:6px 10px;margin:6px 0;border:1px solid #a05a35;border-radius:6px;background:#39291f;color:#ffc49e;font-weight:700;}


.checkout-intro {color:var(--muted);line-height:1.6;margin:0 0 24px;}
.checkout-form {display:grid;gap:24px;}
.checkout-section {min-width:0;margin:0;padding:20px;border:1px solid #34445b;border-radius:12px;background:rgba(22,30,43,.55);}
.checkout-section legend {padding:0 8px;font-size:1.1rem;font-weight:800;}
.checkout-step {display:inline-grid;place-items:center;width:28px;height:28px;margin-right:8px;border-radius:50%;background:var(--accent);color:#07120f;font-size:.85rem;}
.checkout-fields {display:grid;gap:18px;}
.checkout-section label {display:flex;flex-direction:column;gap:8px;font-size:.95rem;font-weight:600;}
.checkout-address-row {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:16px;}
.checkout-form input,.checkout-form select {display:block;width:100%;min-width:0;min-height:50px;background:#0c121c;color:var(--text);border:1px solid #435269;border-radius:8px;padding:12px;font-size:1rem;font-weight:400;}
.checkout-form input:focus,.checkout-form select:focus {outline:2px solid var(--accent);outline-offset:2px;}
.checkout-form input::placeholder {color:#8898ad;}
.field-optional {color:var(--muted);font-weight:400;font-size:.8rem;}
.checkout-shipping-note {margin:16px 0 0;padding:12px;text-align:left;font-size:.85rem;line-height:1.5;}
.checkout-next p {margin:0 0 12px;color:var(--muted);font-size:.9rem;line-height:1.5;}
.checkout-next .primary-action {margin:0;}
@media(max-width:380px) {.checkout-section {padding:16px;}.checkout-address-row {grid-template-columns:1fr;}}
