/* ==========================================================================
   YWC STUDIO - css/styles.css
   3D Storefront & Configurator Engine (Your Way Customs)
   Faithful port of the Gemini reference (gemini-code-1786791660366.html),
   YMC -> YWC rebrand. 3 themes (dark / light / clear) + glassmorphism.
   ========================================================================== */

/* --------------------------------------------------------------------------
   COLOR PALETTES & DESIGN SYSTEM TOKENS
   -------------------------------------------------------------------------- */
:root, [data-theme="dark"] {
  --bg: #030712;
  --surface: rgba(15, 23, 42, 0.75);
  --surface-elevated: rgba(30, 41, 59, 0.88);
  --popover-bg: rgba(15, 23, 42, 0.99);
  --logo-glow: rgba(255, 255, 255, 0.32);
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.45);
  --card-border: rgba(255, 255, 255, 0.12);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --badge-bg: rgba(255, 255, 255, 0.06);
  --badge-text: #cbd5e1;
  --blur: 20px;
  --canvas-bg: radial-gradient(circle at 50% 20%, rgba(59, 130, 246, 0.18), transparent 30rem),
               radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.12), transparent 25rem),
               #030712;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-elevated: rgba(255, 255, 255, 0.96);
  --popover-bg: rgba(255, 255, 255, 0.99);
  --logo-glow: rgba(0, 0, 0, 0.42);
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.3);
  --card-border: rgba(15, 23, 42, 0.1);
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --badge-bg: rgba(15, 23, 42, 0.05);
  --badge-text: #334155;
  --blur: 20px;
  --canvas-bg: radial-gradient(circle at 50% 20%, rgba(59, 130, 246, 0.1), transparent 30rem),
               radial-gradient(circle at 80% 80%, rgba(244, 114, 182, 0.12), transparent 25rem),
               #f1f5f9;
}

[data-theme="clear"] {
  --bg: #070c18;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-elevated: rgba(255, 255, 255, 0.18);
  --popover-bg: rgba(10, 17, 30, 0.99);
  --logo-glow: rgba(255, 255, 255, 0.4);
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --accent-glow: rgba(56, 189, 248, 0.55);
  --card-border: rgba(255, 255, 255, 0.28);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.72);
  --badge-bg: rgba(255, 255, 255, 0.1);
  --badge-text: #e0f2fe;
  --blur: 36px;
  --canvas-bg: radial-gradient(circle at 50% 20%, rgba(56, 189, 248, 0.22), transparent 30rem),
               radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.2), transparent 28rem),
               #040711;
}

/* --------------------------------------------------------------------------
   RESET & BASE
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background 300ms ease, color 300ms ease;
}

button, input, select, textarea {
  font: inherit;
  border: none;
  background: none;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img, svg {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.8rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}
.skip-link:focus {
  left: 0.8rem;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  transition: background 300ms ease, border-color 300ms ease;
}

/* ==========================================================================
   CLEAN MINIMAL HEADER (Hamburger Left | Logo Center | Settings/Cart Right)
   ========================================================================== */
.nav-wrapper {
  position: sticky;
  top: 0.8rem;
  z-index: 50;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
}

.nav-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
}

.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 0.5rem;
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex: 0 0 auto;
  position: relative;
}

/* Icon Buttons */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--badge-bg);
  color: var(--text-primary);
  transition: all 180ms ease;
}

.icon-btn:hover, .icon-btn.active {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.brand-mark {
  display: block;
  height: 2.6rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  /* Glow is theme-opposite: dark/clear get a light glow, light theme gets a
     dark shadow so the logo reads on any background. Tight blur (4px) so it
     reads as a crisp shadow, not a broad gradient. */
  filter: drop-shadow(0 2px 4px var(--logo-glow));
}

.brand-badge {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cart-pill-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 2px 14px var(--accent-glow);
  transition: transform 180ms ease;
}
.cart-pill-btn:hover {
  transform: translateY(-1px);
}

.cart-count {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
}

/* Settings / Theme Dropdown Popover */
.settings-popover {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 3.5rem;
  width: 170px;
  padding: 0.5rem;
  border-radius: 16px;
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  z-index: 60;
  background: var(--popover-bg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.settings-popover.active {
  display: flex;
  animation: popIn 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.theme-opt-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 160ms ease;
}

.theme-opt-btn:hover, .theme-opt-btn.active {
  background: var(--surface-elevated);
  color: var(--accent);
}

.theme-opt-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.theme-opt-icon svg {
  flex: 0 0 auto;
}

/* ==========================================================================
   SLIDE-OVER MENU DRAWER (HAMBURGER MODAL)
   ========================================================================== */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  max-width: 340px;
  z-index: 91;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateX(-100%);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-overlay.active .menu-drawer {
  transform: translateX(0);
}

.menu-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.menu-nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 180ms ease;
  text-align: left;
}

.menu-nav-item.active, .menu-nav-item:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.menu-nav-item svg {
  flex: 0 0 auto;
}

/* ==========================================================================
   MAIN CONTENT CONTAINER
   ========================================================================== */
main {
  max-width: 1280px;
  margin: 1.5rem auto 4rem;
  padding: 0 1rem;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 250ms ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   VIEW 1: STOREFRONT & 3D TURNTABLE
   ========================================================================== */
.hero-banner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  border-radius: 28px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.hero-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  z-index: 2;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-tag svg {
  flex: 0 0 auto;
}

.hero-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 480px;
}

.hero-action-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.4rem;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all 180ms ease;
}

.primary-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--badge-bg);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 180ms ease;
}

.secondary-btn:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
}

.hero-3d-stage {
  position: relative;
  min-height: 340px;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: var(--canvas-bg);
  border: 1px solid var(--card-border);
}

#hero-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#hero-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

#hero-fallback svg {
  width: min(70%, 260px);
  height: auto;
}

.hero-3d-stage.no-webgl #hero-fallback {
  display: flex;
}

.hero-3d-stage.no-webgl #hero-canvas {
  display: none;
}

.stage-floating-chip {
  position: absolute;
  bottom: 0.8rem;
  left: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

/* Product Grid */
.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-heading {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
}

.category-filters {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  max-width: 100%;
}

.cat-chip {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--badge-bg);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 180ms ease;
}

.cat-chip:hover, .cat-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.product-card {
  border-radius: 20px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  transition: transform 220ms ease, border-color 220ms ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.product-thumb-box {
  position: relative;
  width: 100%;
  height: 190px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--canvas-bg);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-thumb-svg {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
}

.stock-tag {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  text-transform: uppercase;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.product-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
}

.product-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--card-border);
}

.product-price {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.add-cart-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  transition: all 180ms ease;
}

.add-cart-btn:hover {
  background: var(--accent-hover);
}

/* ==========================================================================
   VIEW 2: CUSTOM LAB (STL / VECTOR ESTIMATOR)
   ========================================================================== */
.lab-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

.lab-card {
  border-radius: 24px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.upload-dropzone {
  border: 2px dashed var(--card-border);
  border-radius: 16px;
  padding: 2.2rem 1rem;
  text-align: center;
  background: rgba(125, 125, 125, 0.03);
  cursor: pointer;
  transition: all 180ms ease;
}

.upload-dropzone:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

.lab-status-line {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--accent);
  min-height: 1.2em;
  font-weight: 600;
}

.material-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.mat-opt-btn {
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--badge-bg);
  text-align: left;
  transition: all 180ms ease;
}

.mat-opt-btn.active {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.15);
}

.mat-opt-title {
  font-weight: 700;
  font-size: 0.85rem;
}

.mat-opt-sub {
  font-size: 0.72rem;
  color: var(--accent);
  font-family: "Space Grotesk", sans-serif;
  margin-top: 0.15rem;
}

.transparent-ledger-box {
  border-radius: 16px;
  padding: 1.2rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ledger-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.ledger-line.total {
  padding-top: 0.65rem;
  border-top: 1px solid var(--card-border);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ledger-line.total span:last-child {
  color: var(--accent);
  font-size: 1.35rem;
  font-family: "Space Grotesk", sans-serif;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* ==========================================================================
   VIEW 3: ABOUT YWC & RADICAL HONEST PRICING
   ========================================================================== */
.about-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.about-hero-card {
  border-radius: 24px;
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.about-spec-card {
  padding: 1.3rem;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.about-spec-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin-bottom: 0.2rem;
  font-size: 1.35rem;
  line-height: 32px;
  text-align: center;
}

.about-spec-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}

.about-spec-text {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.55;
}

/* ==========================================================================
   VIEW 4: CONTACT STUDIO VIEW
   ========================================================================== */
.contact-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  max-width: 1060px;
  margin: 0 auto;
}

.contact-card {
  border-radius: 24px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.contact-channel-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem;
  border-radius: 12px;
  background: var(--badge-bg);
  border: 1px solid var(--card-border);
}

.contact-channel-icon {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 1.15rem;
  line-height: 1;
}

.queue-status {
  padding: 0.9rem;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.78rem;
  color: #10b981;
  line-height: 1.4;
}

.queue-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #10b981;
  margin-right: 0.3rem;
  vertical-align: middle;
}

/* ==========================================================================
   CART DRAWER & STRIPE MODAL
   ========================================================================== */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.cart-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  z-index: 101;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-overlay.active .cart-drawer {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--card-border);
}

.cart-items-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cart-item-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: var(--badge-bg);
  border: 1px solid var(--card-border);
}

.cart-item-info {
  flex: 1 1 auto;
}

.cart-item-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.cart-item-price {
  font-size: 0.8rem;
  color: var(--accent);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
}

.cart-item-remove {
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}
.cart-item-remove:hover {
  color: #ff5f6e;
  background: rgba(255, 95, 110, 0.12);
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 6px;
}

.qty-btn {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0 4px;
}

.cart-empty {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.cart-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.shipping-meter {
  background: rgba(125, 125, 125, 0.15);
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
}

.shipping-meter-fill {
  background: #10b981;
  height: 100%;
  width: 0%;
  transition: width 300ms ease;
}

.shipping-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

/* Stripe Modal */
.stripe-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.stripe-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.stripe-card {
  width: 100%;
  max-width: 480px;
  border-radius: 24px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.stripe-modal-overlay.active .stripe-card {
  transform: scale(1);
}

.stripe-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #635bff;
  color: #fff;
}

.stripe-submit-btn {
  width: 100%;
  padding: 0.9rem;
  border-radius: 12px;
  background: #635bff;
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 4px 15px rgba(99, 91, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 180ms ease;
}

.stripe-submit-btn:hover {
  background: #5046e5;
  transform: translateY(-1px);
}

.checkout-success-view {
  display: none;
  text-align: center;
  padding: 1.5rem 0;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.checkout-success-view.active {
  display: flex;
}

.success-check {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  border: 2px solid #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 130;
  padding: 0.7rem 1.2rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface-elevated);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1), opacity 240ms ease;
  max-width: min(90vw, 420px);
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 900px) {
  .hero-banner { grid-template-columns: 1fr; }
  .hero-3d-stage { min-height: 280px; }
  .lab-layout, .contact-layout { grid-template-columns: 1fr; }
  .nav-bar { padding: 0.5rem 0.85rem; }
  .cart-pill-btn .cart-label { display: none; }
  .cart-pill-btn { padding: 0.45rem 0.7rem; }
}

@media (max-width: 480px) {
  .hero-action-row { flex-direction: column; align-items: stretch; }
  .hero-action-row .primary-btn, .hero-action-row .secondary-btn { justify-content: center; }
  .material-selector-grid { grid-template-columns: 1fr 1fr; }
  /* Mobile header: guarantee breathing room between logo badge and right
     controls (gear + cart) down to 360px. Flex zones keep min gaps; text
     scaling (Chrome mobile) can no longer collapse the header. */
  .nav-bar {
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
  }
  .nav-center {
    justify-content: center;
    padding: 0 0.25rem;
    /* Nudge the brand slightly toward center-right, clear of the gear. */
    transform: translateX(0.6rem);
  }
  .brand-logo {
    gap: 0.4rem;
    min-width: 0;
    overflow: hidden;
  }
  .brand-mark {
    height: 2.2rem;
  }
  .nav-right { gap: 0.4rem; }
  .cart-pill-btn { padding: 0.4rem 0.6rem; }
  .icon-btn { width: 36px; height: 36px; }
}

/* Ultra-narrow fallback: if the STUDIO badge would still collide, hide it. */
@media (max-width: 360px) {
  .brand-badge { display: none; }
  .brand-logo { gap: 0; }
  .nav-bar { gap: 0.3rem; padding: 0.4rem 0.5rem; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto !important; }
}

/* ==========================================================================
   NOSCRIPT FALLBACK
   ========================================================================== */
.no-js-note {
  display: none;
}
html.no-js .no-js-note {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  padding: 2rem;
  text-align: center;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.7;
}
html.no-js .no-js-note a {
  color: var(--accent);
}
