:root{
  --bg:#f6f7fb;
  --surface:#ffffff;
  --surface2:#fbfcfe;
  --text:#0f172a;
  --muted:#64748b;
  --border:rgba(var(--text-rgb),.08);

  --accent:#2563eb;
  --accentHover:#1d4ed8;
  --accentSoft:rgba(37,99,235,.10);

  --clr-danger:#dc2626;
  --clr-danger-hover:#b91c1c;

  --radius:20px;
  --radiusSm:14px;

  --shadow: 0 1px 2px rgba(16,24,40,.06);
  --shadowHover: 0 10px 24px rgba(16,24,40,.10);

  --text-rgb: 15,23,42;
}

/* ===== Dark mode ===== */
[data-theme="dark"]{
  --bg:#0f172a;
  --surface:#1e293b;
  --surface2:#162035;
  --text:#f1f5f9;
  --muted:#94a3b8;
  --border:rgba(255,255,255,.08);
  --accent:#3b82f6;
  --accentHover:#60a5fa;
  --accentSoft:rgba(59,130,246,.15);
  --clr-danger:#f87171;
  --clr-danger-hover:#fca5a5;
  --shadow:0 1px 3px rgba(0,0,0,.40);
  --shadowHover:0 10px 24px rgba(0,0,0,.50);
  --text-rgb:241,245,249;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0f172a; --surface:#1e293b; --surface2:#162035;
    --text:#f1f5f9; --muted:#94a3b8; --border:rgba(255,255,255,.08);
    --accent:#3b82f6; --accentHover:#60a5fa; --accentSoft:rgba(59,130,246,.15);
    --clr-danger:#f87171; --clr-danger-hover:#fca5a5;
    --shadow:0 1px 3px rgba(0,0,0,.40); --shadowHover:0 10px 24px rgba(0,0,0,.50);
    --text-rgb:241,245,249;
  }
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  color:var(--text);
  background:
    radial-gradient(1000px 600px at 15% -10%, rgba(37,99,235,.10), transparent 45%),
    radial-gradient(1000px 600px at 85% 0%, rgba(37,99,235,.06), transparent 50%),
    var(--bg);
  line-height:1.55;
}

a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

.container{
  max-width:1320px;
  margin:0 auto;
  padding:18px 18px 30px;
}

/* Nav */
.nav{
  position:sticky; top:0; z-index:50;
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(140%) blur(10px);
  border-bottom:1px solid rgba(var(--text-rgb),.06);
}
.nav-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 0;
  position:relative;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:850;
  letter-spacing:-.5px;
  font-size:20px;
  white-space:nowrap;
  padding:6px 10px;
  border-radius:18px;
  transition: transform 220ms ease, background 220ms ease;
  -webkit-tap-highlight-color: transparent;
}
.brand-mark{
  position:relative;
  display:grid;
  place-items:center;
  border-radius:16px;
  overflow:hidden;
  padding:4px 8px;
}
.brand-logo{
  height:46px;
  width:auto;
  max-width:180px;
  transform-origin:center;
  transition: filter 240ms ease;
  border-radius:12px;
  display:block;
}
.brand-name{ font-weight:850; letter-spacing:-.5px; white-space:nowrap; }

@keyframes logoShine{
  0%{ transform: translateX(-140%) skewX(-18deg); opacity:0; }
  15%{ opacity:.85; }
  100%{ transform: translateX(140%) skewX(-18deg); opacity:0; }
}

.brand-mark::after{
  content:"";
  position:absolute;
  inset:-22% -36%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.65) 40%, rgba(255,255,255,.18) 55%, transparent 72%);
  transform: translateX(-140%) skewX(-18deg);
  opacity:0;
  pointer-events:none;
  mix-blend-mode: screen;
}

.brand:hover,
.brand:focus-visible{
  background: transparent;
  transform: none;
}
.brand:hover .brand-mark::after,
.brand:focus-visible .brand-mark::after{
  animation: logoShine 820ms cubic-bezier(.2,.8,.2,1);
}
.brand:hover .brand-logo,
.brand:focus-visible .brand-logo{
  filter: none;
}
@media (prefers-reduced-motion: reduce){
  .brand{ transition:none; }
  .brand-logo{ transition:none; }
  .brand:hover .brand-mark::after,
  .brand:focus-visible .brand-mark::after{ animation:none; }
}
.nav-links{
  display:flex;
  align-items:center;
  gap:22px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.nav-links a{
  color:var(--muted);
  font-size:16px;
  font-weight:650;
  letter-spacing:-.2px;
  padding:12px 10px;
  border-radius:0;
  border:none;
  position:relative;
  transition: color 220ms ease;
}
.nav-links a:hover{
  color:var(--text);
}

/* Ultra-clean hover: underline grows in (no chunky pill backgrounds) */
.nav-links a::after{
  content:"";
  position:absolute;
  left:6px;
  right:6px;
  bottom:2px;
  height:2px;
  border-radius:999px;
  background:rgba(37,99,235,.78);
  transform: scaleX(0);
  transform-origin:left;
  opacity:0;
  transition: transform 200ms ease, opacity 200ms ease;
}
.nav-links a:hover::after{
  transform: scaleX(1);
  opacity:1;
}

/* Mobile nav (dropdown accordion) */
.nav-acc{ position:relative; }
.nav-toggle{
  display:none;
  border:none;
  background:var(--surface);
  padding:10px 14px;
  border-radius:999px;
  font-weight:750;
  cursor:pointer;
  box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
  align-items:center;
  justify-content:center;
  gap:12px;
}
.nav-toggle:active{transform:translateY(1px)}

/* Burger -> X (pro, subtle) */
.nav-toggle .burger{
  width:18px;
  height:14px;
  display:inline-flex;
  flex-direction:column;
  justify-content:space-between;
  flex:0 0 auto;
}
.nav-toggle .burger span{
  height:2px;
  width:18px;
  background:rgba(var(--text-rgb),.70);
  border-radius:2px;
  transition: transform 180ms ease, opacity 140ms ease;
  transform-origin:center;
}
.nav-toggle[aria-expanded="true"] .burger span:nth-child(1){
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .burger span:nth-child(2){
  opacity:0;
}
.nav-toggle[aria-expanded="true"] .burger span:nth-child(3){
  transform: translateY(-6px) rotate(-45deg);
}

.nav-acc .acc-panel{
  position:absolute;
  z-index:70;
  right:0;
  top:calc(100% + 10px);
  width:min(420px, calc(100vw - 28px));
  background:rgba(255,255,255,.98);
  border:none;
  border-radius:18px;
  box-shadow: 0 18px 40px rgba(16,24,40,.14);
  padding:12px;
  margin-top:0;

  /* closed by default; JS sets max-height */
  max-height:0;
  opacity:0;
  transform: translateY(-10px);
  pointer-events:none;
  overflow:hidden;
  transition: opacity 160ms ease, transform 160ms ease, max-height 220ms ease;
}
.nav-acc.is-open .acc-panel{
  opacity:1;
  transform: translateY(0);
  pointer-events:auto;
}
.nav-mobile-links{ display:flex; flex-direction:column; gap:8px; }
.nav-mobile-links a{
  padding:13px 16px;
  font-size:16px;
  border:none;
  border-radius:14px;
  background:transparent;
  transition: background 200ms ease, color 200ms ease;
}
.nav-mobile-links a:hover{ background:rgba(37,99,235,.08); color:var(--text); }

/* Mobile nav drawer (70% width, no blur lock) */
.nav-scrim{
  position:fixed;
  left:0;
  right:0;
  top:var(--navH, 72px);
  bottom:0;
  background:rgba(var(--text-rgb),.24);
  opacity:0;
  pointer-events:none;
  transition: opacity 160ms ease;
  z-index:60;
}
.nav-acc.is-open .nav-scrim{
  opacity:1;
  pointer-events:auto;
}

@media (max-width: 820px){
  .nav-acc .acc-panel{
    position:fixed;
    top:calc(var(--navH, 72px) + 10px);
    right:12px;
    width:min(70vw, 360px);
    max-width:360px;
    height:calc(100vh - var(--navH, 72px) - 22px);
    max-height:none;
    overflow:auto;
    border-radius:20px;
    transform: translateX(110%);
    opacity:1;
    pointer-events:none;
    box-shadow: 0 24px 60px rgba(16,24,40,.18);
    transition: transform 200ms ease;
  }
  .nav-acc.is-open .acc-panel{
    transform: translateX(0);
    pointer-events:auto;
  }
}

/* Prevent overlay from covering the header */
body.nav-open{ overflow:hidden; }


/* Panels (module boxes) */
.panel{
  background:var(--surface);
  border:1px solid rgba(var(--text-rgb),.06);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  min-width:0;
}
.panel-pad{ padding:20px 24px; min-width:0; }
.panel-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  padding:20px 24px;
  border-bottom:1px solid rgba(var(--text-rgb),.04);
}
.panel-head h2{
  margin:0;
  font-size:22px;
  letter-spacing:-.4px;
}

/* Long SEO headline (homepage) — keep line breaks balanced */
.seo-panel .panel-head h2{
  max-width: 34ch;
  line-height:1.15;
  font-size:24px;
  letter-spacing:-.6px;
}
@supports (text-wrap: balance){
  .seo-panel .panel-head h2{ text-wrap: balance; }
}
/* Direct-child content in seo-panel has no panel-body wrapper — give it matching horizontal padding */
.seo-panel > ul,
.seo-panel > .grid{ padding-left:24px; padding-right:24px; }
.seo-panel > .grid{ padding-bottom:20px; }
.panel-sub{ color:var(--muted); font-size:14px; margin-top:4px; }
.panel-link{ color:var(--accent); font-weight:700; font-size:14px; }
.panel-body{ padding:20px 24px; }

/* Page layout: sidebar + content */
.page-grid{
  display:grid;
  gap:18px;
  align-items:start;
  grid-template-columns: minmax(280px, 360px) minmax(0,1fr);
}
.sidebar{ position:sticky; top:88px; }

/* Headings */
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin:22px 0 12px;
}
.section-head h2{
  margin:0;
  font-size:24px;
  letter-spacing:-.5px;
}
.hint{ color:var(--muted); font-size:14px; }

/* Cards */
.card{
  background:var(--surface);
  border:1px solid rgba(var(--text-rgb),.06);
  border-radius:18px;
  box-shadow:var(--shadow);
  overflow:hidden;
  min-width:0;
  display:flex;
  flex-direction:column;
  transition: transform 180ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.card:hover{ box-shadow: var(--shadowHover); border-color: rgba(var(--text-rgb),.10); }

/* Opt-in "lift" hover (use sparingly: product listings, key feature boxes) */
.lift{
  will-change: transform;
}
.lift:hover,
.lift:focus-visible{
  transform: translateY(-2px);
}
.card-pad{ padding:16px 20px; min-width:0; }
.title{
  font-weight:750;
  letter-spacing:-.2px;
  overflow-wrap:anywhere;
}
.meta{
  color:var(--muted);
  font-size:14px;
  line-height:1.4;
  overflow-wrap:anywhere;
}
.meta-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

/* Listing item cards */
.item-card .media{ background:#ffffff; aspect-ratio: 4 / 3; min-height:200px; }
.item-card .media.media--logo{ background:transparent; aspect-ratio:auto; min-height:120px; }
.item-card .card-pad{ padding:14px 18px 16px; }
.lineclamp-2{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* Pagination */
.pagination{ display:flex; align-items:center; gap:12px; padding:20px 0 8px; justify-content:center; flex-wrap:wrap; }

/* Breadcrumbs */
.breadcrumbs{ font-size:13px; color:var(--muted); margin:0 0 8px; }
.breadcrumbs ol{ list-style:none; padding:0; margin:0; display:flex; flex-wrap:wrap; align-items:center; gap:2px; }
.breadcrumbs li+li::before{ content:'›'; margin-right:2px; opacity:.4; }
.breadcrumbs a{ color:var(--muted); text-decoration:none; }
.breadcrumbs a:hover{ color:var(--text); }

/* Manufacturer of the Month */
.motm-banner{
  border-radius:18px;
  background: linear-gradient(130deg, rgba(37,99,235,.08) 0%, rgba(255,255,255,0) 60%);
  border:1px solid rgba(37,99,235,.12);
  padding:24px;
  display:grid;
  grid-template-columns: 180px 1fr;
  gap:24px;
  align-items:start;
}
.motm-logo-wrap{
  aspect-ratio:1/1;
  border-radius:20px;
  background:#ffffff;
  border:1px solid rgba(var(--text-rgb),.07);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden; padding:16px;
}
.motm-logo-wrap img{ max-width:100%; max-height:100%; object-fit:contain; mix-blend-mode:multiply; }
.motm-name{ font-size:22px; font-weight:800; letter-spacing:-.4px; margin:0; }
.motm-meta{ color:var(--muted); font-size:14px; margin-top:6px; }
.motm-about{ font-size:14px; line-height:1.65; margin-top:12px; max-width:60ch; }
.motm-products-strip{ margin-top:20px; display:flex; gap:10px; flex-wrap:wrap; }
.motm-product-tile{
  display:flex; flex-direction:column; flex:1 1 120px; max-width:160px;
  border-radius:14px; overflow:hidden;
  background:var(--surface);
  border:1px solid rgba(var(--text-rgb),.07);
  text-decoration:none; color:inherit;
  transition: transform 150ms, box-shadow 150ms;
}
.motm-product-tile:hover{ transform:translateY(-2px); box-shadow:var(--shadowHover); }
.motm-product-tile .media{ aspect-ratio:1/1; background:#f8fafc; border-radius:0; }
.motm-product-tile .media img{ object-fit:contain; }
.motm-product-tile-name{ font-size:12px; font-weight:650; padding:8px 10px; line-height:1.35; }
@media (max-width:820px){
  .motm-banner{ grid-template-columns:1fr; gap:16px; }
  .motm-logo-wrap{ max-width:120px; aspect-ratio:1/1; }
}
/* Old card — keep for backwards compat with potential other usages */
.motm-card{
  display:grid;
  grid-template-columns: 120px 1fr;
  gap:16px;
  align-items:center;
  background: linear-gradient(135deg, rgba(37,99,235,.10), rgba(255,255,255,.92) 55%);
}
.motm-media{
  aspect-ratio:1/1;
  border-radius:18px;
  background:rgba(255,255,255,.65);
  box-shadow: inset 0 0 0 1px rgba(var(--text-rgb),.06);
}
.motm-media img{ object-fit:cover; background:#fff; }

/* Admin MotM selector: avoid huge "empty" middle area */
.motm-admin-grid{
  display:grid;
  grid-template-columns: 1fr minmax(320px, 520px);
  gap:16px;
  align-items:start;
}
.motm-admin-grid form{
  justify-content:flex-end;
  width:100%;
}

/* Badges / chips (quiet) */
.badge{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  border:none;
  background:rgba(var(--text-rgb),.05);
  color:var(--muted);
  font-size:12px;
  line-height:1;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid transparent;
  background:var(--accent);
  color:#fff;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
  box-shadow: 0 1px 2px rgba(16,24,40,.12);
}
.btn:hover{ background:var(--accentHover); }
.btn:active{ transform:translateY(1px); }

/* Destructive action button */
.btn-danger{
  background: rgba(239,68,68,.95);
  border-color: rgba(239,68,68,.25);
  color:#fff;
}
.btn-danger:hover{ background: rgba(220,38,38,.98); }

.btn-ghost{
  background:transparent;
  border-color:var(--border);
  color:var(--text);
  box-shadow:none;
}
.btn-ghost:hover{ background:rgba(var(--text-rgb),.04); }

/* Forms */
.form{ display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; }
.field{ display:flex; flex-direction:column; gap:6px; min-width:180px; flex:1 1 180px; }

/* Homepage hero search: align fields nicely even when help text is present */
.hero-panel .form{ align-items:flex-start; }
.hero-panel .field-actions{ align-self:flex-end; }
label{ font-size:13px; color:var(--muted); }
input,select,textarea{
  font:inherit;
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  border:none;
  background:rgba(var(--text-rgb),.04);
  outline:none;
}
textarea{ min-height:120px; resize:vertical; }
input:focus,select:focus,textarea:focus{
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
  background:#fff;
}

/* Hero */
.hero{
  border-radius:28px;
  overflow:hidden;
  border:1px solid rgba(var(--text-rgb),.06);
  box-shadow: var(--shadow);
  background:var(--surface);
}
.hero.hero-image{ position:relative; background-size:cover; background-position:center; }
.hero.hero-image::before{
  content:"";
  position:absolute; inset:0;
  /* Let the background image read (less "washed out"), while keeping text legible */
  background: linear-gradient(
    180deg,
    rgba(2,6,23,.12) 0%,
    rgba(246,247,251,.54) 55%,
    rgba(246,247,251,.80) 100%
  );
}
.hero-grid{
  position:relative; z-index:1;
  display:grid;
  gap:14px;
  grid-template-columns: 1.15fr .95fr;
  padding:16px;
}
.hero-content{
  background:rgba(255,255,255,.86);
  border:1px solid rgba(var(--text-rgb),.06);
  backdrop-filter: blur(10px) saturate(150%);
  border-radius:22px;
  padding:18px;
}
.hero h1{
  margin:10px 0 10px;
  font-size:34px;
  letter-spacing:-.9px;
  line-height:1.12;
}
.hero p{ margin:0; color:var(--muted); max-width:78ch; }
.hero-kicker{ display:flex; align-items:center; gap:10px; color:var(--muted); font-size:13px; }
.hero-dot{ width:10px;height:10px;border-radius:999px;background:var(--accent); box-shadow:0 0 0 4px rgba(37,99,235,.12); }
.hero-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.hero-panel{
  background:rgba(255,255,255,.86);
  border:1px solid rgba(var(--text-rgb),.06);
  backdrop-filter: blur(10px) saturate(150%);
  border-radius:22px;
  padding:18px;
}

/* Media */
.media{ position:relative; overflow:hidden; background:#f1f5f9; aspect-ratio: 16 / 11; }
.media img{ width:100%; height:100%; object-fit:contain; opacity:0; transition:opacity 320ms ease; }
.media img.is-loaded{ opacity:1; }
.media.is-loaded::after{ opacity:0 !important; animation:none !important; }
@keyframes shimmer{
  0%  { background-position:-600px 0 }
  100%{ background-position: 600px 0 }
}
.media::after{
  content:''; position:absolute; inset:0; z-index:1; pointer-events:none;
  background:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.55) 50%,rgba(255,255,255,0) 100%);
  background-size:600px 100%;
  animation:shimmer 1.3s infinite;
  transition:opacity 320ms;
}
/* Don't shimmer logos — they already have solid bg */
.media--logo::after{ display:none; }

/* Manufacturer logos — white bg + multiply removes white logo backgrounds */
.media--logo{
  aspect-ratio:auto;
  background:#ffffff;
  padding:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:110px;
  border-bottom:none;
  overflow:hidden;
}
.media--logo img{
  width:auto;
  height:auto;
  max-width:100%;
  max-height:110px;
  object-fit:contain;
  mix-blend-mode:multiply;
  background:transparent;
}
.item-card .media.media--logo{
  background:#ffffff;
  aspect-ratio:auto;
  min-height:110px;
}
@media (max-width:820px){
  .media--logo{ padding:16px; min-height:90px; }
  .media--logo img{ max-height:90px; }
}

/* Product view: bigger image + modern split */
.product-split{ grid-template-columns: 1.35fr .95fr; }

/* Product media should NOT crop the image and should leave space for thumbnails */
.product-media{
  /* override .media defaults */
  aspect-ratio:auto;
  overflow:visible;
  background:transparent;
}
.product-media .carousel{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.product-media .carousel-track{
  width:100%;
  aspect-ratio: 4 / 3;
  min-height:520px;
  border-radius:16px;
  overflow:hidden;
  background:#fff;
}
.product-media .carousel-slide{ height:100%; }
.product-media .carousel-img{
  width:100%;
  height:100%;
  object-fit:contain;
  background:#fff;
  border-radius:0;
}
.product-media .carousel-dots{
  position:static;
  margin-top:-2px;
}
.product-media .carousel-thumbs{
  margin-top:0;
  justify-content:flex-start;
}
.product-media .carousel-thumbs .thumb{
  width:58px;
  height:58px;
  border-radius:14px;
  background:rgba(var(--text-rgb),.04);
}
.product-media .carousel-thumbs .thumb img{ object-fit:cover; opacity:.92; }

/* Product carousel (swipe) */
.carousel{ position:relative; width:100%; }
.carousel-track{
  display:flex;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-snap-type:x mandatory;
  gap:0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width:none;
}
.carousel-track::-webkit-scrollbar{ display:none; }
.carousel-slide{
  flex:0 0 100%;
  scroll-snap-align:start;
  display:flex;
  align-items:center;
  justify-content:center;
}
.carousel-img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:16px;
  cursor:zoom-in;
}

/* Product image should show full image (no crop) — handled above */
.carousel-dots{
  position:absolute;
  left:0; right:0;
  bottom:10px;
  display:flex;
  justify-content:center;
  gap:8px;
}
.dot{
  width:8px; height:8px;
  border-radius:999px;
  border:none;
  background:rgba(255,255,255,.55);
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  cursor:pointer;
  padding:0;
}
.dot.is-active{ background:rgba(255,255,255,.95); width:22px; }


.carousel-thumbs{
  display:flex;
  gap:10px;
  margin-top:10px;
  padding:0 2px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width:none;
}
.carousel-thumbs::-webkit-scrollbar{ display:none; }
.carousel-thumbs .thumb{
  width:64px;
  height:46px;
  border-radius:12px;
  border:none;
  padding:0;
  background:rgba(var(--text-rgb),.06);
  cursor:pointer;
  overflow:hidden;
}
.carousel-thumbs .thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  opacity:.92;
}
.carousel-thumbs .thumb.is-active{
  outline:2px solid rgba(37,99,235,.35);
  outline-offset:2px;
}

@media (max-width:820px){
  .product-media .carousel-track{ min-height:340px; }
}

/* Lightbox carousel (premium) */
.lb{
  position:fixed;
  inset:0;
  z-index:220;
  opacity:0;
  pointer-events:none;
  transition: opacity 180ms ease;
}
.lb.is-open{ opacity:1; }
/* keep capturing pointer events during the closing fade to prevent click-through */
.lb.is-open,
.lb.is-closing{ pointer-events:auto; }
.lb-scrim{ position:absolute; inset:0; background:rgba(235,240,248,.86); backdrop-filter:blur(32px) saturate(180%); -webkit-backdrop-filter:blur(32px) saturate(180%); }
.lb-sheet{
  position:fixed;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
  box-sizing:border-box;
  /* Let the scrim capture taps outside the viewer (esp. on mobile where the sheet spans the viewport) */
  pointer-events:none;
  transform: scale(.985);
  transition: transform 220ms ease;
}
.lb-sheet > *{ pointer-events:auto; }
.lb.is-open .lb-sheet{ transform: scale(1); }
.lb-track{
  /* Fallbacks first (for browsers that might not fully support min()/dvh) */
  width:96vw;
  max-width:1100px;
  height:72vh;
  max-height: calc(100vh - 170px);
  max-height: calc(100dvh - 170px);
  display:flex;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width:none;
  border-radius:22px;
  /* Clip children to rounded corners without disabling horizontal swipe */
  -webkit-clip-path: inset(0 round 22px);
  clip-path: inset(0 round 22px);
  box-shadow:0 24px 80px rgba(var(--text-rgb),.14), 0 2px 8px rgba(var(--text-rgb),.06);
  background:#ffffff;
}
.lb-track::-webkit-scrollbar{ display:none; }

@supports (height: 100dvh){
  .lb-track{ height:min(72dvh, 680px); max-height: calc(100dvh - 170px); }
}

/* Prefer min() widths where supported */
@supports (width: min(1100px, 96vw)){
  .lb-track{ width:min(1100px, 96vw); }
  .lb-thumbs{ width:min(1100px, 96vw); }
  .lb-dots{ width:min(1100px, 96vw); }
}
.lb-slide{
  flex:0 0 100%;
  scroll-snap-align:start;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:transparent;
  border-radius:22px;
  overflow:hidden;
}
.lb-img{
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
  display:block;
  object-fit:contain;
  background:#ffffff;
  border-radius:18px;
}
.lb-close{
  position:absolute;
  top: calc(18px + env(safe-area-inset-top)); right: calc(18px + env(safe-area-inset-right));
  z-index:5;
  touch-action: manipulation;
  width:44px; height:44px;
  border-radius:999px;
  border:1px solid rgba(var(--text-rgb),.10);
  background:rgba(255,255,255,.96);
  box-shadow: 0 2px 10px rgba(var(--text-rgb),.10);
  cursor:pointer;
  font-size:22px;
  line-height:44px;
}
.lb-thumbs{
  position:static;
  width:96vw;
  max-width:1100px;
  display:flex;
  justify-content:center;
  gap:10px;
  padding:0;
  margin-top:4px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.lb-thumbs::-webkit-scrollbar{ display:none; }
.lb-thumbs .thumb{
  width:62px;
  height:46px;
  border-radius:14px;
  border:none;
  padding:0;
  background:rgba(var(--text-rgb),.06);
  border:1px solid rgba(var(--text-rgb),.08);
  cursor:pointer;
  overflow:hidden;
}
.lb-thumbs .thumb img{ width:100%; height:100%; object-fit:cover; opacity:.9; }
.lb-thumbs .thumb.is-active{ outline:2px solid rgba(var(--text-rgb),.50); outline-offset:2px; }

.lb-dots{
  position:static;
  width:96vw;
  max-width:1100px;
  display:flex;
  justify-content:center;
  gap:8px;
  margin-top:2px;
}
/* Override dot colors for the light-scrim lightbox */
.lb .dot{ background:rgba(var(--text-rgb),.22); box-shadow:none; }
.lb .dot.is-active{ background:rgba(var(--text-rgb),.70); }

/* Mobile: make the viewer feel properly centered and prevent odd overflow */
@media (max-width:820px){
  .lb-sheet{ padding: calc(12px + env(safe-area-inset-top)) 10px calc(14px + env(safe-area-inset-bottom)); }
  /* Keep breathing room left/right and a bit more space above/below the image */
  .lb-track{
    width:96vw;
    max-width:96vw;
    height:66vh;
    max-height: calc(100vh - 160px);
    max-height: calc(100dvh - 160px);
    border-radius:16px;
  }
}
.lb-arrow{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  width:44px; height:44px;
  border-radius:999px;
  border:1px solid rgba(var(--text-rgb),.10);
  background:rgba(255,255,255,.96);
  box-shadow: 0 2px 10px rgba(var(--text-rgb),.10);
  cursor:pointer;
  font-size:26px;
  line-height:44px;
}
.lb-prev{ left:18px; }
.lb-next{ right:18px; }
@media (max-width:820px){
  .lb-arrow{ width:40px; height:40px; font-size:22px; line-height:40px; }
  .lb-prev{ left:10px; }
  .lb-next{ right:10px; }
  /* avoid overlapping the mobile menu button behind the overlay */
  .lb-close{ right:auto; left: calc(14px + env(safe-area-inset-left)); }
  .lb-thumbs{ gap:8px; }
  .lb-thumbs .thumb{ width:58px; height:42px; border-radius:12px; }
}


/* Grids */
.grid{ display:grid; gap:14px; }
.grid-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4{ grid-template-columns: repeat(4, minmax(0,1fr)); }

/* Action rows inside cards (used in product manage list) */
.card-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:auto; align-items:center; }
.card-actions form{ margin:0; display:flex; }

/* Feature cards */
.feature-grid{ gap:12px; }
.feature-card{ min-height: 140px; }
.feature-icon{
  width:44px; height:44px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:14px;
  background: var(--accentSoft);
  color: var(--accent);
  box-shadow: var(--shadow);
}
.feature-icon svg{ width:20px; height:20px; }

/* Flash */
.flash{
  border-radius:14px;
  border:1px solid rgba(37,99,235,.25);
  background:rgba(37,99,235,.08);
  padding:12px 14px;
  margin:16px 0;
}
.flash-warn{ border-color:rgba(245,158,11,.35); background:rgba(245,158,11,.12); }
.flash-success{ border-color:rgba(16,185,129,.30); background:rgba(16,185,129,.10); }
.flash-error{ border-color:rgba(239,68,68,.35); background:rgba(239,68,68,.10); }

/* Utilities */
.muted{ color:var(--muted); }
.prose{ color:var(--text); line-height:1.7; }
.prose p{ margin:0 0 10px; }
.prose ul{ margin:10px 0 10px 18px; }
.prose li{ margin:6px 0; }

/* Auth pages */
.auth-container{
  min-height: calc(100dvh - 44px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  padding:24px 12px;
}
.auth-container .card,
.auth-container .flash{ width: min(520px, 100%); }
.auth-container .flash{ margin:0; }

.auth-actions{ display:flex; gap:10px; align-items:center; width:100%; margin-top:4px; }
.auth-actions .btn{ flex:1; }
@media (max-width:720px){
  .auth-actions{ flex-direction:column; }
  .auth-actions .btn{ width:100%; }
}

/* Footer */
.footer{ border-top:1px solid var(--border); background:rgba(255,255,255,.70); }
.footer .container{ padding:18px; color:var(--muted); }


/* Image zoom (product) */
.zoomable{ cursor: zoom-in; }
.zoom-overlay{
  position:fixed; inset:0;
  background:rgba(var(--text-rgb),.55);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:200;
}
.zoom-overlay .zoom-img{
  max-width:min(1100px, 96vw);
  max-height:86vh;
  border-radius:20px;
  box-shadow:0 30px 90px rgba(0,0,0,.35);
}
.zoom-overlay .zoom-close{
  position:absolute;
  top:14px; right:14px;
  width:44px; height:44px;
  border-radius:999px;
  border:none;
  background:rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  cursor:pointer;
  font-size:20px;
  line-height:44px;
}

/* Responsive helpers */
.desktop-only{display:block}
.mobile-only{display:none}

/* Accordion */
.acc{margin-top:14px}
.acc-trigger{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  border:none;
  border-radius:14px;
  background:var(--surface);
  color:var(--text);
  font-weight:700;
  box-shadow: var(--shadow);
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
}
.acc-trigger:active{transform:translateY(1px)}
.acc-trigger .acc-icon{
  width:34px;height:34px;
  border-radius:999px;
  display:grid;place-items:center;
  background:var(--accentSoft);
  color:var(--accent);
  flex:0 0 auto;
}
.acc-trigger .acc-caret{
  width:10px;height:10px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(45deg);
  opacity:.7;
  margin-left:auto;
  transition:transform 180ms ease;
}
.acc-trigger[aria-expanded="true"] .acc-caret{ transform:rotate(225deg); }

.acc-panel{ margin-top:0; transition: max-height 220ms ease, opacity 220ms ease; }
.acc-panel.is-open{ margin-top:10px; }
.nav-acc .acc-panel.is-open{ margin-top:0; }
@media (prefers-reduced-motion: reduce){
  .acc-panel{transition:none}
  .acc-trigger .acc-caret{transition:none}
}

.acc-icon svg{ width:16px; height:16px; }

/* Responsive */
@media (max-width: 980px){
  .hero-grid{ grid-template-columns:1fr; }
  .grid-3{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-4{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .page-grid{ grid-template-columns:1fr; }
  .sidebar{ position:static; }
  .item-card .media{ min-height:220px; }
  .product-split{ grid-template-columns:1fr; }
  .product-media .carousel-track{ min-height:320px; }
  .motm-admin-grid{ grid-template-columns:1fr; }
  .mfr-profile-grid{ grid-template-columns:1fr !important; }
}
@media (max-width: 820px){
  .desktop-only{display:none}
  .mobile-only{display:block}
  .nav-links{display:none}
  .nav-toggle{display:inline-flex; align-items:center; gap:12px; padding:12px 16px; border-radius:999px; font-weight:800; }

  .brand-logo{ height:34px; max-width:150px; }
  .nav-inner{ padding:14px 0; }
  .nav-toggle .burger{ width:22px; height:16px; }
  .nav-toggle .burger span{ width:22px; height:3px; }
  .nav-toggle[aria-expanded="true"] .burger span:nth-child(1){ transform: translateY(6.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .burger span:nth-child(3){ transform: translateY(-6.5px) rotate(-45deg); }

  /* Mobile menu: right drawer (70% width) — no blur, header stays usable */
  .nav-acc{ position:relative; }

  .nav-mobile-links{ gap:6px; }
  .nav-mobile-links a{
    background:transparent;
    padding:12px 12px;
    border-radius:14px;
    font-weight:750;
  }
  .nav-mobile-links a:hover{ background:rgba(37,99,235,.08); }

}
@media (max-width: 620px){
  .grid-2,.grid-3,.grid-4{ grid-template-columns:1fr; }
  .container{ padding:18px 14px 26px; }
  .hero h1{ font-size:28px; }
  .brand{ font-size:16px; }
  .motm-card{ grid-template-columns: 90px 1fr; align-items:start; }
  .field{ min-width: 100%; }
  /* Admin: fetch-products page */
  .fp-products-head{ flex-wrap:wrap; gap:8px; }
  .fp-card{ flex-direction:column; }
  .fp-img{ width:100% !important; height:160px !important; border-radius:14px 14px 0 0 !important; }
  .fp-body{ padding:12px; }
  /* Field row pairs */
  .field-row{ flex-direction:column; }
}

/* On desktop, keep panels visible in accordions marked .acc--mobile */
@media (min-width: 821px){
  .acc--mobile .acc-trigger{display:none}
  .acc--mobile .acc-panel{
    margin-top:0;
    max-height:none !important;
    opacity:1 !important;
    pointer-events:auto !important;
    overflow:visible !important;
  }
}


/* Product image manager (edit) */
.img-manager{ display:flex; flex-direction:column; gap:14px; }
.cover-box{ position:relative; border-radius:18px; overflow:hidden; background:#eef2f7; box-shadow: var(--shadow); }
.cover-box img{ width:100%; height:100%; object-fit:contain; background:#fff; }
.cover-badge{
  position:absolute; left:12px; top:12px;
  background:rgba(255,255,255,.92);
  border:1px solid rgba(var(--text-rgb),.10);
  color:rgba(var(--text-rgb),.86);
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  box-shadow: var(--shadow);
}

.thumb-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:12px;
}
@media (max-width: 620px){
  .thumb-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

.thumb{
  position:relative;
  border-radius:16px;
  overflow:hidden;
  background:#eef2f7;
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow);
}
.thumb img{ width:100%; height:100%; object-fit:cover; }

.thumb-actions{
  position:absolute;
  top:10px; right:10px;
  display:flex;
  gap:8px;
  z-index:2;
}

.icon-btn{
  width:34px; height:34px;
  border-radius:999px;
  border:1px solid rgba(var(--text-rgb),.10);
  background:rgba(255,255,255,.92);
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow: 0 10px 24px rgba(16,24,40,.12);
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.icon-btn svg{ width:16px; height:16px; }
.icon-btn:hover{ background:#fff; transform: translateY(-1px); }
.icon-btn:active{ transform: translateY(0); }

.icon-btn.danger{ border-color: rgba(239,68,68,.26); }
.icon-btn.danger svg{ color: #ef4444; }

.small-note{ color:var(--muted); font-size:13px; }

/* Admin: image picker (Homepage settings) */
.img-picker{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap:12px;
  margin-top:10px;
}
.img-opt{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:10px;
  position:relative;
  border-radius:16px;
  border:1px solid rgba(var(--text-rgb),.10);
  background:rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  cursor:pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.img-opt:hover{ transform: translateY(-1px); box-shadow: var(--shadowHover); }
.img-opt input{ position:absolute; opacity:0; pointer-events:none; }
.img-opt img{ width:100%; height:100px; object-fit:cover; border-radius:12px; background:#fff; }
.img-opt.is-selected{ box-shadow: 0 0 0 4px rgba(37,99,235,.14), var(--shadowHover); border-color: rgba(37,99,235,.45); }

/* ===== Nav search ===== */
.nav-search{ flex:0 1 240px; position:relative; min-width:0; }
.nav-search input[type="search"]{
  width:100%; padding:9px 14px 9px 34px; border-radius:999px;
  border:1px solid rgba(var(--text-rgb),.10); background:rgba(var(--text-rgb),.04);
  font-size:14px; font-family:inherit; color:var(--text);
  transition:border-color 180ms,box-shadow 180ms;
  -webkit-appearance:none; appearance:none;
}
.nav-search input[type="search"]:focus{
  outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accentSoft);
}
.nav-search-icon{
  position:absolute; left:11px; top:50%; transform:translateY(-50%);
  opacity:.45; pointer-events:none; font-size:15px; line-height:1;
}
.nav-search input[type="search"]::-webkit-search-cancel-button{ opacity:.4; }
/* Mobile search — appears inside the drawer, full width */
.nav-search-mobile{ display:none; padding:4px 14px 8px; }
.nav-search-mobile input[type="search"]{
  width:100%; padding:10px 14px 10px 36px; border-radius:999px;
  border:1px solid rgba(var(--text-rgb),.10); background:rgba(var(--text-rgb),.04);
  font-size:15px; font-family:inherit; color:var(--text);
  -webkit-appearance:none; appearance:none;
}
.nav-search-mobile input[type="search"]:focus{
  outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accentSoft);
}
.nav-search-mobile .nav-search-icon{ left:26px; }
@media (max-width:820px){
  .nav-search{ display:none; }
  .nav-search-mobile{ display:block; }
}

/* ===== Theme toggle ===== */
.theme-toggle{
  flex-shrink:0;
  width:28px; height:28px; border-radius:999px;
  border:none; background:transparent;
  cursor:pointer; font-size:15px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  opacity:.45;
  transition:opacity 180ms;
  -webkit-tap-highlight-color:transparent;
  padding:0;
}
.theme-toggle:hover{ opacity:1; }
/* Mobile variant: full-width row at bottom of drawer */
.theme-toggle-mobile{
  width:100%; height:auto; border-radius:10px; padding:9px 14px;
  justify-content:flex-start; gap:9px; font-size:14px;
  opacity:.55; margin-top:4px;
  border-top:1px solid rgba(var(--text-rgb),.06);
}
.theme-toggle-mobile:hover{ opacity:.85; background:rgba(var(--text-rgb),.04); }
.theme-toggle-label{ font-weight:600; font-size:14px; color:var(--muted); }
.theme-icon-dark{ display:none; }
[data-theme="dark"] .theme-icon-light{ display:none; }
[data-theme="dark"] .theme-icon-dark{ display:inline; }
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .theme-icon-light{ display:none; }
  :root:not([data-theme="light"]) .theme-icon-dark{ display:inline; }
}

/* ===== Manufacturer profile ===== */
.mfr-profile-grid{
  display:grid;
  gap:20px;
  grid-template-columns:minmax(260px,320px) 1fr;
  align-items:start;
}
.mfr-logo-card .media--logo{ min-height:200px; padding:28px; }
.mfr-logo-card .media--logo img{ max-height:140px; }
.badge-verified{
  display:inline-flex; align-items:center; gap:5px;
  padding:4px 10px; border-radius:999px;
  background:rgba(22,163,74,.12); color:#15803d;
  font-size:12px; font-weight:700; border:none;
}
[data-theme="dark"] .badge-verified{ background:rgba(74,222,128,.12); color:#4ade80; }

/* ===== Dark mode overrides for hard-coded colors ===== */
[data-theme="dark"] body{
  background:
    radial-gradient(1000px 600px at 15% -10%,rgba(59,130,246,.06),transparent 45%),
    radial-gradient(1000px 600px at 85% 0%,rgba(59,130,246,.04),transparent 50%),
    var(--bg);
}
[data-theme="dark"] .nav{ background:rgba(8,12,22,.92); }
[data-theme="dark"] .media{ background:#1a2540; }
[data-theme="dark"] .media--logo{ background:#1e293b; }
[data-theme="dark"] .media::after{
  background:linear-gradient(90deg,rgba(26,37,64,0) 0%,rgba(26,37,64,.55) 50%,rgba(26,37,64,0) 100%);
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea{
  background:rgba(var(--text-rgb),.06); border:1px solid rgba(var(--text-rgb),.10); color:var(--text);
}
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus{ background:var(--surface); }
[data-theme="dark"] .hero-content,
[data-theme="dark"] .hero-panel{ background:rgba(30,41,59,.88); border-color:rgba(var(--text-rgb),.08); }
[data-theme="dark"] .motm-media{ background:rgba(var(--text-rgb),.06); }
[data-theme="dark"] .motm-banner{ background:linear-gradient(130deg,rgba(59,130,246,.07) 0%,transparent 60%); border-color:rgba(59,130,246,.15); }
[data-theme="dark"] .motm-logo-wrap{ background:var(--surface2); }
[data-theme="dark"] .motm-product-tile .media{ background:var(--surface2); }
[data-theme="dark"] .footer{ background:rgba(8,12,22,.70); }
[data-theme="dark"] .lb-scrim{ background:rgba(4,8,18,.90); backdrop-filter:blur(24px); -webkit-backdrop-filter:blur(24px); }
[data-theme="dark"] .lb-track{ background:#1e293b; box-shadow:0 24px 80px rgba(0,0,0,.5); }
[data-theme="dark"] .lb-img{ background:#1e293b; }
[data-theme="dark"] .lb-close,
[data-theme="dark"] .lb-arrow{ background:rgba(30,41,59,.96); border-color:rgba(var(--text-rgb),.15); color:var(--text); }
[data-theme="dark"] .lb-thumbs .thumb{ background:rgba(var(--text-rgb),.08); }
[data-theme="dark"] .img-opt,
[data-theme="dark"] .icon-btn,
[data-theme="dark"] .cover-badge{ background:var(--surface); color:var(--text); }
