:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #14171c;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 800; font-size: 1.3rem; text-decoration: none; color: var(--ink); }
.logo span { color: var(--accent); }
.cart-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 6px 14px; cursor: pointer; display: flex; gap: 8px; align-items: center;
}
.cart-count {
  background: var(--accent); color: var(--accent-ink); border-radius: 999px;
  min-width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: .8rem;
}

/* Hero + toolbar */
.hero { padding: 48px 0 24px; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 6px; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 0 0 24px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.toolbar input, .toolbar select {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 12px;
}
.toolbar input { flex: 1 1 220px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; font-size: .9rem;
}
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Grid */
.grid {
  display: grid; gap: 20px; padding: 8px 0 60px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.1); }
.card .brand { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.card h3 { margin: 0; font-size: 1.15rem; }
.card .tagline { margin: 0; color: var(--muted); font-size: .9rem; }
.card .storage-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: .75rem; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; color: var(--muted); }
.card .price { font-weight: 700; font-size: 1.1rem; margin-top: auto; }
.card .price small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.btn {
  border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* CSS-drawn phone mock-up (no image assets needed) */
.phone-art { display: grid; place-items: center; height: 200px; background: var(--bg); border-radius: 12px; }
.phone {
  --c: #333;
  width: 88px; height: 176px; border-radius: 18px; position: relative;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 85%, white), var(--c));
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.15), 0 10px 20px rgba(0,0,0,.18);
  transition: background .25s ease;
}
.phone::before { /* camera bump */
  content: ""; position: absolute; top: 10px; left: 10px; width: 34px; height: 34px;
  border-radius: 10px; background: rgba(0,0,0,.25);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.15);
}
.phone::after { /* lens */
  content: ""; position: absolute; top: 17px; left: 17px; width: 10px; height: 10px; border-radius: 50%;
  background: #0b0b0b; box-shadow: 12px 0 0 #0b0b0b, 0 12px 0 #0b0b0b;
}
.phone.fold { width: 120px; border-radius: 14px; }
.phone-art.lg { height: 320px; }
.phone-art.lg .phone { transform: scale(1.5); }

.swatches { display: flex; gap: 6px; }
.swatch {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }

/* Modals */
.modal {
  border: 0; border-radius: 20px; padding: 28px; width: min(920px, 94vw);
  max-height: 92vh; box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
.modal::backdrop { background: rgba(15,18,24,.45); backdrop-filter: blur(2px); }
.modal-side { margin-right: 0; height: 100vh; max-height: 100vh; width: min(420px, 100vw); border-radius: 20px 0 0 20px; }
.close {
  position: absolute; top: 12px; right: 14px; border: 0; background: none;
  font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--muted);
}

.detail { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; }
@media (max-width: 720px) { .detail { grid-template-columns: 1fr; } }
.detail h2 { margin: 0; font-size: 1.6rem; }
.detail .section-label { font-weight: 600; margin: 18px 0 8px; font-size: .9rem; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.spec { background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: .85rem; }
.spec b { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.storage-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.storage-opt {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px;
  cursor: pointer; text-align: center;
}
.storage-opt strong { display: block; }
.storage-opt span { font-size: .85rem; color: var(--muted); }
.storage-opt[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, white); }

.acc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 480px) { .acc-list { grid-template-columns: 1fr; } }
.acc {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 8px 10px; cursor: pointer; font-size: .9rem;
}
.acc input { accent-color: var(--accent); }
.acc .icon { font-size: 1.2rem; }
.acc .acc-price { margin-left: auto; color: var(--muted); }
.acc:has(input:checked) { border-color: var(--accent); }

.total-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
}
.total-bar .total { font-size: 1.4rem; font-weight: 800; }
.total-bar .total small { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; }

/* Basket */
.cart-item { border-bottom: 1px solid var(--line); padding: 12px 0; display: flex; gap: 10px; justify-content: space-between; }
.cart-item .meta { font-size: .85rem; color: var(--muted); }
.cart-item button { border: 0; background: none; color: #dc2626; cursor: pointer; font-size: .85rem; }
.cart-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.2rem; margin: 16px 0; }

.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .85rem; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: .9rem; z-index: 100; animation: fade 2.2s forwards;
}
@keyframes fade { 0%,80% { opacity: 1; } 100% { opacity: 0; } }
