/* ============================================================
   userdeck.lol - shared styles
   Dark / electric-blue / purple product theme
   ============================================================ */

/* ---- Reset --------------------------------------------------- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
img,svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input,textarea,select { font: inherit; }
ul { list-style: none; }

/* ---- Tokens -------------------------------------------------- */
:root {
  --bg:        #313131;
  --bg-1:      #2a2a2a;
  --bg-2:      #383838;
  --surface:   #3a3a3a;
  --card:      #3a3a3a;
  --card-2:    #404040;
  --border:    rgba(255,255,255,.10);
  --border-2:  rgba(255,255,255,.18);

  --text:      #ffffff;
  --text-dim:  rgba(255,255,255,.72);
  --text-mute: rgba(255,255,255,.5);

  --red:        #e01535;
  --red-soft:   #ff4d6d;
  --red-dark:   #b21128;

  --grad:      linear-gradient(120deg, #e01535 0%, #ff4d6d 100%);
  --grad-soft: linear-gradient(120deg, rgba(224,21,53,.18), rgba(255,77,109,.16));

  --radius:    10px;
  --radius-lg: 14px;
  --radius-sm: 6px;
  --maxw:      1180px;
  --nav-h:     96px;

  --shadow:    0 24px 60px -20px rgba(0,0,0,.7);
  --ease:      cubic-bezier(.22,.61,.36,1);

  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: rgba(224,21,53,.32); color: #fff; }
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--red), var(--red));
  border-radius: 99px;
  border: 3px solid var(--bg);
}

/* ---- Layout helpers ----------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.section { padding: 96px 0; position: relative; }
.section-sm { padding: 64px 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--red-soft);
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px;
  background: linear-gradient(90deg, var(--red), transparent);
}
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -.02em;
  margin: 16px 0 14px;
}
.section-head p { color: var(--text-dim); font-size: 16px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow::before { display: none; }
.gradient-text { color: var(--red); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---- Buttons ------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 14.5px;
  padding: 13px 24px;
  border-radius: 11px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .2s, background .2s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(224,21,53,.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(224,21,53,.75); }
.btn-ghost {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-2);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,.08); transform: translateY(-2px); }
.btn-discord {
  background: #5865f2; color: #fff;
  box-shadow: 0 10px 30px -12px rgba(88,101,242,.7);
}
.btn-discord:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 30px; font-size: 15.5px; }
.btn-danger { background: rgba(255,46,67,.12); border: 1px solid rgba(255,46,67,.4); color: #ff6473; }
.btn-danger:hover { background: rgba(255,46,67,.2); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---- Navbar -------------------------------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: height .3s var(--ease), background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  height: 76px;
  background: rgba(7,9,15,.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nav-logo {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px;
  letter-spacing: -.02em;
  white-space: nowrap;
  min-width: 0;
}
.nav-logo img {
  width: 80px; height: 80px;
  border-radius: 10px;
  object-fit: contain;
  flex: 0 0 80px;
  display: block;
}
.nav-logo span { display: inline-block; }
.nav-logo .dot { color: var(--red); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  font-size: 14px; font-weight: 500;
  color: var(--text-dim);
  padding: 8px 14px; border-radius: 8px;
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255,255,255,.05); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-actions .btn { padding: 9px 18px; }
.nav-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--border-2);
  transition: border-color .2s, transform .2s;
  display: block;
}
.acct { position: relative; }
.acct-trigger {
  padding: 0; border: none; background: none; cursor: pointer;
  border-radius: 50%;
  transition: transform .2s;
}
.acct-trigger:hover .nav-avatar { border-color: var(--red); }
.acct-trigger:hover { transform: scale(1.05); }
.acct-trigger[aria-expanded="true"] .nav-avatar { border-color: var(--red); }

.acct-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 240px;
  background: rgba(20,20,22,.94);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 24px 50px -16px rgba(0,0,0,.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  z-index: 110;
  animation: acctFade .14s ease-out;
}
@keyframes acctFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.acct-head {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 12px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.acct-head img {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--border-2);
}
.acct-name {
  font-family: var(--font-display);
  font-weight: 600; font-size: 14.5px;
}
.acct-email {
  font-size: 12px; color: var(--text-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 170px;
}
.acct-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px; color: var(--text-dim);
  transition: background .15s, color .15s;
}
.acct-menu a:hover { background: rgba(255,255,255,.06); color: var(--text); }
.acct-menu a svg { width: 16px; height: 16px; opacity: .8; flex-shrink: 0; }
.acct-sep {
  height: 1px; background: var(--border);
  margin: 4px 0;
}
.acct-menu a.acct-danger { color: #ff8a93; }
.acct-menu a.acct-danger:hover { background: rgba(255,46,67,.1); color: #ff6473; }
.nav-burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }
.nav-cart {
  position: relative;
  padding: 9px 14px; border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-2);
  font-family: var(--font-display); font-weight: 600; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s, transform .2s;
}
.nav-cart:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.nav-cart .count {
  background: var(--grad); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px; min-width: 18px;
}

.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 99;
  background: rgba(9,11,18,.98);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 26px 50px -22px rgba(0,0,0,.75);
  padding: 12px 14px 18px;
  display: none; flex-direction: column; gap: 2px;
  max-height: calc(100dvh - var(--nav-h)); overflow-y: auto;
  transform: translateY(-12px); opacity: 0;
  transition: transform .3s var(--ease), opacity .3s;
}
.mobile-menu.open { display: flex; transform: translateY(0); opacity: 1; }
.mobile-menu a:not(.btn) {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px; border-radius: 11px;
  font-family: var(--font-display); font-size: 15.5px; font-weight: 500;
  color: var(--text-dim);
  transition: background .18s, color .18s;
}
.mobile-menu a:not(.btn)::after {
  content: ""; width: 7px; height: 7px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); opacity: .35;
}
.mobile-menu a:not(.btn):hover { background: rgba(255,255,255,.06); color: var(--text); }
.mobile-menu #mobileAuth {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 8px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.mobile-menu #mobileAuth .btn { margin-top: 6px; }

/* ---- Hero ---------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 60px) 0 90px;
  overflow: hidden;
}
.hero .wrap {
  display: grid; gap: 56px; align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: 1.05fr 1fr; gap: 72px; }
}
.hero-text { max-width: 560px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6.2vw, 76px);
  font-weight: 700; line-height: 1.04;
  letter-spacing: -.025em;
  margin: 22px 0 18px;
}
.hero p.lede {
  font-size: 18px; color: var(--text-dim);
  max-width: 520px; margin-bottom: 32px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats {
  display: flex; gap: 28px; margin-top: 48px;
  padding-top: 30px; border-top: 1px solid var(--border);
}
.hero-stats .stat .n {
  font-family: var(--font-display); font-weight: 700;
  font-size: 26px; letter-spacing: -.01em;
}
.hero-stats .stat .l {
  font-size: 12px; color: var(--text-mute);
  letter-spacing: .14em; text-transform: uppercase;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px; border-radius: 99px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-2);
  font-size: 12.5px; font-weight: 500; color: var(--text-dim);
}
.hero-badge .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 0 rgba(224,21,53,.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(224,21,53,.55); }
  70%  { box-shadow: 0 0 0 11px rgba(224,21,53,0); }
  100% { box-shadow: 0 0 0 0 rgba(224,21,53,0); }
}

/* 3D model viewer slot */
.hero-model {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 100%;
  align-self: start;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(224,21,53,.18), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.03), transparent),
    var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-model > canvas,
.hero-model > img,
.hero-model > .ud-viewer-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
model-viewer {
  width: 100%; height: 100%;
  background: transparent;
  --poster-color: transparent;
}
.hero-model-img,
.product-media-img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}

/* ---- swipeable viewer ---- */
.ud-viewer {
  position: relative;
  width: 100%; height: 100%;
  display: block;
  outline: none;
  touch-action: pan-y;
  user-select: none;
}
.ud-viewer-canvas {
  width: 100% !important; height: 100% !important;
  display: block;
  cursor: grab;
}
.ud-viewer-canvas:active { cursor: grabbing; }
.ud-viewer-loading {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-mute);
  transition: opacity .35s var(--ease);
  pointer-events: none;
}
.ud-viewer-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: rgba(20,20,20,.55);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  color: var(--text);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .25s, background .2s, transform .2s;
}
.ud-viewer:hover .ud-viewer-arrow,
.ud-viewer:focus-within .ud-viewer-arrow { opacity: 1; }
.ud-viewer-arrow:hover { background: rgba(40,40,40,.75); transform: translateY(-50%) scale(1.06); }
.ud-prev { left: 12px; }
.ud-next { right: 12px; }
.ud-viewer-dots {
  position: absolute; left: 0; right: 0; bottom: 14px;
  display: flex; justify-content: center; gap: 6px;
  pointer-events: auto;
}
.ud-dot {
  width: 6px; height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,.25);
  border: none; padding: 0;
  transition: background .2s, width .2s;
}
.ud-dot:hover { background: rgba(255,255,255,.5); }
.ud-dot.active { background: var(--red); width: 18px; }
@media (max-width: 700px) {
  .ud-viewer-arrow { opacity: 1; width: 36px; height: 36px; }
}

/* ---- Background FX ------------------------------------------- */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-fx > div { position: absolute; }
.bg-aurora {
  top: -28%; left: -15%; right: -15%; height: 100vh;
  background:
    radial-gradient(42% 54% at 27% 0%, rgba(224,21,53,.30), transparent 72%),
    radial-gradient(46% 58% at 75% 7%, rgba(224,21,53,.20), transparent 74%);
  filter: blur(55px);
  will-change: transform, opacity;
  animation: auroraDrift 22s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0%   { transform: translate3d(-3%, 0, 0) scale(1);   opacity: .72; }
  100% { transform: translate3d(4%, 2%, 0) scale(1.1); opacity: 1; }
}
.bg-grid {
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.5px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 92% 62% at 50% -6%, #000 22%, transparent 80%);
  mask-image: radial-gradient(ellipse 92% 62% at 50% -6%, #000 22%, transparent 80%);
}
.bg-grain {
  inset: 0; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bg-vignette {
  inset: 0;
  background: radial-gradient(ellipse 80% 74% at 50% 34%, transparent 50%, rgba(0,0,0,.55));
}

/* ---- Feature grid ------------------------------------------- */
.feature-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.feature-card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  transition: transform .25s var(--ease), border-color .2s, background .2s;
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-2);
  background: var(--card-2);
}
.feature-card .icon {
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--grad-soft);
  display: grid; place-items: center;
  margin-bottom: 18px;
  color: var(--red-soft);
}
.feature-card .icon svg { width: 22px; height: 22px; }
.feature-card h3 {
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  margin-bottom: 8px;
}
.feature-card p { font-size: 14.5px; color: var(--text-dim); }

/* ---- Product / Cart / Checkout ------------------------------- */
.product-layout {
  display: grid; gap: 48px;
  grid-template-columns: 1fr;
  padding: calc(var(--nav-h) + 48px) 0 80px;
}
@media (min-width: 900px) {
  .product-layout { grid-template-columns: 1.1fr 1fr; }
}
.product-media {
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  width: 100%;
  height: 0;
  padding-top: 100%;            /* enforces 1:1 even inside stretching grid rows */
  align-self: start;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.product-media > canvas,
.product-media > img,
.product-media > .ud-viewer-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.product-info h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -.02em;
  margin: 8px 0 14px;
}
.product-price {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 700;
  margin: 18px 0 22px;
}
.product-price .was { color: var(--text-mute); text-decoration: line-through; font-size: 18px; margin-right: 10px; }
.product-desc { color: var(--text-dim); margin-bottom: 28px; }

.variant-row { margin-bottom: 18px; }
.variant-row .label {
  font-size: 12px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 8px;
}
.variant-row .label .picked {
  color: var(--text); font-weight: 500;
  text-transform: none; letter-spacing: 0;
  margin-left: 8px;
}
.variant-options { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-options button {
  padding: 10px 16px; border-radius: 9px;
  background: var(--card-2);
  border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 500;
  color: var(--text);
  transition: border-color .2s, background .2s;
}
.variant-options button:hover { border-color: var(--border-2); }
.variant-options button.active {
  background: var(--grad-soft);
  border-color: var(--red);
  color: var(--text);
}

/* build option cards */
.build-options {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 520px) {
  .build-options { grid-template-columns: 1fr 1fr; }
}
.build-card {
  text-align: left;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  color: var(--text);
  transition: border-color .2s, background .2s, transform .2s;
}
.build-card:hover { border-color: var(--border-2); transform: translateY(-1px); }
.build-card.active {
  border-color: var(--red);
  background: linear-gradient(180deg, rgba(224,21,53,.07), rgba(255,255,255,.02));
  box-shadow: 0 0 0 2px rgba(224,21,53,.18);
}
.build-card.oos { opacity: .45; cursor: not-allowed; }
.build-card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
}
.build-card-label {
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
}
.build-card-price {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
}
.build-card-summary {
  font-size: 13px; color: var(--text-dim);
  line-height: 1.5;
}
.build-card-list {
  margin-top: 10px; padding-left: 16px;
  font-size: 12px; color: var(--text-mute);
  list-style: disc;
  line-height: 1.55;
}

/* color swatches */
.variant-options.swatches { gap: 10px; }
.variant-options.swatches button.swatch {
  width: 38px; height: 38px; padding: 0;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  background: transparent;
  position: relative;
  transition: border-color .2s, transform .2s;
}
.variant-options.swatches button.swatch:hover { transform: translateY(-2px); border-color: var(--text-mute); }
.variant-options.swatches button.swatch.active {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(224,21,53,.25);
}
.variant-options.swatches .swatch-dot {
  position: absolute; inset: 3px;
  border-radius: 50%;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.15), inset 0 -1px 1px rgba(0,0,0,.25);
}
.variant-options.swatches button.swatch.oos {
  opacity: .35; cursor: not-allowed;
}
.variant-options.swatches button.swatch.oos::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent calc(50% - 1px), var(--text-mute) calc(50% - 1px), var(--text-mute) calc(50% + 1px), transparent calc(50% + 1px));
  border-radius: 50%;
}

.qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-2); border-radius: 9px;
  overflow: hidden; margin-bottom: 22px;
}
.qty button {
  width: 38px; height: 38px;
  font-size: 18px; font-weight: 600;
  background: var(--card-2);
  transition: background .15s;
}
.qty button:hover { background: rgba(255,255,255,.06); }
.qty .val { width: 50px; text-align: center; font-weight: 600; font-family: var(--font-display); }

/* Cart + Checkout */
.cart-grid {
  display: grid; gap: 32px;
  grid-template-columns: 1fr;
  padding: calc(var(--nav-h) + 48px) 0 80px;
}
@media (min-width: 900px) {
  .cart-grid { grid-template-columns: 1.4fr 1fr; }
}
.cart-item, .summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.cart-item { display: flex; gap: 18px; margin-bottom: 14px; }
.cart-item img {
  width: 84px; height: 84px; border-radius: 10px;
  background: var(--card-2); object-fit: contain;
}
.cart-item .name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.cart-item .meta { font-size: 13px; color: var(--text-mute); margin-top: 3px; }
.cart-item .price { font-family: var(--font-display); font-weight: 700; margin-left: auto; }
.cart-item .remove {
  background: none; border: none; color: var(--text-mute);
  font-size: 13px; padding: 6px 0; margin-top: 4px;
  transition: color .2s;
}
.cart-item .remove:hover { color: #ff6473; }

.summary h3 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600;
  margin-bottom: 18px;
}
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.summary-row.tot {
  border-top: 1px solid var(--border);
  margin-top: 12px; padding-top: 14px;
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
}

.field {
  display: block; margin-bottom: 16px;
}
.field .label {
  font-size: 12px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14.5px;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--red);
  background: var(--card);
}
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }

/* ---- Footer -------------------------------------------------- */
.footer {
  margin-top: 80px;
  padding: 60px 0 30px;
  border-top: 1px solid var(--border);
}
.footer .wrap { display: grid; gap: 36px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .footer .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer .nav-logo { margin-bottom: 14px; }
.footer p { color: var(--text-dim); font-size: 14.5px; max-width: 380px; }
.footer h4 {
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-mute); margin-bottom: 16px;
}
.footer a { display: block; padding: 4px 0; color: var(--text-dim); font-size: 14.5px; transition: color .2s; }
.footer a:hover { color: var(--text); }
.footer .bottom {
  border-top: 1px solid var(--border);
  margin-top: 40px; padding-top: 20px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-mute);
}

/* ---- Toast / status ----------------------------------------- */
.toast {
  position: fixed; bottom: 22px; left: 50%;
  transform: translate(-50%, 24px); opacity: 0;
  padding: 12px 22px; border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border-2);
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: opacity .25s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255,46,67,.5); color: #ff8a93; }
.toast.ok { border-color: rgba(255,255,255,.35); color: #ffffff; }

/* ---- Reveal animations -------------------------------------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============================================================
   Responsive: tablet + phone
   ============================================================ */

/* ---- Tablet & smaller (< 900px) ---- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .section { padding: 64px 0; }
  .section-sm { padding: 48px 0; }
  .field-row { grid-template-columns: 1fr; }

  .hero {
    padding: calc(var(--nav-h) + 28px) 0 56px;
    min-height: auto;
  }
  .hero .wrap { gap: 36px; }
  .hero-text { max-width: 100%; }
  .hero p.lede { font-size: 16.5px; margin-bottom: 24px; }
  .hero-cta .btn { padding: 13px 20px; }
  .hero-stats {
    gap: 18px; margin-top: 30px; padding-top: 22px;
    flex-wrap: wrap;
  }
  .hero-stats .stat .n { font-size: 22px; }
  .hero-stats .stat .l { font-size: 11px; }

  .product-layout { gap: 30px; padding: 24px 0 60px; }
  .cart-grid { gap: 24px; padding: calc(var(--nav-h) + 28px) 0 60px; }

  .footer { margin-top: 56px; padding: 44px 0 24px; }
  .footer .bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ---- Phone (< 640px) ---- */
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }

  /* nav */
  .nav-cart {
    padding: 7px 10px;
    font-size: 0;          /* hide "Cart" label */
    gap: 6px;
  }
  .nav-cart .count { font-size: 11px; }
  .nav-cart svg { width: 18px; height: 18px; }
  .nav-actions { gap: 6px; }

  /* hero */
  .hero h1 { font-size: clamp(34px, 9vw, 48px); line-height: 1.05; }
  .hero p.lede { font-size: 15.5px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1; min-width: 0; padding: 13px 14px; font-size: 14px; }
  .hero-stats { gap: 14px; }
  .hero-stats .stat { min-width: 0; }
  .hero-stats .stat .n { font-size: 19px; }

  /* sections */
  .section { padding: 48px 0; }
  .section-head h2 { font-size: clamp(24px, 6.4vw, 32px); }
  .section-head { margin-bottom: 28px; }

  /* product page */
  .product-info h1 { font-size: clamp(24px, 6.4vw, 30px); }
  .product-price { font-size: 26px; margin: 14px 0 18px; }
  .product-desc { font-size: 14.5px; margin-bottom: 22px; }

  /* shorter viewer on phone so title + price + BUILD are above the fold */
  .product-media,
  .hero-model { padding-top: 75%; }   /* 4:3 instead of 1:1 */

  /* belt + braces: push viewer fully below the (transparent) nav */
  .product-media { margin-top: var(--nav-h); }
  .hero-model    { margin-top: var(--nav-h); }

  /* build cards stack */
  .build-options { grid-template-columns: 1fr; gap: 10px; }
  .build-card { padding: 14px 16px; }
  .build-card-list { font-size: 11.5px; }

  /* swatches: tighter + larger tap target via padding */
  .variant-options.swatches { gap: 8px; }
  .variant-options.swatches button.swatch { width: 34px; height: 34px; }
  .variant-row .label .picked { display: inline; }

  /* qty */
  .qty button { width: 42px; height: 42px; }
  .qty .val { width: 46px; }

  /* cart items */
  .cart-item { gap: 14px; padding: 16px; }
  .cart-item img { width: 64px; height: 64px; }
  .cart-item .price { font-size: 14px; }
  .cart-item .name { font-size: 15px; }

  /* summary */
  .summary { padding: 18px; }
  .summary h3 { font-size: 16px; }
  .summary-row { font-size: 13.5px; padding: 5px 0; }
  .summary-row.tot { font-size: 16px; }

  /* forms */
  .field input, .field select, .field textarea {
    font-size: 16px;     /* prevents iOS zoom */
    padding: 13px 14px;
  }

  /* footer */
  .footer .wrap { gap: 28px; }
  .footer h4 { margin-bottom: 10px; }

  /* account dropdown: don't overflow */
  .acct-menu { min-width: 220px; right: -6px; }
  .acct-email { max-width: 140px; }

  /* admin tables: side-scroll instead of squishing */
  table.adm { min-width: 540px; }
  .stat-card .n { font-size: 22px; }

  /* nav: hide the duplicate avatar/sign-in chip since mobile menu covers it */
  #navActions { display: none; }

  /* errpage */
  .errpage { padding: 60px 18px; }
  .errpage .ctas .btn { padding: 13px 18px; }

  /* mobile menu sizing */
  .mobile-menu a:not(.btn) { padding: 13px 12px; font-size: 14.5px; }
}

/* ---- Tiny phones (< 380px) ---- */
@media (max-width: 380px) {
  .hero-stats .stat .n { font-size: 17px; }
  .hero-stats .stat .l { font-size: 10px; letter-spacing: .1em; }
  .variant-options.swatches button.swatch { width: 32px; height: 32px; }
  .nav-logo { font-size: 16px; }
  .nav-logo img { width: 64px; height: 64px; flex-basis: 64px; }
}

/* ---- Touch device fine-tuning ---- */
@media (hover: none) {
  /* always show viewer arrows on touch (no hover state to reveal them) */
  .ud-viewer-arrow { opacity: 1; }
  /* meatier touch targets for nav avatar */
  .nav-avatar { width: 38px; height: 38px; }
}

/* ---- 404 ---------------------------------------------------- */
.errpage {
  min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 80px 24px;
}
.errpage .code {
  font-family: var(--font-display);
  font-size: clamp(120px, 22vw, 220px);
  line-height: 1; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 18px;
}
.errpage h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 36px); margin-bottom: 12px; }
.errpage p { color: var(--text-dim); max-width: 460px; margin: 0 auto 28px; }
.errpage .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
