:root {
  color-scheme: dark;
  --bg: #0b0f17;
  --surface: #141b26;
  --surface-strong: #1b2432;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f7f8fb;
  --muted: #8993a4;
  --accent: #8b68ff;
  --accent-soft: rgba(139, 104, 255, 0.17);
  --danger: #ff6b7a;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 90% -10%, rgba(116, 77, 255, 0.18), transparent 32rem),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.app-header {
  width: min(100% - 32px, 1080px);
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { font-size: 22px; font-weight: 900; letter-spacing: -0.06em; }
.brand span { color: var(--accent); }

.header-user { display: flex; align-items: center; gap: 10px; }
.header-user__name {
  max-width: 130px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
}

.profile-button svg, .bottom-nav svg, .search svg, .back-link svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-shell {
  width: min(100% - 32px, 1080px);
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding-bottom: 112px;
}

.catalog-hero { padding: 28px 0 26px; }
.eyebrow, .product-info__category {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.catalog-hero h1, .product-info h1 {
  margin: 0;
  font-size: clamp(34px, 8vw, 56px);
  line-height: .98;
  letter-spacing: -.055em;
}

.catalog-hero > p:last-child { margin: 12px 0 0; color: var(--muted); }

.search {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
.search input::placeholder { color: #6f7989; }

.category-strip {
  display: flex;
  gap: 8px;
  margin: 18px -16px 30px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-strip::-webkit-scrollbar { display: none; }

.category-chip {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(20, 27, 38, .72);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.category-chip span { margin-left: 5px; opacity: .6; }
.category-chip--active { border-color: var(--accent); background: var(--accent); color: white; }

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0 0 16px;
}
.section-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.section-heading span { color: var(--muted); font-size: 13px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 12px;
}

.product-card { min-width: 0; display: flex; flex-direction: column; }
.product-card__image {
  position: relative;
  aspect-ratio: 1 / 1.13;
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: 18px;
  background: var(--surface);
}
.product-card__image::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: inherit;
  pointer-events: none;
}
.product-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product-card:hover img { transform: scale(1.025); }
.discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.product-card__category { color: var(--muted); font-size: 11px; }
.product-card strong { margin: 4px 0 8px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.product-card__prices { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 13px; }
.product-card__prices b { color: var(--text); }
.product-card__prices del { color: #687282; }

.empty-state {
  padding: 54px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  text-align: center;
}
.empty-state span { font-size: 20px; font-weight: 800; }
.empty-state p { max-width: 360px; margin: 8px auto 20px; color: var(--muted); line-height: 1.55; }
.empty-state a { color: var(--accent); font-weight: 700; }

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 12px;
  height: 70px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 520px;
  margin: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(20, 27, 38, .92);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .42);
  backdrop-filter: blur(18px);
}
.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: #707b8c;
  font-size: 10px;
}
.bottom-nav__item svg { width: 19px; }
.bottom-nav__item--active { background: var(--accent-soft); color: #b7a4ff; }
.bottom-nav__item:disabled { opacity: 1; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.back-link svg { width: 17px; }
.product-detail__layout { display: grid; gap: 28px; }
.product-gallery {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1.08;
  border-radius: 24px;
  background: var(--surface);
}
.product-gallery img { width: 100%; height: 100%; object-fit: cover; }
.image-counter {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 15, 23, .76);
  font-size: 11px;
  backdrop-filter: blur(10px);
}
.product-info h1 { max-width: 720px; font-size: clamp(32px, 7vw, 48px); }
.detail-price { min-height: 34px; display: flex; align-items: baseline; gap: 10px; margin-top: 18px; }
.detail-price strong { font-size: 24px; letter-spacing: -.03em; }
.detail-price del { color: var(--muted); font-size: 15px; }
.product-description { margin: 18px 0 28px; color: var(--muted); line-height: 1.65; }

.option-group { margin-top: 24px; }
.option-group__heading { display: flex; justify-content: space-between; margin-bottom: 11px; font-size: 13px; }
.option-group__heading span { color: var(--muted); }
.option-group__heading b { font-weight: 700; }
.option-list { display: flex; flex-wrap: wrap; gap: 9px; }
.option-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.option-button--size { min-width: 48px; }
.option-button--active { border-color: var(--accent); background: var(--accent-soft); color: #c9bdff; }
.option-button:disabled { opacity: .28; cursor: default; text-decoration: line-through; }

.availability { display: flex; align-items: center; gap: 8px; margin: 22px 0 15px; color: #76d99b; font-size: 13px; }
.availability > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.availability--unavailable { color: var(--danger); }
.primary-action {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #9374ff, #7150e9);
  color: white;
  font-weight: 800;
}
.primary-action:disabled { opacity: .72; }
.auth-hint { margin: 10px auto 0; color: #687282; font-size: 11px; line-height: 1.45; text-align: center; }
.page-section { padding-bottom: 40px; }
.page-section h1 { margin: 16px 0 22px; font-size: clamp(28px, 7vw, 44px); }
.page-section h2 { margin-bottom: 12px; }
.stack { display: grid; gap: 12px; }
.panel { display: block; margin: 14px 0; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); }
.panel p { margin: 6px 0; color: var(--muted); }
.line-item, .order-row, .section-heading, .variant-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.line-item img { width: 74px; height: 86px; border-radius: 12px; object-fit: cover; }
.line-item form { display: flex; gap: 6px; }
button, input, textarea, select { font: inherit; }
button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-strong, #202631); color: var(--text); cursor: pointer; }
input, textarea, select { width: 100%; margin-top: 7px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #0f141d; color: var(--text); }
.small-input { width: 68px; margin: 0; }
.danger-button { color: var(--danger); }
.secondary-action { width: 100%; margin-top: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; margin: 0; }
.total { margin: 20px 0; font-size: 22px; font-weight: 800; }
.muted { color: var(--muted); }
.notice { padding: 12px 14px; border-radius: 12px; background: rgba(118,217,155,.12); color: #76d99b; }
.notice--error { background: rgba(255,98,120,.12); color: var(--danger); }
.variant-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; }
.section-heading { flex-wrap: wrap; }
@media (max-width: 700px) { .line-item { align-items: flex-start; flex-wrap: wrap; } .variant-row { grid-template-columns: 1fr 1fr; } .variant-row > div { grid-column: 1 / -1; } }

@media (min-width: 720px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 16px; }
  .product-detail__layout { grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); align-items: start; }
  .product-info { position: sticky; top: 28px; padding: 20px 0; }
}

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