/* I.O. Shen — design tokens
   Pulled directly from mastergrade.net's live site: brand red #DA251C,
   black/white base, dark surface #171717 (their actual footer color).
   Their CSS specifies "Gotham" as the typeface, but no font-face for it is
   ever actually served anywhere on the site (checked document.fonts — only
   Font Awesome icon fonts are registered), so every real visitor is already
   seeing the system sans-serif fallback, not true Gotham. Matching that
   fallback here is matching what customers actually see today, and avoids
   embedding a commercial font without a license to do so. */

:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F5F5F5;
  --ink: #000000;
  --muted: #555555;
  --muted-2: #888888;
  --accent: #DA251C;
  --accent-soft: #FCEAE9;
  --accent-2: #B91E17;
  --accent-2-soft: #FCEAE9;
  --border: #E5E5E5;
  --border-strong: #CCCCCC;

  --hero-bg: #171717;
  --hero-ink: #FFFFFF;
  --hero-muted: #B3B3B3;
  --hero-border: #333333;

  --font-display: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

/* ---- Nav ---- */
header.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(23,24,26,0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hero-border);
}
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand-mark {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  color: var(--hero-ink); letter-spacing: 0.01em;
}
.brand-mark img { height: 46px; width: auto; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  color: var(--hero-muted); text-decoration: none; font-size: 14px;
  letter-spacing: 0.02em; transition: color 0.15s;
}
.nav-links a:hover { color: var(--hero-ink); }
.cart-btn {
  background: none; border: 1px solid var(--hero-border); color: var(--hero-ink);
  border-radius: 3px; padding: 8px 14px; font-family: var(--font-body);
  font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.cart-btn:hover { border-color: var(--accent); }
.cart-count {
  background: var(--accent); color: #fff; border-radius: 50%;
  width: 18px; height: 18px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 700;
}

/* ---- Hero ---- */
.hero {
  background:
    linear-gradient(rgba(10, 10, 10, 0.58), rgba(10, 10, 10, 0.66)),
    url('images/hero-bg.jpg') center / cover no-repeat;
  color: var(--hero-ink);
  padding: 88px 0 72px;
  border-bottom: 1px solid var(--hero-border);
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.eyebrow {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(36px, 5vw, 54px); line-height: 1.08;
  margin: 0 0 20px; text-wrap: balance;
}
.hero p.lead {
  color: var(--hero-muted); font-size: 17px; max-width: 46ch; margin: 0 0 30px;
}
.lead-emphasis {
  display: block; color: var(--hero-ink); font-weight: 700; padding-bottom: 10px;
}
.hero-actions { display: flex; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 3px; font-size: 14.5px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: opacity 0.15s, transform 0.1s;
  font-family: var(--font-body);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-outline { border-color: var(--hero-border); color: var(--hero-ink); background: transparent; }
.btn-outline:hover { border-color: var(--accent); }
.hero-img {
  border-radius: 4px; overflow: hidden; border: 1px solid var(--hero-border);
  background: var(--surface-2);
}
.hero-img img { width: 100%; height: 420px; object-fit: contain; background: #fff; }
.hero-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.hero-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Catalog ---- */
.catalog { padding: 64px 0 100px; }
.catalog-head {
  margin-bottom: 40px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center;
}
.catalog-head h2 {
  font-family: var(--font-display); font-size: 32px; margin: 0 0 10px; text-wrap: balance;
}
.catalog-head p { color: var(--muted); max-width: 72ch; margin: 0 0 12px; line-height: 1.6; }
.catalog-head .catalog-note { font-size: 13.5px; color: var(--muted-2); margin-bottom: 0; }
.catalog-head-img {
  border-radius: 4px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 3 / 2;
}
.catalog-head-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) {
  .catalog-head { grid-template-columns: 1fr; }
  .catalog-head-img { order: -1; }
}

.category-nav {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 32px 0 8px;
  border-bottom: 1px solid var(--border); padding-bottom: 20px;
}
.category-nav button {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 8px 16px; font-size: 13px; cursor: pointer;
  font-family: var(--font-body);
}
.category-nav button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.category-section { margin-top: 44px; }
.category-section h3 {
  font-family: var(--font-display); font-size: 22px; margin: 0 0 20px;
  padding-bottom: 10px; border-bottom: 2px solid var(--accent); color: var(--accent);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden; display: flex; flex-direction: column;
}
.product-card .shot {
  background: var(--surface-2); height: 160px; display: flex; align-items: center;
  justify-content: center; border-bottom: 1px solid var(--border); overflow: hidden;
}
.product-card .shot img { width: 100%; height: 100%; object-fit: contain; }
.product-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card h4 { font-family: var(--font-display); font-size: 15px; margin: 0; line-height: 1.3; }
.product-card h4 a { color: inherit; text-decoration: none; }
.product-card h4 a:hover { color: var(--accent); }
.product-card .sku { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted-2); }
.product-card .desc { font-size: 13px; color: var(--muted); flex: 1; line-height: 1.5; }
.product-card .foot { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.product-card .price { font-family: var(--font-mono); font-weight: 700; font-size: 16px; }
.add-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 3px;
  padding: 8px 14px; font-size: 13px; cursor: pointer; font-family: var(--font-body);
}
.add-btn:hover { background: var(--accent-2); }
.add-btn.added { background: var(--muted-2); }

.empty-catalog {
  text-align: center; padding: 60px 20px; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: 4px;
}

/* ---- Product detail page ---- */
.product-detail { padding: 28px 0 100px; }
.breadcrumb { font-size: 13px; color: var(--muted-2); margin-bottom: 28px; }
.breadcrumb a { color: var(--muted-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 4px; }
.product-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start;
}
.product-detail-shot {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px;
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-detail-shot img { width: 100%; height: 100%; object-fit: contain; }
.product-detail-info h1 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 3vw, 32px);
  margin: 0 0 8px; line-height: 1.2;
}
.product-detail-info .sku { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted-2); margin-bottom: 18px; }
.product-detail-price { font-family: var(--font-mono); font-weight: 700; font-size: 26px; margin-bottom: 20px; }
.product-detail-desc { color: var(--muted); font-size: 15.5px; line-height: 1.6; margin: 0 0 28px; }
.product-detail-actions { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.qty-selector {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--border-strong);
  border-radius: 4px; padding: 8px 14px;
}
.qty-selector span { font-family: var(--font-mono); min-width: 16px; text-align: center; }
.qty-selector .qty-btn { border-color: var(--border-strong); color: var(--ink); }
.product-detail-note { font-size: 13px; color: var(--muted-2); }

.feature-list { margin: 0 0 28px; padding: 0; list-style: none; }
.feature-list li {
  position: relative; padding-left: 22px; margin-bottom: 10px;
  font-size: 14.5px; color: var(--ink); line-height: 1.5;
}
.feature-list li::before {
  content: ''; position: absolute; left: 0; top: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
}

.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumb {
  width: 64px; height: 64px; padding: 0; border-radius: 3px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border); cursor: pointer;
}
.gallery-thumb.active { border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }

.product-faq { max-width: 760px; margin: 64px 0 0; }

.related-products { margin: 64px 0 0; }
.related-products h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 22px; margin: 0 0 24px;
}
.product-faq h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 22px; margin: 0 0 20px;
}
.faq-list { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: none; border: none; text-align: left; padding: 16px 0; cursor: pointer;
  font-family: var(--font-body); font-size: 15px; font-weight: 600; color: var(--ink);
}
.faq-caret { color: var(--accent); font-size: 18px; font-weight: 700; flex-shrink: 0; }
.faq-answer {
  max-height: 0; overflow: hidden; color: var(--muted); font-size: 14.5px; line-height: 1.6;
  transition: max-height 0.2s ease;
}
.faq-answer.open { max-height: 400px; padding-bottom: 16px; }
.ai-content-note { font-size: 12px; color: var(--muted-2); margin-top: 16px; }

@media (max-width: 760px) {
  .product-detail-grid { grid-template-columns: 1fr; }
}

/* ---- Cart drawer ---- */
.cart-drawer {
  position: fixed; top: 0; right: -420px; width: 400px; max-width: 92vw; height: 100vh;
  background: var(--hero-bg); color: var(--hero-ink); z-index: 100;
  transition: right 0.25s ease; display: flex; flex-direction: column;
  border-left: 1px solid var(--hero-border);
}
.cart-drawer.open { right: 0; }
.cart-drawer-head {
  padding: 20px 24px; border-bottom: 1px solid var(--hero-border);
  display: flex; align-items: center; justify-content: space-between;
}
.cart-drawer-head h3 { font-family: var(--font-display); margin: 0; font-size: 19px; }
.cart-close { background: none; border: none; color: var(--hero-muted); font-size: 20px; cursor: pointer; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px 24px; }
.cart-line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--hero-border); }
.cart-line img { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 3px; }
.cart-line .info { flex: 1; }
.cart-line .info .name { font-size: 13.5px; margin-bottom: 4px; }
.cart-line .qty-row { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  background: none; border: 1px solid var(--hero-border); color: var(--hero-ink);
  width: 22px; height: 22px; border-radius: 3px; cursor: pointer; font-size: 13px; line-height: 1;
}
.cart-empty { color: var(--hero-muted); text-align: center; padding: 40px 0; font-size: 14px; }
.cart-drawer-foot { padding: 20px 24px; border-top: 1px solid var(--hero-border); }
.cart-total-row { display: flex; justify-content: space-between; margin-bottom: 14px; font-size: 15px; }
.cart-total-row .amt { font-family: var(--font-mono); font-weight: 700; }
.cart-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.cart-backdrop.open { opacity: 1; pointer-events: auto; }

/* ---- Checkout modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 200;
  display: none; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--hero-bg); color: var(--hero-ink); border-radius: 6px;
  max-width: 520px; width: 100%; padding: 32px; border: 1px solid var(--hero-border);
}
.modal h3 { font-family: var(--font-display); margin: 0 0 6px; font-size: 22px; }
.payment-order-summary { font-size: 14px; color: var(--hero-muted); margin-bottom: 4px; }
.payment-tax-line {
  font-size: 13px; color: var(--hero-muted); margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--hero-border);
}
.payment-tax-line .amount { color: var(--hero-ink); font-weight: 600; }
.payment-field { margin-bottom: 14px; background: #fff; border-radius: 6px; padding: 4px 14px; }
.payment-message {
  margin-top: 12px; padding: 10px 14px; border-radius: 6px; font-size: 13.5px;
  background: rgba(161,92,42,0.15); color: #E0A876; border: 1px solid rgba(161,92,42,0.35);
}
.payment-message[hidden] { display: none; }
.modal .btn-primary { width: 100%; margin-top: 6px; }
.modal .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.back-link {
  background: none; border: none; color: var(--hero-muted); font-size: 13px;
  cursor: pointer; padding: 0; margin-bottom: 16px;
}

/* ---- Contact modal form ---- */
.form-field { margin-bottom: 14px; }
.form-field label {
  display: block; font-size: 13px; color: var(--hero-muted); margin-bottom: 6px;
}
.form-field input, .form-field textarea {
  width: 100%; background: #fff; color: var(--ink); border: none; border-radius: 6px;
  padding: 10px 14px; font-family: var(--font-body); font-size: 14px; resize: vertical;
}
.form-field input:focus, .form-field textarea:focus { outline: 2px solid var(--accent); }
.hp-field {
  position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0;
}

/* ---- Footer ---- */
footer.site {
  background: var(--hero-bg); color: var(--hero-muted); padding: 48px 0 28px;
  border-top: 1px solid var(--hero-border); font-size: 13px;
}
footer.site .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
footer.site a { color: var(--hero-muted); text-decoration: none; margin-right: 18px; }
footer.site a:hover { color: var(--hero-ink); }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-img { order: -1; }
}

/* ---- Order confirmation ---- */
.confirm-wrap { max-width: 640px; margin: 0 auto; padding: 72px 28px 100px; text-align: center; }
.confirm-wrap .eyebrow { text-align: center; }
.confirm-wrap h1 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 38px); margin: 0 0 14px; text-wrap: balance; }
.confirm-wrap .lead { color: var(--muted); font-size: 15.5px; margin: 0 0 32px; }
.order-summary { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 24px; text-align: left; }
.order-line { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 16px; }
.order-line:last-of-type { border-bottom: none; }
.order-line .name { font-size: 14.5px; }
.order-line .qty { color: var(--muted); font-size: 13px; }
.order-total { display: flex; justify-content: space-between; padding-top: 16px; margin-top: 8px; border-top: 2px solid var(--accent); font-weight: 700; }
.order-total .amt { font-family: var(--font-mono); }
.confirm-contact { color: var(--muted); font-size: 13.5px; margin: 28px 0; }
.confirm-contact a { color: var(--accent); }

/* ---- Legal pages ---- */
.legal-wrap { max-width: 720px; margin: 0 auto; padding: 64px 28px 100px; }
.legal-wrap .eyebrow { margin-bottom: 8px; }
.legal-wrap h1 { font-family: var(--font-display); font-size: 32px; margin: 0 0 6px; }
.legal-updated { color: var(--muted-2); font-size: 13px; margin: 0 0 32px; }
.legal-body h2 { font-family: var(--font-display); font-size: 19px; margin: 30px 0 10px; }
.legal-body p { color: var(--ink); font-size: 14.5px; line-height: 1.65; margin: 0 0 4px; }
.legal-body a { color: var(--accent); }
.legal-note {
  background: var(--accent-2-soft); border: 1px solid var(--border); border-radius: 4px;
  padding: 14px 16px; font-size: 13px; color: var(--muted); margin: 18px 0;
}
