/* ============================================================
   Bead Studio — shared stylesheet for all pages
   ============================================================ */

:root {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --line: #e0e0e0;
  --line-strong: #cccccc;
  --ink: #1a1a1a;
  --muted: #777777;
  --muted-soft: #999999;
  --accent: #4aa3e8;
  --dark: #333333;
  --ok: #4a7c59;
  --radius: 6px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* ── Header / nav ──────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.logo img { height: 34px; width: auto; display: block; }

.nav { display: flex; align-items: center; gap: 24px; }

.nav a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav a:hover { color: var(--ink); }

.nav a.active {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cart-badge {
  background: var(--dark);
  color: #fff;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 2px;
}

.hidden { display: none !important; }

/* ── Layout ────────────────────────────────────────────────── */
main { flex: 1; width: 100%; }

.container {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 40px 0; }
.section + .section { border-top: 1px solid var(--line); }

.page-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.page-desc { font-size: 13px; color: var(--muted); margin-bottom: 28px; }

.section-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.section-sub { font-size: 12px; color: var(--muted); margin-bottom: 18px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  font-family: inherit;
  font-size: 12px;
  padding: 8px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}
.btn-primary:hover { background: #000; color: #fff; border-color: #000; }

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #ffffff, #ececec);
  border-bottom: 1px solid var(--line);
}
.hero-inner { padding: 64px 0; text-align: center; }
.hero-title { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.hero-sub {
  font-size: 14px;
  color: var(--muted);
  max-width: 540px;
  margin: 0 auto 24px;
}

/* ── How it works ──────────────────────────────────────────── */
.steps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  min-width: 150px;
  text-align: center;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.step-label { font-size: 13px; font-weight: 600; }
.step-arrow { font-size: 22px; color: var(--muted); }

/* ── Category grid ─────────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.cat-card {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  background: #fff;
  transition: box-shadow 0.15s, transform 0.15s;
}
.cat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cat-card img { width: 100%; height: 160px; object-fit: cover; display: block; }
.cat-card .cat-label {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
}

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
  font-family: inherit;
  transition: all 0.15s;
}
.tab.active { background: var(--dark); color: #fff; border-color: var(--dark); }

/* ── Product grid / cards ──────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.product-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-img {
  aspect-ratio: 1 / 1;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 12px; display: flex; flex-direction: column; flex: 1; }
.product-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.product-desc { font-size: 11px; color: var(--muted-soft); margin-bottom: 12px; flex: 1; }
.product-footer { display: flex; align-items: center; justify-content: space-between; }
.product-price { font-size: 14px; font-weight: 700; }
.btn-cart {
  background: var(--dark);
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-cart:hover { background: #000; }
.btn-cart.added { background: var(--ok); }

.empty-note { font-size: 13px; color: var(--muted); padding: 20px 0; }

/* ── CTA band ──────────────────────────────────────────────── */
.cta {
  background: linear-gradient(135deg, #ececec, #ffffff);
  border-top: 1px solid var(--line);
  text-align: center;
}
.cta-inner { padding: 48px 0; }
.cta-text { font-size: 16px; margin-bottom: 18px; }

/* ── Contact form ──────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s;
  appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 110px; }

.info-panel {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--muted);
}
.info-row:last-child { margin-bottom: 0; }
.info-row .icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.info-row strong { display: block; font-weight: 600; color: var(--ink); margin-bottom: 1px; }

.btn-wrap { display: flex; justify-content: center; margin-top: 24px; }

.success { display: none; text-align: center; padding: 56px 24px; }
.success-icon { font-size: 44px; }
.success h3 { font-size: 20px; font-weight: 600; margin: 12px 0 6px; }
.success p { font-size: 13px; color: var(--muted); }
.success a {
  display: inline-block;
  margin-top: 16px;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

/* ── AR page ───────────────────────────────────────────────── */
.ar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.ar-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px;
}
.ar-stage {
  height: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
}
.ar-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ar-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.ar-thumb {
  width: 56px; height: 56px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  padding: 0;
}
.ar-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ar-thumb.active { border-color: var(--accent); }

.ar-option { margin-bottom: 16px; }
.ar-option label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.ar-option select,
.ar-option input {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  appearance: none;
}
.ar-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.ar-summary .label { font-size: 12px; color: var(--muted); }
.ar-summary .total { font-size: 18px; font-weight: 700; }

/* ── AR camera try-on ──────────────────────────────────────── */
.ar-stage { position: relative; }
#ar-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror like a selfie camera */
  display: none;
}
#ar-video.on { display: block; }
#ar-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 110px;
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;     /* let us handle drag on touch */
  user-select: none;
  -webkit-user-drag: none;
  /* Product photos sit on a near-white background; multiply lets that
     background drop away over the camera feed so the bead reads cleaner. */
  mix-blend-mode: multiply;
}
#ar-overlay:active { cursor: grabbing; }
.ar-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  padding: 18px 24px;
  font-size: 13px;
  color: var(--muted);
}
.ar-placeholder.hidden { display: none; }
.ar-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 6px;
}
.ar-size { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex: 1; }
.ar-size input[type="range"] { flex: 1; }
.ar-hint { font-size: 11px; color: var(--muted-soft); margin-bottom: 14px; }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: #f0f0f0;
  border-top: 1px solid var(--line);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-logo {
  display: inline-flex;
  align-items: center;
}
.footer-logo img { height: 22px; width: auto; display: block; }
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--ink); }
.footer-links .copyright {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Cart page ─────────────────────────────────────────────── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto auto auto;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.cart-thumb {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-name { font-size: 13px; font-weight: 600; }
.cart-unit { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cart-qty { display: flex; align-items: center; gap: 8px; }
.cart-qty button {
  width: 26px; height: 26px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}
.cart-qty button:hover { border-color: var(--accent); color: var(--accent); }
.cart-qty .qty { font-size: 13px; min-width: 18px; text-align: center; }
.cart-line { font-size: 14px; font-weight: 700; min-width: 48px; text-align: right; }
.cart-remove {
  border: none;
  background: none;
  color: var(--muted-soft);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}
.cart-remove:hover { color: #c0392b; }

.cart-summary {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  position: sticky;
  top: 80px;
}
.cart-summary .section-title { margin-bottom: 14px; }
.cart-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.cart-row.total { color: var(--ink); font-weight: 700; font-size: 16px; padding-top: 10px; border-top: 1px solid var(--line); }
.cart-summary .btn { width: 100%; margin-top: 8px; }

.cart-empty {
  text-align: center;
  padding: 56px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 720px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}

/* ── Legal / Terms page ────────────────────────────────────── */
.legal { max-width: 760px; }
.legal .updated { font-size: 12px; color: var(--muted); margin-bottom: 24px; }
.legal h2 { font-size: 15px; font-weight: 700; margin: 26px 0 6px; }
.legal p { font-size: 13px; color: #444; line-height: 1.65; margin-bottom: 10px; }
.legal ul { margin: 0 0 10px 22px; }
.legal li { font-size: 13px; color: #444; line-height: 1.65; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: 1fr; }
  .form-grid, .ar-grid { grid-template-columns: 1fr; }
  .nav { gap: 14px; }
  .site-header { padding: 12px 18px; }
}
