:root {
  --bg: #0b1220;
  --bg-soft: #121b2d;
  --card: rgba(18, 27, 45, 0.92);
  --card-light: rgba(255, 255, 255, 0.04);
  --text: #eff6ff;
  --muted: #b8c5d9;
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --border: rgba(255, 255, 255, 0.1);
  --danger: #ef4444;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --radius: 26px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: radial-gradient(circle at top left, #172554, #0b1220 38%), #0b1220;
  color: var(--text);
}
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 100vh;
  gap: 22px;
  padding: 22px;
}

.sidebar, .main-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-box, .panel, .modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand-box, .panel { padding: 22px; }
.brand-eyebrow, .hero-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 12px;
}
.brand-box h1, .hero h2 { margin: 0 0 10px; font-size: 2rem; }
.brand-box p, .hero p, .results-header p, .help-panel li, .product-short, .detail-short { color: var(--muted); }

.label { display: block; margin-bottom: 10px; font-weight: 700; }
.top-gap { margin-top: 18px; }
.input {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.primary-btn, .secondary-btn, .chip {
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 14px 18px;
  min-height: 54px;
  font-weight: 700;
}
.primary-btn {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: white;
}
.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: var(--border);
}
.primary-btn.big-btn { width: 100%; min-height: 64px; font-size: 1.05rem; }
.toolbar-actions { display: grid; gap: 12px; margin-top: 18px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-color: var(--border);
  min-height: 48px;
}
.chip.active { background: rgba(56,189,248,0.16); color: #bae6fd; border-color: rgba(56,189,248,0.35); }
.help-panel ul { padding-left: 20px; margin-bottom: 0; }

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 150px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.results-header h3 { margin: 0 0 6px; font-size: 1.5rem; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.product-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 420px;
}
.product-thumb-wrap { position: relative; aspect-ratio: 16/10; background: #09111f; }
.product-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(34, 197, 94, 0.94);
  color: #052e16;
  font-weight: 800;
  padding: 9px 12px;
  border-radius: 999px;
}
.product-card-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-topline, .price-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.product-category, .product-stock { color: var(--muted); font-size: .95rem; }
.product-name { margin: 0; font-size: 1.25rem; }
.product-short { margin: 0; line-height: 1.5; }
.current-price { display: block; font-size: 1.35rem; font-weight: 800; }
.old-price { color: #94a3b8; text-decoration: line-through; }

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  width: min(94vw, 1400px);
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
}
.cart-modal-card { width: min(90vw, 1000px); }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: white;
  font-size: 2rem;
}
.product-modal-layout {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
}
.gallery-main {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 22px;
  background: #09111f;
}
.gallery-strip {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}
.gallery-thumb {
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 16px;
  cursor: pointer;
  border: 1px solid var(--border);
}
.detail-topline, .price-box, .spec-row, .cart-header, .cart-footer, .cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.stock-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  font-weight: 700;
}
.product-modal-info h3 { font-size: 2rem; margin: 14px 0 8px; }
.price-box, .specs-card, .summary-box, .option-group, .cart-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  margin-top: 18px;
}
.price-caption, .section-title { color: var(--muted); font-size: .95rem; margin-bottom: 8px; }
.detail-price, .cart-total { font-size: 2rem; font-weight: 800; }
.spec-grid { display: grid; gap: 10px; }
.spec-row { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.spec-row:last-child { border-bottom: 0; }
.option-group-title { font-weight: 800; font-size: 1.1rem; margin-bottom: 12px; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.option-card {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  border-radius: 18px;
  padding: 14px;
  display: block;
}
.option-card input { transform: scale(1.35); margin-right: 10px; }
.option-content { display: inline-flex; flex-direction: column; gap: 6px; }
.option-label { font-weight: 700; }
.option-price { color: #7dd3fc; }
.summary-box ul, .cart-item ul { margin: 0; padding-left: 18px; color: var(--muted); }
.cart-items { display: grid; gap: 14px; margin-top: 18px; }
.cart-item-right { text-align: right; display: grid; gap: 12px; justify-items: end; }
.empty-state, .empty-line {
  padding: 26px;
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1200px) {
  .app-shell, .product-modal-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .app-shell { padding: 12px; gap: 12px; }
  .brand-box, .panel, .modal-card { border-radius: 18px; }
  .product-grid { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
}
