:root {
  --bg: #0b0f14;
  --surface: #121820;
  --card: #171e28;
  --border: #263041;
  --text: #eef2f7;
  --muted: #8b98a8;
  --accent: #5b8cff;
  --accent-hover: #4a7af0;
  --success: #3ddc97;
  --danger: #ff6b6b;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 20, 0.85);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo span { color: var(--accent); }

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.cart-btn:hover { border-color: var(--accent); }

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  padding: 40px 0 64px;
  align-items: start;
}

.product-gallery { position: sticky; top: 88px; }

.product-image {
  aspect-ratio: 1;
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 20%, rgba(91, 140, 255, 0.18), transparent 45%),
    var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.shirt-preview { width: 58%; }

.shirt-body {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 12px 12px 20px 20px;
  background: #111;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.shirt-body::before,
.shirt-body::after {
  content: "";
  position: absolute;
  top: 12%;
  width: 28%;
  height: 18%;
  background: inherit;
  border-radius: 40% 20% 30% 10%;
}

.shirt-body::before { left: -18%; transform: rotate(-25deg); }
.shirt-body::after { right: -18%; transform: rotate(25deg); }

.shirt-logo {
  position: absolute;
  inset: 34% 0 auto;
  text-align: center;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.92);
}

.product-image[data-color="white"] .shirt-body { background: #f3f5f8; }
.product-image[data-color="white"] .shirt-logo { color: #111; }
.product-image[data-color="blue"] .shirt-body { background: #1e3a8a; }

.thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #111;
  cursor: pointer;
}

.thumb.white { background: #f3f5f8; }
.thumb.blue { background: #1e3a8a; }
.thumb.active { border-color: var(--accent); }

.badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(91, 140, 255, 0.15);
  color: #a8c4ff;
  font-size: 0.8rem;
  font-weight: 600;
}

.product-info h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.price {
  margin: 0 0 16px;
  font-size: 1.6rem;
  font-weight: 700;
}

.desc {
  margin: 0 0 28px;
  color: var(--muted);
  max-width: 42ch;
}

.option-block, .qty-row { margin-bottom: 22px; }

.option-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.color-row, .size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: #111;
  cursor: pointer;
}

.color-dot.white { background: #f3f5f8; }
.color-dot.blue { background: #1e3a8a; }
.color-dot.active {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.size-row button {
  min-width: 48px;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.size-row button.active,
.size-row button:hover {
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.12);
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.qty button {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.qty span {
  min-width: 36px;
  text-align: center;
  font-weight: 600;
}

.btn-primary {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 50;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100%);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 60;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow);
}

.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.drawer-head h2 { margin: 0; font-size: 1.15rem; }

.icon-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.icon-close:hover { background: var(--card); }

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px;
}

.empty {
  color: var(--muted);
  text-align: center;
  margin-top: 40px;
}

.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cart-line-img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.cart-line-img.white { background: #e8eaed; color: #111; }
.cart-line-img.blue { background: #1e3a8a; }

.cart-line h3 { margin: 0 0 4px; font-size: 0.95rem; }
.cart-line p { margin: 0; color: var(--muted); font-size: 0.82rem; }

.cart-line-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.remove-btn {
  border: none;
  background: none;
  color: var(--danger);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.drawer-foot {
  padding: 16px 20px 24px;
  border-top: 1px solid var(--border);
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal form { padding: 8px 20px 20px; }

label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

input, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

input:focus, textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.order-summary {
  margin: 8px 0 14px;
  padding: 12px;
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.9rem;
  white-space: pre-line;
}

.form-note {
  margin: 10px 0 0;
  font-size: 0.85rem;
  text-align: center;
  color: var(--muted);
  min-height: 1.2em;
}

.form-note.err { color: var(--danger); }
.form-note.ok { color: var(--success); }

.modal.success {
  text-align: center;
  padding: 32px 24px;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(61, 220, 151, 0.15);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
}

.modal.success h2 { margin: 0 0 8px; }
.modal.success p { margin: 0 0 20px; color: var(--muted); }

[hidden] { display: none !important; }

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 24px;
  }
  .product-gallery { position: static; }
}