/* ======================================================
   KSHOP — Anti-termite DTC store
   Warm-earth apothecary / hardware crossover
   ====================================================== */

:root {
  --cream: #f4f1ea;
  --cream-2: #ece7db;
  --cream-3: #ddd6c4;
  --ink: #1a1a1a;
  --ink-2: #2a2a28;
  --ink-muted: #6a6760;
  --forest: #2b3a2e;
  --forest-2: #1f2a22;
  --forest-3: #3a4c3d;
  --rust: #c85a2a;
  --rust-2: #a8481f;
  --rust-tint: #e9b79a;
  --line: rgba(26,26,26,0.14);
  --line-strong: rgba(26,26,26,0.3);

  --bg: var(--cream);
  --bg-2: var(--cream-2);
  --bg-3: var(--cream-3);
  --fg: var(--ink);
  --fg-muted: var(--ink-muted);
  --primary: var(--forest);
  --primary-fg: var(--cream);
  --accent: var(--rust);

  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-khmer-display: "Noto Serif Khmer", "Noto Sans Khmer", serif;
  --font-khmer-sans: "Noto Sans Khmer", "Noto Serif Khmer", sans-serif;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 0 rgba(26,26,26,0.06), 0 1px 2px rgba(26,26,26,0.04);
  --shadow-md: 0 2px 0 rgba(26,26,26,0.04), 0 8px 24px rgba(26,26,26,0.08);

  /* Type scale */
  --text-2xs:  12px;
  --text-xs:   13px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-lg:   18px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  28px;
  --text-4xl:  32px;
  --text-5xl:  40px;
}

[data-theme="dark"] {
  --bg: #14170f;
  --bg-2: #1c2019;
  --bg-3: #262b22;
  --fg: #efe9d7;
  --fg-muted: #9a9689;
  --line: rgba(239,233,215,0.14);
  --line-strong: rgba(239,233,215,0.28);
  --primary: #d4c39a;
  --primary-fg: #14170f;
  --accent: #e3784a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; }
html { overflow-x: clip; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; width: 0; height: 0; }
body { scrollbar-width: none; -ms-overflow-style: none; }
body::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Smooth theme transition — fires on data-theme change, not on page load */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition:
    background-color 220ms ease,
    border-color     220ms ease,
    color            180ms ease,
    fill             180ms ease !important;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: var(--text-base);
  line-height: 1.5;
}

/* --- Typography primitives --- */
.serif { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; }
.mono  { font-family: var(--font-mono); font-weight: 400; letter-spacing: 0.02em; }

/* --- Khmer type --- */
.km {
  font-family: var(--font-khmer-display);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
}
.km-sans {
  font-family: var(--font-khmer-sans);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.65;
}
/* Khmer display headlines need generous line-height — stacked vowels extend beyond cap height */
.display-xl.km { line-height: 1.45; letter-spacing: 0; }
.display-lg.km { line-height: 1.4;  letter-spacing: 0; }
.display-md.km { line-height: 1.35; letter-spacing: 0; }
.display-sm.km { line-height: 1.3;  letter-spacing: 0; }
/* Slightly shrink giant Khmer display so it fits next to Latin sizing */
.display-xl.km { font-size: clamp(46px, 6.8vw, 104px); }
.display-lg.km { font-size: clamp(36px, 4.6vw, 64px); }
.display-md.km { font-size: clamp(26px, 3.2vw, 44px); }
.display-sm.km { font-size: clamp(20px, 2.2vw, 30px); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
}

h1, h2, h3, h4 { margin: 0; font-weight: 400; }

.display-xl {
  font-family: var(--font-display);
  font-size: clamp(64px, 9vw, 140px);
  line-height: 0.92;
  letter-spacing: -0.025em;
}
.display-lg {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.02em;
}
.display-md {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1;
  letter-spacing: -0.015em;
}
.display-sm {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* --- Layout --- */
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 1080px; margin: 0 auto; padding: 0 32px; }

/* Checkout two-column grid → single column on tablet/mobile */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 56px;
  align-items: start;
}
@media (max-width: 900px) {
  .checkout-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .checkout-grid > *:last-child { position: static !important; }
}

/* --- Rules / dividers --- */
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }
.hr-strong { height: 1px; background: var(--line-strong); border: 0; margin: 0; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 140ms ease;
  letter-spacing: -0.005em;
  text-decoration: none;
}
.btn:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--cream); }
[data-theme="dark"] .btn-primary:hover { background: #efe9d7; color: var(--bg); border-color: #efe9d7; }

.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--rust-2); border-color: var(--rust-2); color: #fff; }

.btn-ghost {
  border-color: transparent;
  padding: 10px 14px;
}
.btn-ghost:hover { background: var(--bg-2); color: var(--fg); border-color: transparent; }

.btn-lg { padding: 16px 28px; font-size: var(--text-base); }
.btn-sq { border-radius: var(--radius); }

/* --- Chips / tags --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--fg);
  background: transparent;
}
.chip-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip-dot::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

/* --- Product placeholder (per system: striped SVG + mono caption) --- */
.ph {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.ph-stripes {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 14px,
    rgba(26,26,26,0.06) 14px 15px
  );
}
[data-theme="dark"] .ph-stripes {
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 14px,
    rgba(239,233,215,0.05) 14px 15px
  );
}
.ph-caption {
  position: absolute;
  top: 10px; left: 10px;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.ph-brand {
  position: absolute;
  bottom: 14px; right: 14px;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--fg-muted);
  letter-spacing: 0.1em;
}

/* --- Nav --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  padding-top: env(safe-area-inset-top, 0);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 4px; }
.nav-links { display: flex; gap: 2px; }
.nav-link {
  font-size: var(--text-xs);
  color: var(--fg);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  transition: background 120ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.nav-link-sub {
  font-size: var(--text-2xs);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  text-transform: uppercase;
  line-height: 1;
}
.nav-link:hover { background: var(--bg-2); }
.nav-link.is-active { background: var(--fg); color: var(--bg); }
.nav-link.is-active .nav-link-sub { color: var(--bg); opacity: 0.65; }

/* Theme toggle button */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  transform: rotate(12deg);
}

.brand {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--fg);
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.brand-mark {
  display: inline-block;
  width: 22px; height: 22px;
  border: 1.5px solid var(--fg);
  border-radius: 999px;
  position: relative;
  transform: translateY(4px);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: var(--accent);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  text-transform: uppercase;
  transform: translateY(-2px);
}

/* --- Cart button --- */
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cart-btn:hover { background: var(--bg-2); }
.cart-btn.is-active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.cart-btn.is-active .dot { background: var(--bg); color: var(--fg); }
.cart-btn .dot {
  width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xs);
  font-family: var(--font-sans);
  font-weight: 600;
}

/* --- Toast notifications --- */
.toast-stack {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink-2);
  color: var(--cream);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: var(--text-xs);
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  animation: toast-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: auto;
}
[data-theme="dark"] .toast { background: var(--cream); color: var(--ink-2); }
.toast-en { opacity: 0.65; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)  scale(1); }
}
.toast.leaving {
  animation: toast-out 200ms ease forwards;
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(0.97); }
}

/* --- Back to top button --- */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 45;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  transition: background 140ms ease, transform 140ms ease, opacity 200ms ease;
  opacity: 0;
  pointer-events: none;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: var(--fg); color: var(--bg); transform: translateY(-2px); }

/* --- Mobile nav drawer --- */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}
.mobile-drawer-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,15,13,0.55);
  z-index: 41;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  height: 100dvh;
  width: min(300px, 85vw);
  background: var(--bg);
  border-right: 1px solid var(--line);
  z-index: 42;
  transform: translateX(-100%);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  flex-direction: column;
  padding: 24px 0;
  gap: 0;
}
@media (max-width: 768px) {
  .mobile-menu-btn   { display: flex; }
  .mobile-drawer-scrim,
  .mobile-drawer     { display: flex; }
  .mobile-drawer-scrim.open { opacity: 1; pointer-events: auto; }
  .mobile-drawer.open { transform: translateX(0); }
  .theme-toggle { display: none; }
}
.mobile-drawer-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 28px;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--fg);
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 120ms ease;
}
.mobile-drawer-link:hover { background: var(--bg-2); }
.mobile-drawer-link.is-active { background: var(--bg-2); }
.mobile-drawer-link-kh { font-family: var(--font-khmer-sans); font-size: var(--text-base); }
.mobile-drawer-link-en { font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }

/* --- Cart drawer --- */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(15,15,13,0.5);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  height: 100dvh;
  width: min(460px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }

/* --- Tweak panel --- */
.tweaks {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 70;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
  box-shadow: var(--shadow-md);
  font-family: var(--font-sans);
}
.tweaks-title {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.seg {
  display: inline-flex;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--text-2xs);
  font-family: inherit;
  color: var(--fg-muted);
}
.seg button.is-on { background: var(--fg); color: var(--bg); }

/* --- Utility --- */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-0 { gap: 0; } .gap-1 { gap: 1px; } .gap-2 { gap: 2px; } .gap-3 { gap: 3px; }
.gap-4 { gap: 4px; } .gap-5 { gap: 5px; } .gap-6 { gap: 6px; }
.gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; }
.gap-14 { gap: 14px; } .gap-16 { gap: 16px; } .gap-18 { gap: 18px; }
.gap-20 { gap: 20px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.gap-40 { gap: 40px; } .gap-48 { gap: 48px; }
.items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; } .flex-wrap { flex-wrap: wrap; }
.text-muted { color: var(--fg-muted); }
.text-accent { color: var(--accent); }

/* --- Scroll nicety --- */
html { scroll-behavior: smooth; }
::selection { background: var(--accent); color: #fff; }

/* --- Marquee (subtle ticker) --- */
.ticker {
  border-block: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ticker-track {
  display: inline-flex;
  gap: 48px;
  padding: 14px 0;
  animation: tick 40s linear infinite;
  white-space: nowrap;
}
.ticker-track span { color: var(--fg-muted); }
.ticker-track em { color: var(--accent); font-style: normal; }
@keyframes tick {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Number input --- */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  height: 44px;
}
.stepper button {
  width: 44px; height: 44px;
  border: 0; background: transparent;
  color: var(--fg);
  font-size: 18px;
  cursor: pointer;
  font-family: inherit;
}
.stepper button:hover { background: var(--bg-2); }
.stepper .val {
  min-width: 44px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* --- Grid --- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .wrap, .wrap-narrow { padding: 0 20px; }
}

/* --- Focus --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Dark mode: rust accent fails contrast on near-black bg — use sand instead */
[data-theme="dark"] :focus-visible { outline-color: var(--primary); }

/* --- Skip-to-content link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  background: var(--primary);
  color: var(--primary-fg);
  padding: 10px 20px;
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { top: 0; }
.skip-target { position: absolute; width: 0; height: 0; overflow: hidden; }

/* --- Small helpers for PDP --- */
.swatch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg);
  transition: all 140ms ease;
  text-align: left;
  font: inherit;
  color: inherit;
}
.swatch:hover { border-color: var(--line-strong); }
.swatch.is-on {
  border-color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--fg);
}

/* --- Termite line-art mark (simple diamond; not an illustration) --- */
.mini-rule {
  display: inline-block;
  width: 28px; height: 1px;
  background: var(--fg);
  vertical-align: middle;
  margin-right: 10px;
}

/* ======================================================
   RESPONSIVE LAYOUT HELPERS
   (replaces inline gridTemplateColumns so media queries work)
   ====================================================== */
.split-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: end;
}
.split-science {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}
.split-product {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: stretch;
}
.split-tab {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
}
.photo-strip-3 {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 12px;
}

.pdp-outer       { padding: 24px 0 96px; }
.pdp-tabs-wrap   { margin-top: 96px; }

/* ── Rich text rendered content ── */
.pdp-rich               { font-size: 15px; line-height: 1.6; }
.pdp-rich p            { margin: 0 0 6px; }
.pdp-rich p:last-child { margin: 0; }
.pdp-rich ul, .pdp-rich ol { padding-left: 1.4em; margin: 4px 0; }
.pdp-rich li           { margin: 2px 0; line-height: 1.6; }
.pdp-rich strong       { font-weight: 600; }
.pdp-rich em           { font-style: italic; }

/* ── Quill editor theme overrides ── */
.ql-toolbar            { background: var(--bg-2) !important; border-color: var(--line-strong) !important; border-radius: 6px 6px 0 0 !important; padding: 6px 8px !important; }
.ql-container          { background: var(--bg) !important; border-color: var(--line-strong) !important; border-radius: 0 0 6px 6px !important; font-family: inherit !important; font-size: 13px !important; line-height: 1.55 !important; }
.ql-editor             { min-height: 80px; color: var(--fg) !important; padding: 10px 12px !important; }
.ql-editor.ql-blank::before { color: var(--fg-muted) !important; font-style: normal !important; }
.ql-snow .ql-stroke    { stroke: var(--fg) !important; }
.ql-snow .ql-fill      { fill: var(--fg) !important; }
.ql-snow .ql-picker-label { color: var(--fg) !important; }
.ql-snow .ql-picker-options { background: var(--bg) !important; border-color: var(--line-strong) !important; }
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke { stroke: var(--accent) !important; }
.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill   { fill: var(--accent) !important; }

@media (max-width: 768px) {
  .split-hero,
  .split-science,
  .split-product,
  .split-tab      { grid-template-columns: 1fr; gap: 28px; }
  .photo-strip-3  { grid-template-columns: 1fr; margin-top: 28px; }

  /* Nav: hide middle links, hide brand subtitle, fix height */
  .nav-links  { display: none; }
  .brand-sub  { display: none; }
  .nav-inner  { height: 56px; }

  /* PDP: disable sticky buy card on mobile */
  .pdp-buy-card { position: static !important; }
  .pdp-outer      { padding: 24px 0 48px; }
  .pdp-tabs-wrap  { margin-top: 48px; }

  /* Section padding reduction */
  section { padding-top: 48px !important; padding-bottom: 48px !important; }

  /* Admin overflowing tables scroll horizontally */
  .admin-table-scroll { overflow-x: auto; }
  .admin-table-inner  { min-width: 680px; }

  /* Admin metric grids: 2 columns on mobile */
  .admin-stats-3 { grid-template-columns: 1fr 1fr !important; }
  .admin-stats-4 { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 480px) {
  .grid-3, .grid-4, .split-product, .split-tab { grid-template-columns: 1fr; gap: 16px; }

  /* Tighter padding on very small phones */
  .wrap, .wrap-narrow { padding: 0 16px; }

  /* Admin metric grids: 1 column on smallest screens */
  .admin-stats-3,
  .admin-stats-4 { grid-template-columns: 1fr !important; }

  /* Checkout order summary below form on mobile */
  .checkout-grid { gap: 24px; }

  /* Nav brand tighter */
  .brand { font-size: 22px; }
}

/* Footer responsive grid */
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* PDP thumbnail strip — fewer columns on mobile */
@media (max-width: 640px) {
  .pdp-thumbs { grid-template-columns: repeat(4, 1fr) !important; gap: 6px !important; }
}
@media (max-width: 380px) {
  .pdp-thumbs { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ======================================================
   ANIMATIONS
   ====================================================== */
@keyframes ks-spin {
  to { transform: rotate(360deg); }
}
@keyframes ks-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ks-spin {
  to { transform: rotate(360deg); }
}

/* ======================================================
   REDUCED MOTION — pause animations for accessibility
   ====================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ticker-track { animation: none; overflow-x: auto; }
}
