:root {
  --bg: #14100c;
  --bg-2: #1d1611;
  --card: #251b15;
  --card-2: #2d221a;
  --line: #463125;
  --text: #f7ede2;
  --muted: #b8a08b;
  --accent: #c9762f;
  --accent-2: #a85a22;
  --accent-soft: rgba(201, 118, 47, 0.16);
  --green: #1f4d3c;
  --green-line: #2f6b53;
  --green-soft: rgba(31, 77, 60, 0.28);
  --cream: #f3e7d6;
  --radius: 14px;
  --serif: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(220px 160px at 8% 4%, rgba(201, 118, 47, 0.16), transparent 72%),
    radial-gradient(260px 200px at 92% 18%, rgba(31, 77, 60, 0.22), transparent 74%),
    radial-gradient(320px 240px at 40% 96%, rgba(120, 72, 40, 0.20), transparent 76%),
    repeating-linear-gradient(102deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 14px);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 16px 14px 28px;
  max-width: 560px;
  margin: 0 auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.brand { display: flex; align-items: center; gap: 11px; }

.brand-mark {
  width: 44px;
  height: 44px;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.01em;
  color: var(--cream);
}
.brand-sub {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cart-btn {
  border: 1px solid var(--green-line);
  border-radius: 12px;
  padding: 9px 13px;
  background: var(--green-soft);
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 15px;
  background: var(--card-2);
  color: #ddc9b6;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tab.active {
  background: linear-gradient(160deg, #27604b, var(--green));
  border-color: var(--green-line);
  color: var(--cream);
}

.screen { margin-top: 14px; }

.back {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 2px 10px;
  letter-spacing: 0.02em;
}

.list { display: grid; gap: 8px; }

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-2), #271d16);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--text);
  font: inherit;
}
.list-item:active { border-color: var(--accent); }
.list-emoji {
  width: 42px; height: 42px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(201, 118, 47, 0.22);
  font-size: 21px;
}
.list-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.list-text b { font-size: 15px; font-family: var(--serif); letter-spacing: 0.01em; }
.list-text small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.list-price { color: var(--accent); font-size: 13px; font-weight: 700; flex: 0 0 auto; }

.cart-list { display: grid; gap: 10px; }

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed rgba(184, 160, 139, 0.18);
  padding-bottom: 10px;
}
.cart-item:last-child { border-bottom: 0; }
.cart-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-info b { font-size: 15px; }
.cart-info small { color: var(--muted); font-size: 12px; }

.cart-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.mini {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}
.mini-del { color: #e5a08c; border-color: rgba(229, 160, 140, 0.35); }

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.cart-total b { color: var(--accent); font-size: 19px; }

.card {
  background: linear-gradient(180deg, #2a1f18, var(--card));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.product-head { display: flex; gap: 14px; align-items: flex-start; }

.product-photo {
  width: 88px; height: 104px;
  flex: 0 0 auto;
  border-radius: 13px;
  background:
    radial-gradient(60px 42px at 50% 22%, rgba(201, 118, 47, 0.34), transparent 72%),
    linear-gradient(158deg, #3a2a20, #241a14);
  box-shadow: inset 0 0 0 1px rgba(255, 226, 198, 0.10);
  display: grid; place-items: center;
  font-size: 38px;
  overflow: hidden;
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; }

.product-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin: 2px 0 4px;
  letter-spacing: 0.01em;
}
.product-desc { color: var(--muted); font-size: 13px; line-height: 1.45; }
.product-price { color: var(--accent); font-size: 15px; font-weight: 700; margin-top: 7px; }

.group { margin-top: 18px; }
.group-name {
  color: var(--cream);
  opacity: 0.85;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 9px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(184, 160, 139, 0.22);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: #e7d7c6;
  border-radius: 11px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.chip small { color: var(--muted); font-weight: 600; }
.chip.active {
  background: linear-gradient(160deg, #27604b, var(--green));
  border-color: var(--green-line);
  color: var(--cream);
}
.chip.active small { color: #bcd3c6; }

.chip-size { min-width: 88px; flex-direction: column; gap: 2px; padding: 10px 12px; }
.chip-size b { font-size: 15px; }
.chip-size small { font-size: 11px; }

.buy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.stepper button {
  width: 44px; height: 48px;
  border: 0;
  background: transparent;
  color: var(--cream);
  font-size: 20px;
  font-weight: 600;
}
.stepper span { min-width: 26px; text-align: center; font-weight: 700; }

.btn {
  border: 0;
  border-radius: 13px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  width: 100%;
}
.btn-primary {
  background: linear-gradient(160deg, #d8873c, var(--accent-2));
  color: #2a1708;
  box-shadow: 0 10px 22px rgba(168, 90, 34, 0.28), inset 0 1px 0 rgba(255, 240, 220, 0.35);
}
.btn-ghost {
  background: var(--card-2);
  color: var(--cream);
  border: 1px solid var(--green-line);
}
.btn:disabled { opacity: 0.65; }

.buy-row .btn-primary { flex: 1 1 auto; width: auto; }

.progress { display: flex; gap: 6px; margin: 16px 0 12px; }
.progress-step {
  flex: 1 1 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.progress-step::before {
  content: "";
  display: block;
  height: 4px;
  border-radius: 3px;
  background: #3a2c22;
  margin-bottom: 7px;
}
.progress-step.done::before { background: linear-gradient(90deg, #2f6b53, var(--green)); }
.progress-step.done { color: #d8c7ae; }

.status-head { font-family: var(--serif); font-size: 21px; font-weight: 700; }
.status-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.status-lines { margin-top: 14px; display: grid; gap: 7px; font-size: 14px; }
.status-lines .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px dashed rgba(184, 160, 139, 0.16);
}
.status-lines .row:last-child { border-bottom: 0; font-weight: 700; color: var(--accent); }
.status-lines .row span:first-child { color: var(--muted); }
.status-lines .row:last-child span:first-child { color: var(--cream); }

.error {
  background: rgba(168, 60, 40, 0.18);
  border: 1px solid rgba(214, 106, 78, 0.45);
  color: #f0c0b2;
  border-radius: 13px;
  padding: 12px 14px;
  font-size: 14px;
}

.skeleton { color: var(--muted); font-size: 14px; padding: 24px 4px; }

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 4, 0.76);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 10;
}
.sheet[hidden] { display: none; }
.sheet-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #2e2319, var(--card));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.sheet-title { font-family: var(--serif); font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.sheet-body { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 16px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
