/* ── Custom properties (theme tokens) ──────────────────── */
:root {
  --bg: #ffffff;
  --bg-card: #f7f7f7;
  --bg-nav: #ffffff;
  --bg-drawer: #ffffff;
  --text-primary: #111111;
  --text-secondary: #555555;
  --border: #e5e5e5;
  --accent: #2563eb;
  --price: #16a34a;
  --shadow: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --bg-card: #242424;
  --bg-nav: #1e1e1e;
  --bg-drawer: #242424;
  --text-primary: #f0f0f0;
  --text-secondary: #9a9a9a;
  --border: #383838;
  --accent: #2563eb;
  --price: #4ade80;
  --shadow: rgba(0, 0, 0, 0.4);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  transition: background 0.2s, color 0.2s;
}

/* ── Nav ────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
}.nav-actions { display: flex; gap: 12px; align-items: center; }

.theme-toggle,
.cart-trigger {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.15s;
}
.theme-toggle:hover,
.cart-trigger:hover { border-color: var(--accent); }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 24px;
}
.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
}
.hero-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 32px;
}
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.btn-primary:hover { opacity: 0.9; }

/* ── Products ───────────────────────────────────────────── */
.products-section {
  padding: 0 24px 60px;
  max-width: 1200px;
  margin: 0 auto;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

@media (max-width: 560px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .product-body { padding: 10px 10px 8px; }
  .product-card-actions { padding: 0 10px 10px; }
  .product-name { font-size: 13px; }
  .product-variant { font-size: 11px; }
  .product-price { font-size: 14px; margin-bottom: 10px; }
  .btn-add-to-cart { font-size: 12px; padding: 8px; }
  .product-image-placeholder { font-size: 32px; }
}
.products-grid-divider {
  grid-column: 1 / -1;
  padding: 24px 0 10px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.product-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.product-image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  font-size: 48px;
}
.product-body { padding: 16px; }
.product-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.product-variant { color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; }
.product-price { color: var(--price); font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.btn-add-to-cart {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.btn-add-to-cart:hover { opacity: 0.9; }
.btn-add-to-cart:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Loading / Error ────────────────────────────────────── */
.loading, .error {
  text-align: center;
  padding: 60px;
  color: var(--text-secondary);
}
.error { color: #ef4444; }

/* ── Cart backdrop ──────────────────────────────────────── */
.cart-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
}
.cart-backdrop.open { display: block; }

/* ── Cart drawer ────────────────────────────────────────── */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-drawer);
  border-left: 1px solid var(--border);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.cart-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}
.cart-items { flex: 1; overflow-y: auto; padding: 16px; }
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item-name { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.cart-item-info { flex: 1; }
.cart-item-controls {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  width: fit-content;
}
.cart-qty-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 0.1s;
}
.cart-qty-btn:hover:not(:disabled) { background: var(--bg); }
.cart-qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.cart-qty-value {
  min-width: 32px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 28px;
  line-height: 28px;
  user-select: none;
}
.cart-item-price { font-size: 14px; color: var(--price); font-weight: 600; }
.cart-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}
.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}
.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  margin-bottom: 14px;
}
.btn-checkout {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}
.btn-checkout:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-continue {
  width: 100%;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

/* ── Product card link ──────────────────────────────────── */
.product-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.product-card-link:hover .product-name { color: var(--accent); }
.product-body { padding: 16px 16px 10px; }
.product-card-actions { padding: 0 16px 16px; }

/* ── Nav brand as link (product pages) ──────────────────── */
a.nav-brand {
  text-decoration: none;
  color: var(--text-primary);
}
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--text-primary); }

/* ── Product page ───────────────────────────────────────── */
.product-page {
  padding: 40px 24px 80px;
  max-width: 1100px;
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 36px;
}
.back-link:hover { color: var(--text-primary); }

.product-page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
  margin-bottom: 72px;
}
@media (max-width: 700px) {
  .product-page-grid { grid-template-columns: 1fr; gap: 32px; }
}

.product-page-image-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.product-page-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.product-page-image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  font-size: 80px;
}

.product-page-eyebrow {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.product-page-name {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.1;
}
.product-page-tagline {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
}
.product-page-size-row { margin-bottom: 24px; }
.product-page-size {
  display: inline-block;
  font-size: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 12px;
  color: var(--text-secondary);
}
.product-page-price {
  font-size: 30px;
  font-weight: 700;
  color: var(--price);
  margin-bottom: 20px;
}
.quantity-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
  margin-bottom: 16px;
}
.qty-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: background 0.1s;
}
.qty-btn:hover:not(:disabled) { background: var(--bg-card); }
.qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.qty-value {
  min-width: 48px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 42px;
  line-height: 42px;
  user-select: none;
}
.product-page-atc {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  margin-bottom: 20px;
}
.product-page-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
}

.product-page-body {
  border-top: 1px solid var(--border);
  padding-top: 56px;
  display: grid;
  gap: 48px;
}
.product-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 14px;
}
.product-section p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}
.product-section p + p { margin-top: 12px; }

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.specs-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.specs-table td:first-child {
  color: var(--text-secondary);
  width: 38%;
  white-space: nowrap;
}

/* ── About page ─────────────────────────────────────────── */
.about-back {
  padding: 24px 24px 0;
  max-width: 900px;
  margin: 0 auto;
}

.about-hero {
  text-align: center;
  padding: 80px 24px 60px;
}

.about-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 0;
}
@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}

.about-block h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}
.about-block p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}
.about-block p + p { margin-top: 12px; }
.about-block--centered { text-align: center; max-width: 640px; margin: 0 auto; }
.about-block--centered .btn-primary { margin-top: 28px; }

.about-divider {
  border-top: 1px solid var(--border);
  margin: 56px 0;
}

.about-standards { max-width: 680px; }
.about-standards-eyebrow {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.about-standards h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.3;
}
.about-standards p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}
.about-standards p + p { margin-top: 12px; }

.about-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 640px) {
  .about-pillars { grid-template-columns: 1fr 1fr; }
}
.about-pillar {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}
.about-pillar-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.about-pillar-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--price);
  margin-bottom: 10px;
}
.about-pillar p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}
.footer-links { margin-top: 8px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--text-primary); }

/* ── Legal pages ─────────────────────────────────────────── */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.legal-page h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
.legal-updated {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 48px;
}
.legal-section { margin-bottom: 36px; }
.legal-section h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}
.legal-section p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
}
.legal-section p + p { margin-top: 10px; }
.legal-section ul {
  padding-left: 20px;
  margin-top: 8px;
}
.legal-section li {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 4px;
}

/* ── Contact page ────────────────────────────────────────── */
.contact-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.contact-page h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}
.contact-intro {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 40px;
}
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-group input,
.form-group textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 14px;
  transition: border-color 0.15s;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-secondary); opacity: 0.6; }
.btn-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity 0.15s;
}
.btn-submit:hover { opacity: 0.9; }
