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

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

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

  --radius:18px;
  --radiusSm:12px;

  --shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03);
  --shadowHover: 0 4px 14px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);

  --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,.35);
  --shadowHover:0 4px 18px rgba(0,0,0,.38);
  --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;
  }
}

/* Top accent bar — full-width gradient stripe pinned to the top of the viewport */
html::before{
  content:"";
  position:fixed;
  top:0; left:0; right:0;
  height:3px;
  background:linear-gradient(90deg, #2563eb 0%, #7c3aed 50%, #0ea5e9 100%);
  z-index:9999;
  pointer-events:none;
}

*{box-sizing:border-box}
html{
  height:100%;
  /* Reserve scrollbar gutter on all pages so the viewport width never
     shifts when a scrollbar appears or disappears between page navigations */
  scrollbar-gutter: stable;
}
/* Fallback for browsers that don't support scrollbar-gutter */
@supports not (scrollbar-gutter: stable){
  html{ overflow-y: scroll; }
}
body{
  margin:0;
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color:var(--text);
  background:
    radial-gradient(circle, rgba(37,99,235,.055) 1px, transparent 1px) 0 0 / 26px 26px,
    radial-gradient(900px 500px at 12% -8%, rgba(37,99,235,.08), transparent 45%),
    radial-gradient(900px 500px at 88% 0%, rgba(37,99,235,.05), transparent 50%),
    var(--bg);
  line-height:1.55;
}
[data-theme="dark"] body{
  background:
    radial-gradient(circle, rgba(59,130,246,.055) 1px, transparent 1px) 0 0 / 26px 26px,
    radial-gradient(900px 500px at 12% -8%, rgba(59,130,246,.07), transparent 45%),
    radial-gradient(900px 500px at 88% 0%, rgba(59,130,246,.04), transparent 50%),
    var(--bg);
}

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

main{ flex:1 0 auto; }

.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:flex-start;
  gap:14px;
  /* Fixed height prevents any text-metric change from reflowing the nav */
  height:64px;
  position:relative;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:-.5px;
  font-size:20px;
  white-space:nowrap;
  padding:6px 10px;
  border-radius:18px;
  flex-shrink:0;
  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:800; 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:18px;
  flex-wrap:nowrap;
  justify-content:flex-end;
  margin-left:auto;
  flex-shrink:1;
  min-width:0;
}
/* Standalone theme toggle — sits right of nav-links with a subtle separator */
.nav-theme-btn{
  flex-shrink:0;
  margin-left:4px;
  border-left:1px solid rgba(var(--text-rgb),.08);
  padding-left:14px;
}
.nav-links a{
  color:var(--muted);
  font-size:14px;
  font-weight:600;
  letter-spacing:-.1px;
  padding:12px 8px;
  border-radius:0;
  border:none;
  position:relative;
  transition: color 220ms ease;
}
.nav-links a:hover{
  color:var(--text);
}

/* Active page indicator — same underline, always visible */
.nav-links a.active{ color:var(--text); font-weight:700; }
.nav-links a.active::after{
  transform:scaleX(1) !important;
  opacity:1 !important;
}
/* Mobile active link */
.nav-mobile-links a.active{ color:var(--text); background:rgba(37,99,235,.07); font-weight:600; }

/* 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:700;
  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, 65px);
  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, 65px) + 10px);
    right:12px;
    width:min(70vw, 360px);
    max-width:360px;
    height:calc(100vh - var(--navH, 65px) - 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:none;
  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 16px;
  background:linear-gradient(180deg, rgba(37,99,235,.03) 0%, transparent 100%);
}
.panel-head h2{
  margin:0;
  font-size:20px;
  font-weight:700;
  letter-spacing:-.3px;
  display:flex;
  align-items:center;
  gap:10px;
}
.panel-head h2::before{
  content:"";
  display:inline-block;
  width:3px; height:18px;
  border-radius:3px;
  background:var(--accent);
  flex-shrink:0;
  opacity:.7;
}

/* 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;
  display:block; /* override flex — no accent bar for long headlines */
}
.seo-panel .panel-head h2::before{ display:none; }
@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;
  display:flex;
  align-items:center;
  gap:10px;
}
.section-head h2::before{
  content:"";
  display:inline-block;
  width:3px; height:20px;
  border-radius:3px;
  background:var(--accent);
  flex-shrink:0;
  opacity:.7;
}
.hint{ color:var(--muted); font-size:14px; }

/* Performance: skip rendering off-screen panels until near viewport.
   contain-intrinsic-size gives the browser a height estimate to reserve space,
   preventing layout shifts when the panel is rendered on scroll. */
.panel{ content-visibility:auto; contain-intrinsic-size:0 420px; }

/* Cards */
.card{
  background:var(--surface);
  border:1px solid transparent;
  border-radius:18px;
  box-shadow:var(--shadow);
  overflow:hidden;
  min-width:0;
  display:flex;
  flex-direction:column;
  transition: border-color 180ms ease;
}
.card:hover{ border-color: rgba(37,99,235,.13); }

/* .lift kept for semantic clarity — hover handled by .card:hover */
.lift{ will-change: auto; }
.card-pad{ padding:16px 20px; min-width:0; }
.title{
  font-weight:700;
  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; }

/* Scroll fade-in (IntersectionObserver) */
.fade-up{ opacity:0; transform:translateY(10px); transition:opacity 360ms ease, transform 360ms ease; }
.fade-up.is-visible{ opacity:1; transform:none; }

/* Category chips */
.chip-row{
  display:flex; flex-wrap:wrap; gap:6px;
  margin-bottom:14px;
}
.chip{
  display:inline-flex; align-items:center;
  padding:3px 11px;
  border-radius:999px;
  font-size:12px; font-weight:500;
  border:1px solid rgba(var(--text-rgb),.09);
  background:transparent;
  color:var(--muted);
  opacity:.8;
  cursor:pointer; text-decoration:none;
  white-space:nowrap;
  transition: border-color 150ms, color 150ms, background 150ms, opacity 150ms;
  -webkit-tap-highlight-color:transparent;
}
.chip:hover{ border-color:var(--accent); color:var(--accent); background:var(--accentSoft); opacity:1; }
.chip.chip-active{ background:var(--accent); color:#fff; border-color:var(--accent); opacity:1; }

/* 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 */
.panel--motm{
  background:linear-gradient(145deg, rgba(37,99,235,.04) 0%, transparent 60%);
}
.motm-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
  align-items:start;
}
/* Inline profile header: small logo + name side by side */
.motm-profile-head{ display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.motm-profile-info{ min-width:0; }
.motm-logo-wrap{
  width:44px; height:44px; flex:0 0 44px;
  border-radius:10px;
  background:#ffffff;
  border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden; padding:5px;
}
.motm-logo-wrap img{ max-width:100%; max-height:100%; object-fit:contain; mix-blend-mode:multiply; }
.motm-name{ font-size:17px; font-weight:800; letter-spacing:-.3px; margin:0; line-height:1.2; }
.motm-meta{ color:var(--muted); font-size:12px; margin-top:3px; }
.motm-about{ font-size:14px; line-height:1.6; margin-top:10px; color:var(--muted); }
.motm-right-card{ overflow:hidden; }
.motm-products-label{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.motm-products-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap:10px;
  padding:0 16px 16px;
}
.motm-product-tile{
  display:flex; flex-direction:column;
  border-radius:12px; overflow:hidden;
  background:var(--surface);
  border:1px solid rgba(var(--text-rgb),.07);
  text-decoration:none; color:inherit;
  transition: border-color 160ms, box-shadow 160ms;
}
.motm-product-tile:hover{ border-color:rgba(37,99,235,.18); box-shadow:var(--shadowHover); }
.motm-product-tile .media{ background:#f8fafc; border-radius:0; flex-shrink:0; }
.motm-product-tile .media img{ object-fit:contain; }
.motm-product-tile-name{ font-size:11px; font-weight:600; padding:7px 9px; line-height:1.35; }
@media (max-width:820px){
  .motm-grid{ grid-template-columns:1fr; }
}


/* 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:24px;
  overflow:hidden;
  border:none;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  background:var(--surface);
}
.hero.hero-image{ position:relative; background-size:cover; background-position:center; }
.hero.hero-image::before{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(
    180deg,
    rgba(2,6,23,.10) 0%,
    rgba(238,240,246,.52) 55%,
    rgba(238,240,246,.78) 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,.88);
  border:none;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-radius:18px;
  padding:22px 24px;
}
.hero h1{
  margin:12px 0 12px;
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight:800;
  letter-spacing:-1px;
  line-height:1.1;
  background: linear-gradient(135deg, #0f172a 20%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p{ margin:0; color:var(--muted); max-width:78ch; font-size:15px; line-height:1.6; }
.hero-kicker{ display:flex; align-items:center; gap:10px; color:var(--muted); font-size:13px; font-weight:500; }
@keyframes pulse-dot{
  0%,100%{ box-shadow:0 0 0 0 rgba(37,99,235,.5); }
  50%{ box-shadow:0 0 0 6px rgba(37,99,235,0); }
}
.hero-dot{
  width:9px; height:9px; border-radius:999px; background:var(--accent);
  animation: pulse-dot 2.4s ease infinite;
  flex-shrink:0;
}
.hero-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:18px; }
.hero-panel{
  background:rgba(255,255,255,.88);
  border:none;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-radius:18px;
  padding:18px 20px;
}

/* 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;
  height:130px;
  border-bottom:none;
  overflow:hidden;
  flex-shrink:0;
}
.media--logo img{
  width:auto;
  height:auto;
  max-width:calc(100% - 16px);
  max-height:90px;
  object-fit:contain;
  mix-blend-mode:multiply;
  background:transparent;
}
.item-card .media.media--logo{
  background:#ffffff;
  aspect-ratio:auto;
  height:130px;
}
@media (max-width:820px){
  .media--logo{ padding:16px; height:110px; }
  .media--logo img{ max-height:78px; }
}

/* 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;
  transition: opacity 500ms ease, max-height 500ms ease, padding 500ms ease, margin 500ms ease;
  overflow:hidden;
}
.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); }
.flash.is-dismissing{ opacity:0; max-height:0; padding:0; margin:0; }

/* Back-to-top */
.back-to-top{
  position:fixed; bottom:28px; right:24px; z-index:80;
  width:40px; height:40px; border-radius:999px;
  background:var(--accent); color:#fff;
  border:none; font-size:18px; line-height:1;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  box-shadow: 0 2px 12px rgba(37,99,235,.35);
  opacity:0; transform:translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events:none;
}
.back-to-top.is-visible{ opacity:1; transform:none; pointer-events:auto; }
.back-to-top:hover{ background:var(--accentHover); transform:translateY(-1px); }

/* Numbered pagination */
.pagination .page-num{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; border-radius:8px;
  border:1px solid var(--border);
  font-size:13px; font-weight:600; color:var(--muted);
  text-decoration:none; transition: border-color 150ms, color 150ms, background 150ms;
}
.pagination .page-num:hover{ border-color:var(--accent); color:var(--accent); }
.pagination .page-num.is-active{ background:var(--accent); color:#fff; border-color:var(--accent); }
.pagination .page-gap{ color:var(--muted); font-size:13px; padding:0 4px; user-select:none; }

/* Button loading state */
.btn.is-loading{ pointer-events:none; opacity:.7; }
.btn.is-loading::after{
  content:"";
  display:inline-block;
  width:12px; height:12px;
  border:2px solid rgba(255,255,255,.4);
  border-top-color:#fff;
  border-radius:999px;
  animation: btn-spin 600ms linear infinite;
  margin-left:6px; vertical-align:middle;
}
@keyframes btn-spin{ to{ transform:rotate(360deg); } }

/* 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%; }
}

/* Form row (side-by-side fields) */
.form-row{ display:flex; gap:16px; flex-wrap:wrap; }
.form-row .field{ flex:1; min-width:200px; }
.required{ color:var(--accent); font-weight:700; }
textarea{ resize:vertical; min-height:100px; }

/* Footer */
.footer{
  flex-shrink:0;
  position:relative;
  background:rgba(255,255,255,.70);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.footer::before{
  content:"";
  position:absolute;
  top:0; left:0; right:0; height:1px;
  background:linear-gradient(90deg, transparent 0%, rgba(37,99,235,.18) 30%, rgba(124,58,237,.15) 60%, transparent 100%);
}
.footer .container{ padding:20px 18px; color:var(--muted); font-size:13px; }


/* 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 !important}
  .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:700;
  }
  .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 0 auto; width:200px; position:relative; min-width:0; margin:0 18px; transition:width 280ms ease; }
.nav-search:focus-within{ width:320px; }
.nav-search input[type="search"]{
  width:100%; padding:7px 14px 7px 32px;
  border-radius:7px; border:none;
  background:rgba(var(--text-rgb),.07);
  font-size:13px; font-family:inherit; color:var(--text);
  transition:background 180ms;
  -webkit-appearance:none; appearance:none;
}
.nav-search input[type="search"]:focus{
  outline:none; background:rgba(var(--text-rgb),.10);
}
.nav-search-icon{
  position:absolute; left:8px; top:50%; transform:translateY(-50%);
  opacity:.35; pointer-events:none; font-size:15px; line-height:1;
}
/* Mobile search — appears inside the drawer, full width */
.nav-search-mobile{ display:none; padding:4px 14px 10px; }
.nav-search-mobile input[type="search"]{
  width:100%; padding:10px 14px 10px 36px; border-radius:8px;
  border:none;
  background:rgba(var(--text-rgb),.07);
  font-size:15px; font-family:inherit; color:var(--text);
  -webkit-appearance:none; appearance:none;
}
.nav-search-mobile input[type="search"]:focus{
  outline:none; background:rgba(var(--text-rgb),.11);
}
.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:26px; height:26px; border-radius:999px;
  border:none; background:transparent;
  cursor:pointer; font-size:13px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  opacity:.3;
  transition:opacity 180ms;
  -webkit-tap-highlight-color:transparent;
  padding:0;
}
.theme-toggle:hover{ opacity:.75; }
/* 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; }

/* ===== Manufacturer profile ===== */
.mfr-profile-grid{
  display:grid;
  gap:20px;
  grid-template-columns:minmax(260px,320px) 1fr;
  align-items:start;
}
.mfr-logo-card .media--logo{ height:200px; padding:28px; }
.mfr-logo-card .media--logo img{ max-height:150px; }
.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"] .nav-acc .acc-panel{ background:rgba(12,18,36,.98); }
[data-theme="dark"] .nav-mobile-links a{ color:var(--text); }
[data-theme="dark"] .nav-search-mobile input[type="search"]{ background:rgba(var(--text-rgb),.10); color:var(--text); }
[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); }
/* Dark mode hero: flip gradient direction so it stays readable */
[data-theme="dark"] .hero h1{
  background: linear-gradient(135deg, #e2e8f0 20%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="dark"] .hero-content,
[data-theme="dark"] .hero-panel{ background:rgba(15,23,42,.88); border:none; }
[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:rgba(255,255,255,.90); }
[data-theme="dark"] .media--logo{ background:rgba(255,255,255,.90); }
[data-theme="dark"] .media--logo img{ mix-blend-mode:normal; }
[data-theme="dark"] .motm-product-tile .media{ background:var(--surface2); }
[data-theme="dark"] .footer{ background:rgba(8,12,22,.70); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); }
[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); }

/* ── Gallery view (products/gallery) ───────────────────────────────────── */
.pg-wrap{ max-width:1640px; margin:0 auto; padding:0 12px 40px; }

/* Sticky search-only bar */
.pg-search-bar{
  position:sticky; top:0; z-index:30;
  background:var(--bg); padding:14px 0 12px;
}
.pg-search-input{
  display:block; width:100%; max-width:560px; margin:0 auto;
  font-size:17px; padding:12px 22px; border-radius:50px;
  border:2px solid var(--border); background:var(--surface);
  outline:none; transition:border-color .15s; color:var(--text);
}
.pg-search-input:focus{ border-color:var(--accent); }

/* Masonry grid — CSS columns, true varying heights */
.pg-masonry{ columns:5 160px; column-gap:8px; margin-top:12px; }
.pg-masonry.is-loading{ opacity:.4; pointer-events:none; transition:opacity .2s; }

.pg-item{
  break-inside:avoid; margin-bottom:8px; border-radius:10px;
  overflow:hidden; cursor:pointer; background:var(--surface);
  transition:transform .2s ease, box-shadow .2s ease;
}
.pg-item:hover{ transform:translateY(-3px); box-shadow:0 8px 24px rgba(0,0,0,.12); }
/* image scales subtly — overflow:hidden on .pg-item clips it */
.pg-item img{ width:100%; height:auto; display:block; transition:transform .3s ease; }
.pg-item:hover img{ transform:scale(1.04); }

.pg-spinner{ text-align:center; padding:24px; font-size:13px; color:var(--muted); display:none; }
.pg-spinner.visible{ display:block; }
.pg-sentinel{ height:1px; }

/* ── Full-page expanded view ─────────────────────────────────────────────── */
.pg-exp{
  position:fixed; inset:0; z-index:300;
  display:flex; flex-direction:column;
  background:var(--bg);
  opacity:0; pointer-events:none;
  transition:opacity .22s ease;
}
.pg-exp.is-open{ opacity:1; pointer-events:all; }

/* Topbar: [back] [search] [close] */
.pg-exp-topbar{
  display:grid; grid-template-columns:auto 1fr auto;
  align-items:center; gap:12px;
  padding:0 16px; height:64px; flex-shrink:0;
  background:var(--bg);
  border-bottom:1px solid var(--border);
  z-index:1;
}
.pg-exp-back{
  display:inline-flex; align-items:center; gap:7px;
  background:none; border:none; cursor:pointer;
  font-size:13px; color:var(--muted); padding:8px 10px;
  border-radius:8px; transition:background .15s, color .15s; white-space:nowrap;
}
.pg-exp-back:hover{ background:var(--surface); color:var(--text); }
.pg-exp-search-wrap{ display:flex; justify-content:center; }
.pg-exp-search{
  width:100%; max-width:520px; font-size:16px;
  padding:10px 22px; border-radius:50px;
  border:2px solid var(--border); background:var(--surface);
  outline:none; color:var(--text); transition:border-color .15s;
}
.pg-exp-search:focus{ border-color:var(--accent); }
.pg-exp-close{
  background:none; border:none; cursor:pointer;
  color:var(--muted); padding:8px 10px; border-radius:8px;
  font-size:22px; line-height:1; transition:background .15s, color .15s;
}
.pg-exp-close:hover{ background:var(--surface); color:var(--text); }

/* Body row: photo LEFT + panel RIGHT */
.pg-exp-body{ flex:1; display:flex; min-height:0; overflow:hidden; }

/* Photo area — white bg, drop-shadow on image */
.pg-exp-photo{
  flex:1; background:#fff;
  display:flex; align-items:center; justify-content:center;
  padding:36px; overflow:hidden; position:relative;
}
.pg-exp-img{
  max-width:100%; max-height:100%;
  object-fit:contain; display:block;
  filter:drop-shadow(0 8px 32px rgba(0,0,0,.13));
  transition:opacity .2s;
}
.pg-exp-img.loading{ opacity:0; }

/* Prev / Next arrows inside photo area */
.pg-exp-arrow{
  position:absolute; top:50%; transform:translateY(-50%);
  background:rgba(0,0,0,.06); border:none; color:rgba(0,0,0,.5);
  width:44px; height:44px; border-radius:50%; cursor:pointer;
  font-size:24px; display:flex; align-items:center; justify-content:center;
  transition:background .15s, color .15s; z-index:1; line-height:1;
}
.pg-exp-arrow:hover{ background:rgba(0,0,0,.13); color:rgba(0,0,0,.85); }
.pg-exp-arrow:disabled{ opacity:.15; pointer-events:none; }
.pg-exp-prev{ left:14px; }
.pg-exp-next{ right:14px; }

/* Keyboard hint */
.pg-exp-hint{
  position:absolute; bottom:12px; left:50%; transform:translateX(-50%);
  font-size:11px; color:rgba(0,0,0,.28);
  pointer-events:none; white-space:nowrap;
}

/* Right panel: info + actions + similar */
.pg-exp-panel{
  width:400px; flex-shrink:0;
  background:var(--bg);
  overflow-y:auto; overflow-x:hidden;
  padding:28px 26px 40px;
  display:flex; flex-direction:column;
  border-left:1px solid var(--border);
}
.pg-exp-name{ font-size:20px; font-weight:700; margin:0 0 6px; line-height:1.3; color:var(--text); }
.pg-exp-mfr{ font-size:13px; color:var(--muted); margin-bottom:8px; }
.pg-exp-badge{
  display:inline-block; padding:3px 10px; border-radius:50px; font-size:11px;
  background:var(--accentSoft); color:var(--accent); margin-bottom:22px;
}

/* Action buttons */
.pg-exp-actions{ display:flex; flex-direction:column; gap:8px; margin-bottom:28px; }
.pg-exp-act-primary{
  display:flex; align-items:center; justify-content:center; gap:7px;
  padding:12px 20px; border-radius:50px; border:none; cursor:pointer;
  font-size:14px; font-weight:600; background:var(--accent); color:#fff;
  text-decoration:none; transition:opacity .15s;
}
.pg-exp-act-primary:hover{ opacity:.88; }
.pg-exp-act-row{ display:flex; gap:8px; }
.pg-exp-act-soft{
  flex:1; display:flex; align-items:center; justify-content:center; gap:6px;
  padding:10px 14px; border-radius:50px; cursor:pointer;
  font-size:13px; font-weight:500;
  border:1.5px solid var(--border); background:var(--surface); color:var(--text);
  transition:border-color .15s, background .15s;
}
.pg-exp-act-soft:hover{ border-color:var(--accent); background:var(--accentSoft); }

/* Similar */
.pg-exp-sim-hdr{
  font-size:10px; font-weight:700; text-transform:uppercase;
  letter-spacing:.07em; color:var(--muted); margin:0 0 10px;
}
.pg-exp-sim-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.pg-exp-sim-item{
  border-radius:8px; overflow:hidden; cursor:pointer; background:var(--surface2);
  aspect-ratio:1; transition:transform .15s;
}
.pg-exp-sim-item:hover{ transform:scale(1.04); }
.pg-exp-sim-item img{ width:100%; height:100%; object-fit:cover; display:block; }

/* Toast */
.pg-toast{
  position:fixed; bottom:28px; left:50%; transform:translateX(-50%) translateY(10px);
  background:rgba(15,15,15,.88); color:#fff; padding:10px 22px;
  border-radius:50px; font-size:13px; z-index:400;
  opacity:0; pointer-events:none; transition:opacity .2s, transform .2s;
  white-space:nowrap;
}
.pg-toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

/* Dark-mode */
[data-theme="dark"] .pg-search-input{ background:var(--surface); border-color:rgba(var(--text-rgb),.14); }
[data-theme="dark"] .pg-item{ background:var(--surface); }
[data-theme="dark"] .pg-exp-photo{ background:#1c1c1e; }
[data-theme="dark"] .pg-exp-arrow{ background:rgba(255,255,255,.08); color:rgba(255,255,255,.55); }
[data-theme="dark"] .pg-exp-arrow:hover{ background:rgba(255,255,255,.18); color:#fff; }
[data-theme="dark"] .pg-exp-hint{ color:rgba(255,255,255,.28); }

/* Mobile: topbar | photo top | panel bottom */
@media(max-width:760px){
  .pg-masonry{ columns:3 130px; column-gap:6px; }
  .pg-masonry .pg-item{ margin-bottom:6px; }
  .pg-exp-topbar{ height:54px; padding:0 12px; gap:8px; }
  .pg-exp-body{ flex-direction:column; }
  .pg-exp-photo{ flex:none; height:48dvh; padding:16px; }
  .pg-exp-panel{
    width:100%; flex:1; padding:16px 16px 24px;
    border-left:none; border-top:1px solid var(--border);
  }
  .pg-exp-sim-grid{ grid-template-columns:repeat(4,1fr); }
  .pg-exp-arrow{ display:none; }
}
@media(max-width:480px){
  .pg-masonry{ columns:2 110px; }
  .pg-search-input{ font-size:15px; padding:10px 18px; }
  .pg-exp-photo{ height:40dvh; }
}
