/* ============================================================
   CATALOG â€” Premium FMCG Brand Portfolio Showcase
   Pages: brand_list.html & brand_detail.html
   ============================================================ */

/* ----- Design Tokens ----- */
:root {
  --cat-green: #1f7a4d;
  --cat-green-soft: rgba(31, 122, 77, 0.07);
  --cat-green-medium: rgba(31, 122, 77, 0.12);
  --cat-green-glow: rgba(31, 122, 77, 0.18);
  --cat-surface: #fff;
  --cat-surface-alt: #f8faf7;
  --cat-border: rgba(0, 0, 0, 0.06);
  --cat-border-hover: rgba(31, 122, 77, 0.25);
  --cat-shadow-xs: 0 1px 3px rgba(10, 32, 20, 0.03);
  --cat-shadow-sm: 0 4px 12px rgba(10, 32, 20, 0.04);
  --cat-shadow-md: 0 8px 24px rgba(10, 32, 20, 0.06);
  --cat-shadow-lg: 0 16px 40px rgba(10, 32, 20, 0.09);
  --cat-radius-sm: 8px;
  --cat-radius: 14px;
  --cat-radius-lg: 18px;
  --cat-transition: 0.25s cubic-bezier(0.33, 1, 0.68, 1);
}


/* ============================================================
   BRAND LISTING PAGE â€” bl-*
   ============================================================ */

/* ----- Hero ----- */
.bl-hero {
  padding: calc(var(--nav-h, 72px) + 48px) 0 36px;
  background: linear-gradient(180deg, rgba(31, 122, 77, 0.035) 0%, transparent 70%);
  text-align: center;
}
.bl-breadcrumb {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  font-size: 0.8rem; color: var(--text-muted, #647a6e); margin-bottom: 24px;
}
.bl-breadcrumb a {
  color: var(--cat-green); text-decoration: none; font-weight: 600;
  transition: opacity 0.15s;
}
.bl-breadcrumb a:hover { opacity: 0.7; }
.bl-hero-title { margin: 0 0 14px; }
.bl-hero-kicker {
  display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--cat-green); margin-bottom: 10px;
}
.bl-hero-main {
  font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 850; line-height: 1.08;
  color: var(--text, #0a2014); letter-spacing: -0.025em;
}
.bl-hero-sub {
  max-width: 540px; margin: 0 auto 32px; color: var(--text-muted, #647a6e);
  font-size: 1rem; line-height: 1.6;
}

/* ----- Search Pill ----- */
.bl-search {
  display: flex; align-items: center; gap: 12px;
  max-width: 480px; margin: 0 auto 28px;
  background: var(--cat-surface); border: 1.5px solid var(--cat-border);
  border-radius: 50px; padding: 13px 22px;
  box-shadow: var(--cat-shadow-xs);
  transition: border-color var(--cat-transition), box-shadow var(--cat-transition);
}
.bl-search:focus-within {
  border-color: var(--cat-green);
  box-shadow: 0 0 0 5px rgba(31, 122, 77, 0.07);
}
.bl-search svg { color: var(--text-muted, #647a6e); flex-shrink: 0; }
.bl-search input {
  border: 0; outline: 0; background: transparent; width: 100%;
  font: inherit; font-size: 0.95rem; color: var(--text, #0a2014);
}
.bl-search input::placeholder { color: #a3b5aa; }
.bl-search-clear {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  color: var(--text-muted, #647a6e); transition: background 0.15s;
}
.bl-search-clear:hover { background: rgba(0,0,0,0.06); }

/* ----- Alphabet Jump ----- */
.bl-alpha {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 3px;
  max-width: 720px; margin: 0 auto;
}
.bl-alpha-link {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  font-size: 0.8rem; font-weight: 600; text-decoration: none;
  color: var(--text-muted, #647a6e); transition: all 0.18s;
}
.bl-alpha-link:hover:not(.is-empty) {
  background: var(--cat-green-soft); color: var(--cat-green);
}
.bl-alpha-link.is-active {
  background: var(--cat-green); color: #fff; font-weight: 700;
  box-shadow: 0 2px 8px rgba(31, 122, 77, 0.25);
}
.bl-alpha-link.is-empty {
  opacity: 0.22; pointer-events: none;
}
.bl-alpha-all {
  width: auto; padding: 0 16px; font-weight: 700;
  border: 1.5px solid var(--cat-border); border-radius: 10px;
  margin-left: 10px;
}
.bl-alpha-all.is-active {
  border-color: var(--cat-green); background: var(--cat-green); color: #fff;
}

/* ----- Sticky Stats Bar ----- */
.bl-stats-bar {
  position: sticky; top: var(--nav-h, 72px); z-index: 10;
  background: rgba(249, 250, 247, 0.85);
  border-bottom: 1px solid var(--cat-border);
  padding: 11px 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.bl-stats-bar .container {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 20px;
}
.bl-stats-text {
  margin: 0; font-size: 0.84rem; color: var(--text-muted, #647a6e);
}
.bl-stats-text strong { color: var(--text, #0a2014); font-weight: 700; }
.bl-stats-sort { display: flex; align-items: center; gap: 8px; }
.bl-sort-label {
  font-size: 0.78rem; color: var(--text-muted, #647a6e); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.bl-sort-select {
  padding: 7px 34px 7px 13px; border-radius: 8px; border: 1.5px solid var(--cat-border);
  background: var(--cat-surface); font: inherit; font-size: 0.83rem;
  color: var(--text, #0a2014); cursor: pointer; font-weight: 600;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235a7264' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color 0.2s;
}
.bl-sort-select:hover { border-color: var(--cat-green-medium); }
.bl-sort-select:focus { outline: none; border-color: var(--cat-green); box-shadow: 0 0 0 3px rgba(31,122,77,0.1); }

/* ----- Brand Grid ----- */
.bl-grid-section { padding: 28px 0 80px; }
.bl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
@media (max-width: 600px) {
  .bl-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ----- Brand Card ----- */
.bl-card {
  background: var(--cat-surface);
  border: 1.5px solid var(--cat-border);
  border-radius: var(--cat-radius);
  transition: transform var(--cat-transition), box-shadow var(--cat-transition), border-color var(--cat-transition);
  overflow: hidden;
  position: relative;
}
.bl-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(31,122,77,0.03) 0%, transparent 50%);
  opacity: 0; transition: opacity var(--cat-transition);
  pointer-events: none; z-index: 0;
}
.bl-card:hover::before { opacity: 1; }
.bl-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--cat-shadow-lg);
  border-color: var(--cat-border-hover);
}
.bl-card-link {
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 22px 22px; text-decoration: none; color: inherit;
  position: relative; z-index: 1; height: 100%;
}

/* Logo area */
.bl-card-logo {
  width: 100%; height: 90px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; border-radius: 12px; background: var(--cat-surface-alt);
  border: 1px solid rgba(0,0,0,0.02); padding: 14px;
}
.bl-card-logo img { max-width: 100%; max-height: 62px; object-fit: contain; }
.bl-card-logo-fallback {
  font-size: 1.4rem; font-weight: 850; color: var(--cat-green);
  letter-spacing: 0.06em;
}

/* Product count badge */
.bl-card-count-badge {
  position: absolute; top: 14px; right: 14px;
  font-size: 0.68rem; font-weight: 700; padding: 4px 11px;
  border-radius: 999px; background: var(--cat-green-soft); color: var(--cat-green);
  letter-spacing: 0.01em;
}

/* Body */
.bl-card-body { text-align: center; min-height: 0; }
.bl-card-name {
  margin: 0 0 12px; font-size: 1.08rem; font-weight: 750; line-height: 1.3;
  color: var(--text, #0a2014); letter-spacing: -0.01em;
}

/* Arrow reveal */
.bl-card-arrow {
  margin-top: auto; padding-top: 6px; color: var(--cat-green); opacity: 0;
  transform: translateX(-8px); transition: all var(--cat-transition);
}
.bl-card:hover .bl-card-arrow { opacity: 1; transform: translateX(0); }

/* ----- Empty State ----- */
.bl-empty {
  text-align: center; padding: 80px 20px;
}
.bl-empty-icon { color: var(--text-muted, #647a6e); margin-bottom: 24px; opacity: 0.3; }
.bl-empty-title {
  margin: 0 0 8px; font-size: 1.5rem; font-weight: 750; color: var(--text, #0a2014);
}
.bl-empty-desc { color: var(--text-muted, #647a6e); margin: 0 0 28px; font-size: 0.95rem; }

/* ----- Bottom CTA ----- */
.bl-cta {
  text-align: center; padding: 52px 20px 0;
  border-top: 1px solid var(--cat-border); margin-top: 48px;
}
.bl-cta-text { color: var(--text-muted, #647a6e); margin: 0 0 18px; font-size: 0.95rem; }


/* ============================================================
   BRAND DETAIL PAGE â€” bd-*
   ============================================================ */

/* ----- Breadcrumb ----- */
.bd-breadcrumb {
  padding: calc(var(--nav-h, 72px) + 16px) 0 0;
  border-bottom: 1px solid var(--cat-border);
}
.bd-breadcrumb .container {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 15px;
}
.bd-breadcrumb, .bd-breadcrumb a {
  font-size: 0.82rem; color: var(--text-muted, #647a6e); text-decoration: none;
}
.bd-breadcrumb a:hover { color: var(--cat-green); }
.bd-breadcrumb [aria-current="page"] {
  color: var(--text, #0a2014); font-weight: 700;
}

/* ----- Brand Hero Card ----- */
.bd-hero {
  padding: 32px 0 28px;
  background: linear-gradient(180deg, rgba(31, 122, 77, 0.04) 0%, transparent 60%);
}
.bd-hero-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 28px 36px;
  background: var(--cat-surface); border: 1.5px solid var(--cat-border);
  border-radius: var(--cat-radius-lg); padding: 32px 36px;
  box-shadow: var(--cat-shadow-sm);
}
.bd-hero-logo {
  width: 180px; height: 110px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border-radius: 14px; background: var(--cat-surface-alt);
  border: 1px solid rgba(0,0,0,0.03); padding: 18px;
}
.bd-hero-logo img { max-width: 100%; max-height: 74px; object-fit: contain; }
.bd-hero-logo-text {
  font-size: 2rem; font-weight: 850; color: var(--cat-green); letter-spacing: -0.02em;
}
.bd-hero-info { flex: 1; min-width: 200px; }
.bd-hero-kicker {
  display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--cat-green); margin-bottom: 10px;
}
.bd-hero-title {
  margin: 0 0 14px; font-size: clamp(1.7rem, 3.5vw, 2.5rem); font-weight: 850;
  color: var(--text, #0a2014); line-height: 1.08; letter-spacing: -0.025em;
}
.bd-hero-stats {
  margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  color: var(--text-muted, #647a6e); font-size: 0.88rem;
}
.bd-hero-stats strong { color: var(--text, #0a2014); font-weight: 750; }

/* ----- Product Section ----- */
.bd-section { padding: 28px 0 80px; }

/* Toolbar */
.bd-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin-bottom: 18px;
}
.bd-search-box {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 10px;
  background: var(--cat-surface); border: 1.5px solid var(--cat-border);
  border-radius: 50px; padding: 11px 18px;
  box-shadow: var(--cat-shadow-xs); transition: border-color 0.2s, box-shadow 0.2s;
}
.bd-search-box:focus-within {
  border-color: var(--cat-green);
  box-shadow: 0 0 0 5px rgba(31, 122, 77, 0.07);
}
.bd-search-box svg { color: var(--text-muted, #647a6e); flex-shrink: 0; }
.bd-search-box input {
  border: 0; outline: 0; background: transparent; width: 100%;
  font: inherit; font-size: 0.9rem; color: var(--text, #0a2014);
}
.bd-search-box input::placeholder { color: #a3b5aa; }
.bd-search-clear {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  color: var(--text-muted, #647a6e); transition: background 0.15s;
}
.bd-search-clear:hover { background: rgba(0,0,0,0.06); }

.bd-sort { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.bd-sort-label {
  font-size: 0.78rem; color: var(--text-muted, #647a6e); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.bd-sort-select {
  padding: 9px 34px 9px 13px; border-radius: 8px; border: 1.5px solid var(--cat-border);
  background: var(--cat-surface); font: inherit; font-size: 0.83rem;
  color: var(--text, #0a2014); cursor: pointer; font-weight: 600;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235a7264' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color 0.2s;
}
.bd-sort-select:hover { border-color: var(--cat-green-medium); }
.bd-sort-select:focus { outline: none; border-color: var(--cat-green); box-shadow: 0 0 0 3px rgba(31,122,77,0.1); }

/* Results count */
.bd-results-count {
  margin: 0 0 20px; font-size: 0.85rem; color: var(--text-muted, #647a6e);
}
.bd-results-count strong { color: var(--text, #0a2014); font-weight: 700; }

/* ----- Product Grid ----- */
.bd-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

/* Safety net: catalog cards must never stay invisible.
   .reveal-up starts at opacity:0 and depends on GSAP ScrollTrigger.
   If GSAP misses the selector (or fails to load), force visible. */
.bd-product-grid .bd-product-card.reveal-up,
.bl-grid .bl-card.reveal-up {
  opacity: 1;
  transform: none;
}
@media (max-width: 520px) {
  .bd-product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ----- Product Card ----- */
.bd-product-card {
  background: var(--cat-surface); border: 1.5px solid var(--cat-border);
  border-radius: var(--cat-radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--cat-transition), box-shadow var(--cat-transition), border-color var(--cat-transition);
}
.bd-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--cat-shadow-lg);
  border-color: var(--cat-border-hover);
}
.bd-product-thumb {
  height: 130px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(31, 122, 77, 0.05), rgba(31, 122, 77, 0.01));
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.bd-product-thumb img { max-width: 85%; max-height: 85%; object-fit: contain; }
.bd-product-initial {
  width: 68px; height: 68px; display: grid; place-items: center;
  border-radius: 18px; font-size: 1.7rem; font-weight: 850;
  color: var(--cat-green); background: rgba(255,255,255,0.8);
  border: 1.5px solid rgba(31, 122, 77, 0.12);
}
.bd-product-body { padding: 16px 18px 12px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.bd-product-name {
  margin: 0; font-size: 0.9rem; font-weight: 700; line-height: 1.35;
  color: var(--text, #0a2014); word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Aqsa-style wholesale blurb on brand product cards — never SKU/barcode */
.bd-product-desc {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-muted, #647a6e);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bd-product-numbers {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: auto;
}
.bd-product-price {
  font-size: 0.95rem; font-weight: 800; color: var(--text, #0a2014);
  letter-spacing: -0.01em;
}
/* Action button */
.bd-product-action {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px; margin: 0 16px 16px;
  border: 1.5px solid var(--cat-green); border-radius: var(--cat-radius-sm);
  background: transparent; color: var(--cat-green);
  font: inherit; font-size: 0.8rem; font-weight: 700;
  text-decoration: none; text-align: center;
  transition: all 0.2s; cursor: pointer;
  letter-spacing: 0.02em;
}
.bd-product-action:hover {
  background: var(--cat-green); color: #fff;
  box-shadow: 0 4px 14px rgba(31, 122, 77, 0.25);
}

/* ----- Empty State ----- */
.bd-empty {
  text-align: center; padding: 80px 20px;
}
.bd-empty-icon { color: var(--text-muted, #647a6e); margin-bottom: 24px; opacity: 0.25; }
.bd-empty-title {
  margin: 0 0 8px; font-size: 1.5rem; font-weight: 750; color: var(--text, #0a2014);
}
.bd-empty-desc {
  color: var(--text-muted, #647a6e); margin: 0 auto 28px;
  max-width: 420px; font-size: 0.95rem;
}

/* ----- Bottom CTA Bar ----- */
.bd-cta-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 20px; margin-top: 48px; padding: 30px 36px;
  background: linear-gradient(135deg, rgba(31,122,77,0.04) 0%, var(--cat-surface) 30%);
  border: 1.5px solid var(--cat-border);
  border-radius: var(--cat-radius-lg); box-shadow: var(--cat-shadow-sm);
}
.bd-cta-bar-text h3 {
  margin: 0 0 6px; font-size: 1.15rem; font-weight: 750; color: var(--text, #0a2014);
}
.bd-cta-bar-text p { margin: 0; color: var(--text-muted, #647a6e); font-size: 0.9rem; }


/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] .bl-card,
[data-theme="dark"] .bl-search,
[data-theme="dark"] .bl-stats-bar,
[data-theme="dark"] .bd-hero-inner,
[data-theme="dark"] .bd-search-box,
[data-theme="dark"] .bd-product-card,
[data-theme="dark"] .bd-cta-bar,
html.dark .bl-card,
html.dark .bl-search,
html.dark .bl-stats-bar,
html.dark .bd-hero-inner,
html.dark .bd-search-box,
html.dark .bd-product-card,
html.dark .bd-cta-bar {
  background: var(--bg-card, #0f2419);
  border-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .bl-card-logo,
[data-theme="dark"] .bd-product-thumb,
html.dark .bl-card-logo,
html.dark .bd-product-thumb {
  background: rgba(255,255,255,0.03);
}
/* Dark mode search input text — override near-black fallback */
[data-theme="dark"] .bl-search input,
html.dark .bl-search input,
[data-theme="dark"] .bd-search-box input,
html.dark .bd-search-box input {
  color: #e0eae4;
}
[data-theme="dark"] .bl-search input::placeholder,
html.dark .bl-search input::placeholder,
[data-theme="dark"] .bd-search-box input::placeholder,
html.dark .bd-search-box input::placeholder {
  color: #7a9a8a;
}
[data-theme="dark"] .bd-sort-select,
html.dark .bd-sort-select {
  color: #e0eae4;
}
/* Brand hero logo card — bright white card so transparent PNG logos pop */
[data-theme="dark"] .bd-hero-logo,
html.dark .bd-hero-logo {
  background: rgba(255,255,255,0.88);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
/* Fallback text when no logo — dark text on white card */
[data-theme="dark"] .bd-hero-logo-text,
html.dark .bd-hero-logo-text {
  color: #0a2014;
}
[data-theme="dark"] .bl-hero,
[data-theme="dark"] .bd-hero,
html.dark .bl-hero,
html.dark .bd-hero {
  background: linear-gradient(180deg, rgba(31,122,77,0.07) 0%, transparent 100%);
}
/* Brand hero text — readable in dark mode */
[data-theme="dark"] .bd-hero-title,
html.dark .bd-hero-title { color: #e8f0ec; }
[data-theme="dark"] .bd-hero-stats,
html.dark .bd-hero-stats { color: #9ab5a5; }
[data-theme="dark"] .bd-hero-stats strong,
html.dark .bd-hero-stats strong { color: #c8dcd1; }
[data-theme="dark"] .bd-hero-kicker,
html.dark .bd-hero-kicker { color: #5ab88a; }
[data-theme="dark"] .bd-hero-desc,
html.dark .bd-hero-desc { color: #9ab5a5; }
[data-theme="dark"] .bl-stats-bar,
html.dark .bl-stats-bar {
  background: rgba(15, 36, 25, 0.85);
}
[data-theme="dark"] .bd-product-initial,
html.dark .bd-product-initial {
  background: rgba(255,255,255,0.06);
  border-color: rgba(31,122,77,0.2);
}
[data-theme="dark"] .bd-cta-bar,
html.dark .bd-cta-bar {
  background: linear-gradient(135deg, rgba(31,122,77,0.07) 0%, var(--bg-card, #0f2419) 30%);
}
/* CTA bar text must stay light on dark surface */
[data-theme="dark"] .bd-cta-bar-text h3,
html.dark .bd-cta-bar-text h3 {
  color: #eaf3ec;
}
[data-theme="dark"] .bd-cta-bar-text p,
html.dark .bd-cta-bar-text p {
  color: #9db4a6;
}
/* Dark mode product details */
[data-theme="dark"] .bd-product-name,
html.dark .bd-product-name { color: var(--text, #e0eae4); }
[data-theme="dark"] .bd-product-desc,
html.dark .bd-product-desc { color: #9db4a6; }
[data-theme="dark"] .bd-product-price,
html.dark .bd-product-price { color: var(--text, #e0eae4); }
/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .bl-card, .bd-product-card, .bl-card-arrow { transition: none; }
  .bl-card:hover, .bd-product-card:hover { transform: none; }
  .bl-card-arrow { opacity: 1; transform: none; }
}

/* ============================================================
   PRODUCT DETAIL PAGE — pd-*
   ============================================================ */
.pd-section { padding: 24px 0 64px; }
.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 40px;
  align-items: start;
}
.pd-gallery { position: sticky; top: calc(var(--nav-h, 72px) + 16px); }
.pd-figure {
  margin: 0;
  background: var(--cat-surface-alt, #f8faf7);
  border: 1px solid var(--cat-border, rgba(0,0,0,0.06));
  border-radius: var(--cat-radius-lg, 18px);
  overflow: hidden;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px;
  background: #fff;
}
.pd-image--logo { object-fit: contain; padding: 20%; opacity: 0.9; }
.pd-image-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; font-weight: 700; color: var(--cat-green, #1f7a4d);
  background: var(--cat-green-soft);
}
.pd-brand { margin: 0 0 8px; font-size: 0.9rem; }
.pd-brand a {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--cat-green, #1f7a4d); text-decoration: none; font-weight: 600;
}
.pd-brand a:hover { text-decoration: underline; }
.pd-brand-logo { object-fit: contain; max-height: 36px; width: auto; }
.pd-title {
  font-family: var(--font-display, Outfit, sans-serif);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700; line-height: 1.15; letter-spacing: -0.02em;
  margin: 0 0 8px; color: var(--text, #0e1f17);
  text-wrap: balance;
}
.pd-fullname { color: var(--text-muted, #647a6e); margin: 0 0 16px; font-size: 0.95rem; }
.pd-meta-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.pd-cat {
  font-size: 0.78rem; padding: 4px 10px; border-radius: 999px;
  background: var(--cat-green-soft); color: var(--cat-green);
  font-weight: 600;
}
.pd-desc {
  font-size: 1rem; line-height: 1.65; color: var(--text, #0e1f17);
  max-width: 52ch; margin-bottom: 28px;
}
.pd-actions {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.pd-back a {
  color: var(--text-muted); font-size: 0.9rem; text-decoration: none;
}
.pd-back a:hover { color: var(--cat-green); }
.pd-related { padding: 48px 0 72px; background: var(--cat-surface-alt); }
.pd-related-title {
  font-size: 1.35rem; font-weight: 700; margin: 0 0 24px;
  letter-spacing: -0.02em;
}
.bd-product-card-link {
  display: flex; flex-direction: column; flex: 1; text-decoration: none; color: inherit;
  min-width: 0;
}
.bd-product-card-link:focus-visible {
  outline: 2px solid var(--cat-green); outline-offset: 2px; border-radius: 8px;
}

@media (max-width: 860px) {
  .pd-layout { grid-template-columns: 1fr; gap: 24px; }
  .pd-gallery { position: static; }
  .pd-actions .btn { width: 100%; justify-content: center; }
}

[data-theme="dark"] .pd-figure,
html.dark .pd-figure {
  background: var(--bg-card, #0f2419);
  border-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .pd-image,
html.dark .pd-image { background: #0a1812; }
[data-theme="dark"] .pd-title,
html.dark .pd-title { color: var(--text, #e0eae4); }
[data-theme="dark"] .pd-desc,
html.dark .pd-desc { color: #b8ccc0; }
[data-theme="dark"] .pd-brand a,
html.dark .pd-brand a { color: #5ab88a; }
[data-theme="dark"] .pd-related,
html.dark .pd-related { background: rgba(15,36,25,0.5); }


/* ============================================================
   CATALOG LAYOUT + LEFT BRAND SIDEBAR
   ============================================================ */
.cat-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px 32px;
  align-items: start;
}
.cat-main { min-width: 0; }

.cat-sidebar {
  position: sticky;
  top: calc(var(--nav-h, 72px) + 12px);
  max-height: calc(100dvh - var(--nav-h, 72px) - 24px);
  display: flex;
  flex-direction: column;
  z-index: 2;
}
.cat-sidebar-inner {
  background: var(--cat-surface, #fff);
  border: 1px solid var(--cat-border, rgba(0,0,0,0.07));
  border-radius: var(--cat-radius-lg, 16px);
  box-shadow: 0 8px 28px rgba(14, 31, 23, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: inherit;
}
.cat-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--cat-border, rgba(0,0,0,0.06));
  flex-shrink: 0;
}
.cat-sidebar-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text, #0e1f17);
}
.cat-sidebar-all {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cat-green, #1f7a4d);
  text-decoration: none;
}
.cat-sidebar-all:hover { text-decoration: underline; }

.cat-brand-strip {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px 12px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.cat-brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--cat-border, rgba(0,0,0,0.08));
  background: var(--cat-surface-alt, #f8faf7);
  color: var(--text, #0e1f17);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cat-brand-chip:hover {
  border-color: var(--cat-green-medium, #2e8b57);
  background: var(--cat-green-soft, rgba(31,122,77,0.08));
}
.cat-brand-chip.is-active {
  background: var(--cat-green, #1f7a4d);
  border-color: var(--cat-green, #1f7a4d);
  color: #fff;
}
.cat-brand-chip-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 2px;
}
.cat-brand-chip-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cat-green-soft);
  color: var(--cat-green);
  font-weight: 700;
  font-size: 0.75rem;
}
.cat-brand-chip.is-active .cat-brand-chip-initial {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.cat-brand-nav {
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
}
.cat-brand-list {
  list-style: none;
  margin: 0;
  padding: 8px;
}
.cat-brand-list li { margin: 0; }
.cat-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text, #0e1f17);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.cat-brand-link:hover {
  background: var(--cat-green-soft, rgba(31,122,77,0.08));
}
.cat-brand-link.is-active {
  background: var(--cat-green-soft, rgba(31,122,77,0.12));
  color: var(--cat-green, #1f7a4d);
}
.cat-brand-link:focus-visible {
  outline: 2px solid var(--cat-green);
  outline-offset: 1px;
}
.cat-brand-link-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--cat-surface-alt, #f8faf7);
  border: 1px solid var(--cat-border, rgba(0,0,0,0.05));
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.cat-brand-link-logo img {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
}
.cat-brand-link-initial {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cat-green);
}
.cat-brand-link-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cat-brand-link-name {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-brand-link-count {
  font-size: 0.72rem;
  color: var(--text-muted, #647a6e);
  font-weight: 500;
}
.cat-brand-link-check {
  color: var(--cat-green);
  flex-shrink: 0;
}
.cat-brand-empty {
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.cat-sidebar-products {
  border-top: 1px solid var(--cat-border, rgba(0,0,0,0.06));
  padding: 12px 12px 14px;
  flex-shrink: 0;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.cat-sidebar-subtitle {
  margin: 0 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #647a6e);
  font-weight: 700;
}
.cat-product-mini {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.cat-product-mini-link {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text, #0e1f17);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-product-mini-link:hover {
  background: var(--cat-green-soft);
  color: var(--cat-green);
}
.cat-product-mini-link.is-active {
  background: var(--cat-green);
  color: #fff;
  font-weight: 600;
}
.cat-sidebar-more {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cat-green);
  text-decoration: none;
}
.cat-sidebar-more:hover { text-decoration: underline; }

.bd-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.bd-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--cat-border, rgba(0,0,0,0.08));
  background: var(--cat-surface, #fff);
  color: var(--text-muted, #647a6e);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.bd-cat-pill:hover {
  border-color: var(--cat-green-medium, #2e8b57);
  color: var(--cat-green);
}
.bd-cat-pill.is-active {
  background: var(--cat-green);
  border-color: var(--cat-green);
  color: #fff;
}
.bd-cat-n {
  font-size: 0.72rem;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.bd-related-brands {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--cat-border, rgba(0,0,0,0.07));
}
.bd-related-title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.bd-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.bd-related-list a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--cat-surface-alt, #f8faf7);
  border: 1px solid var(--cat-border, rgba(0,0,0,0.06));
  color: var(--text, #0e1f17);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.bd-related-list a:hover {
  border-color: var(--cat-green);
  color: var(--cat-green);
  background: var(--cat-green-soft);
}

.bd-hero-desc {
  margin: 10px 0 0;
  max-width: 56ch;
  color: var(--text-muted, #647a6e);
  font-size: 0.92rem;
  line-height: 1.5;
}

.pd-related--inline {
  margin-top: 40px;
  padding: 28px 0 0;
  background: transparent;
}
.page-product-detail .pd-section { padding-top: 8px; }
.page-product-detail .pd-layout {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

@media (max-width: 1024px) {
  .cat-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .cat-sidebar {
    position: static;
    max-height: none;
  }
  .cat-sidebar-inner {
    max-height: none;
  }
  .cat-brand-nav,
  .cat-sidebar-products {
    display: none;
  }
  .cat-brand-strip {
    display: flex;
  }
  .cat-sidebar-head {
    border-bottom: none;
    padding-bottom: 0;
  }
}

@media (max-width: 640px) {
  .cat-layout { gap: 14px; }
  .bd-related-list a { font-size: 0.78rem; padding: 5px 10px; }
}

/* ============================================================
   MOBILE REDESIGN — Premium responsive catalog
   ============================================================ */

/* ----- Mobile Typography Scale ----- */
@media (max-width: 640px) {
  .bl-hero-main { font-size: 1.9rem; }
  .bl-hero-sub { font-size: 0.9rem; padding: 0 8px; }
  .bd-hero-title { font-size: 1.55rem; }
  .pd-title { font-size: 1.35rem; line-height: 1.2; }
  .bd-product-name { font-size: 0.82rem; line-height: 1.3; }
  .bd-results-count { font-size: 0.78rem; }
  .bl-hero-kicker { font-size: 0.62rem; letter-spacing: 0.14em; }
  .bd-hero-kicker { font-size: 0.62rem; }
}

/* ----- Breadcrumb — Compact Mobile ----- */
@media (max-width: 640px) {
  .bd-breadcrumb {
    padding-top: calc(var(--nav-h, 64px) + 6px);
    padding-bottom: 2px;
  }
  .bd-breadcrumb .container {
    padding: 0 16px 6px;
    gap: 4px;
    font-size: 0.68rem;
  }
  .bd-breadcrumb, .bd-breadcrumb a { font-size: 0.68rem; }
  .bl-breadcrumb { font-size: 0.7rem; margin-bottom: 12px; flex-wrap: wrap; }
}

/* ----- Brand Hero — Mobile Stack (Redesigned) ----- */
@media (max-width: 640px) {
  .bd-hero {
    padding: 10px 0 14px;
    background: transparent;
  }
  .bd-hero-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 12px;
    border-radius: var(--cat-radius, 14px);
    background: var(--cat-surface, #fff);
    border: 1px solid var(--cat-border, rgba(0,0,0,0.06));
  }
  .bd-hero-logo {
    width: 100%;
    height: 72px;
    border-radius: 10px;
    padding: 10px;
  }
  .bd-hero-logo img { max-height: 50px; }
  .bd-hero-logo-text { font-size: 1.3rem; }
  .bd-hero-info { min-width: 0; width: 100%; }
  .bd-hero-stats {
    font-size: 0.76rem;
    gap: 6px;
  }
  .bd-hero-desc {
    font-size: 0.8rem;
    margin-top: 6px;
    max-width: none;
    line-height: 1.45;
  }
}

/* ----- Mobile Brand Strip (Top Pills) — Premium Redesign ----- */
@media (max-width: 1024px) {
  .cat-brand-strip {
    display: flex;
    gap: 8px;
    padding: 8px 4px 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, transparent 0%, #000 4%, #000 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 4%, #000 92%, transparent 100%);
  }
  .cat-brand-strip::-webkit-scrollbar { display: none; }

  .cat-sidebar {
    position: static;
    max-height: none;
    z-index: 1;
  }
  .cat-sidebar-inner {
    max-height: none;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }
  .cat-sidebar-head {
    padding: 0 4px 2px;
    border-bottom: none;
  }
  .cat-sidebar-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--text-muted, #647a6e);
  }
  .cat-sidebar-all { font-size: 0.74rem; }

  /* Mobile pill redesign */
  .cat-brand-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 8px 14px 8px 8px;
    border-radius: 12px;
    border: 1px solid var(--cat-border, rgba(0,0,0,0.08));
    background: var(--cat-surface, #fff);
    color: var(--text, #0e1f17);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    scroll-snap-align: start;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(10, 32, 20, 0.04);
    min-height: 44px;
  }
  .cat-brand-chip:active {
    transform: scale(0.96);
    background: var(--cat-green-soft);
  }
  .cat-brand-chip.is-active {
    background: var(--cat-green, #1f7a4d);
    border-color: var(--cat-green, #1f7a4d);
    color: #fff;
    box-shadow: 0 3px 12px rgba(31, 122, 77, 0.25);
    font-weight: 700;
  }
  .cat-brand-chip.is-active:active {
    transform: scale(0.96);
    box-shadow: 0 1px 6px rgba(31, 122, 77, 0.35);
  }
  .cat-brand-chip-logo {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #fff;
    padding: 3px;
  }
  .cat-brand-chip-initial {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 700;
  }
  .cat-brand-chip.is-active .cat-brand-chip-initial {
    background: rgba(255,255,255,0.2);
    color: #fff;
  }
  .cat-brand-chip-name {
    white-space: nowrap;
    font-size: 0.8rem;
  }

  /* Hide desktop nav */
  .cat-brand-nav,
  .cat-sidebar-products {
    display: none;
  }
}

/* ----- Brand List Grid — Mobile 2-Column Refined ----- */
@media (max-width: 640px) {
  .bl-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .bl-card {
    border-radius: 12px;
    border-width: 1px;
  }
  .bl-card-link {
    padding: 16px 10px 12px;
  }
  .bl-card-logo {
    height: 56px;
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 8px;
  }
  .bl-card-logo img { max-height: 38px; }
  .bl-card-name {
    font-size: 0.8rem;
    margin-bottom: 4px;
  }
  .bl-card-count-badge {
    top: 6px;
    right: 6px;
    font-size: 0.6rem;
    padding: 2px 7px;
  }
  .bl-stats-bar .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .bl-stats-text { font-size: 0.74rem; }
}

/* ----- Product Grid — Mobile 2-Column Premium Redesign ----- */
@media (max-width: 520px) {
  .bd-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

@media (max-width: 640px) {
  /* Card: tighter, cleaner */
  .bd-product-card {
    border-radius: 12px;
    border-width: 1px;
  }

  /* Thumb: compact square, subtle gradient */
  .bd-product-thumb {
    height: 100px;
    background: linear-gradient(160deg, rgba(31,122,77,0.04), rgba(31,122,77,0.005));
  }
  .bd-product-thumb img {
    max-width: 82%;
    max-height: 82%;
  }

  /* Fallback initial — small, proportional, never giant */
  .bd-product-initial {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--cat-green);
    background: rgba(31,122,77,0.06);
  }

  /* Body: snug with consistent spacing */
  .bd-product-body {
    padding: 10px 10px 6px;
    gap: 3px;
  }
  .bd-product-name {
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.3;
    -webkit-line-clamp: 2;
  }

  .bd-product-price {
    font-size: 0.78rem;
  }

  /* Enquire button — always visible, full-width within card, pinned bottom */
  .bd-product-action {
    margin: auto 8px 8px;
    padding: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: 8px;
    border-width: 1.5px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }
  .bd-product-action svg {
    width: 13px;
    height: 13px;
  }
}

/* ----- Toolbar — Mobile Full-Width Stack ----- */
@media (max-width: 640px) {
  .bd-toolbar {
    flex-direction: column;
    gap: 8px;
  }
  .bd-search-box {
    width: 100%;
    min-width: 0;
    padding: 10px 15px;
    border-radius: 14px;
  }
  .bd-search-box input {
    font-size: 0.85rem;
  }
  .bd-sort {
    width: 100%;
    justify-content: flex-start;
  }
  .bd-sort-label {
    font-size: 0.72rem;
    flex-shrink: 0;
  }
  .bd-sort-select {
    flex: 1;
    font-size: 0.8rem;
    padding: 8px 30px 8px 12px;
    border-radius: 12px;
  }
  .bd-results-count {
    font-size: 0.74rem;
    margin-bottom: 12px;
  }
  .bd-results-note {
    display: none;
  }
}

/* ----- Category Pills — Mobile Scrollable with Fade ----- */
@media (max-width: 640px) {
  .bd-cat-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 2px 12px 8px;
    margin: 0 -12px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 90%, transparent 100%);
  }
  .bd-cat-pills::-webkit-scrollbar { display: none; }
  .bd-cat-pill {
    flex: 0 0 auto;
    padding: 7px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 12px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    scroll-snap-align: start;
    border-width: 1.5px;
    white-space: nowrap;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  }
  .bd-cat-pill:active {
    transform: scale(0.95);
  }
  .bd-cat-pill.is-active {
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(31,122,77,0.2);
  }
  .bd-cat-n {
    font-size: 0.68rem;
    opacity: 0.7;
  }
}

/* ----- Product Detail — Mobile Full-Width Single Column (Refined) ----- */
@media (max-width: 860px) {
  .pd-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .pd-gallery {
    position: static;
    max-width: 100%;
  }
  .pd-figure {
    aspect-ratio: 1 / 1;
    border-radius: var(--cat-radius, 14px);
    max-height: 60vh;
  }
  .pd-image {
    padding: 14px;
    object-fit: contain;
  }
  .pd-image--logo {
    padding: 12%;
  }
  .pd-brand {
    font-size: 0.78rem;
  }
  .pd-title {
    font-size: 1.3rem;
    margin-bottom: 4px;
    line-height: 1.2;
  }
  .pd-fullname {
    font-size: 0.8rem;
    margin-bottom: 10px;
  }
  .pd-meta-row {
    gap: 5px;
    margin-bottom: 12px;
  }
  .pd-cat {
    font-size: 0.68rem;
    padding: 3px 8px;
  }
  .pd-desc {
    font-size: 0.9rem;
    max-width: none;
    margin-bottom: 20px;
  }
  .pd-actions {
    flex-direction: column;
    gap: 10px;
  }
  .pd-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 48px;
    font-size: 0.9rem;
    border-radius: 12px;
  }
  .pd-back {
    text-align: center;
    margin-top: 16px;
  }
  .pd-back a {
    font-size: 0.84rem;
  }

  /* Related products inline — compact */
  .pd-related--inline {
    margin-top: 32px;
    padding-top: 20px;
  }
  .pd-related-title {
    font-size: 1.1rem;
    margin-bottom: 16px;
  }
}

/* ----- CTA Bar — Mobile Stack (Refined) ----- */
@media (max-width: 640px) {
  .bd-cta-bar {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
    gap: 14px;
    border-radius: var(--cat-radius, 14px);
    margin-top: 24px;
  }
  .bd-cta-bar-text h3 { font-size: 1rem; margin-bottom: 4px; }
  .bd-cta-bar-text p { font-size: 0.8rem; }
  .bd-cta-bar .btn {
    width: 100%;
    justify-content: center;
    min-height: 46px;
    border-radius: 12px;
    font-size: 0.9rem;
  }
}

/* ----- Related Brands — Mobile Compact Chips ----- */
@media (max-width: 640px) {
  .bd-related-brands {
    margin-top: 28px;
    padding-top: 20px;
  }
  .bd-related-title {
    font-size: 0.95rem;
    margin-bottom: 12px;
  }
  .bd-related-list {
    gap: 6px 8px;
  }
  .bd-related-list a {
    font-size: 0.74rem;
    padding: 6px 10px;
    border-radius: 8px;
  }
}

/* ----- Brand List Hero — Mobile Padding ----- */
@media (max-width: 640px) {
  .bl-hero {
    padding: calc(var(--nav-h, 64px) + 20px) 0 16px;
  }
  .bl-search {
    max-width: 100%;
    margin: 0 auto 18px;
    padding: 9px 15px;
    border-radius: 16px;
  }
  .bl-search input { font-size: 0.85rem; }
  .bl-alpha {
    gap: 1px;
    max-width: 100%;
  }
  .bl-alpha-link {
    width: 28px;
    height: 28px;
    font-size: 0.68rem;
    border-radius: 7px;
  }
  .bl-alpha-all {
    margin-left: 3px;
    padding: 0 9px;
  }
  .bl-grid-section { padding: 12px 0 56px; }
  .bl-cta { padding: 32px 16px 0; margin-top: 28px; }
}

/* ----- Touch Optimization — Larger Tap Targets, No Hover Jank ----- */
@media (hover: none) and (pointer: coarse) {
  .bd-product-action {
    min-height: 40px;
    padding: 9px;
    opacity: 1;
  }
  .bd-product-action svg {
    width: 14px;
    height: 14px;
  }
  .cat-brand-link {
    min-height: 48px;
  }
  .bl-card-link {
    min-height: 44px;
  }
  .bd-product-card-link:active {
    opacity: 0.7;
  }
  .bl-card:active {
    transform: scale(0.97);
  }
  .bd-product-card:active {
    transform: scale(0.97);
  }
  .bd-cat-pill:active {
    transform: scale(0.95);
  }
  /* Remove hover-only effects on touch */
  .bl-card:hover,
  .bd-product-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--cat-border);
  }
  .bl-card-arrow {
    opacity: 0.6;
    transform: translateX(0);
  }
}

/* ----- Dark Mode Mobile Patches ----- */
@media (max-width: 1024px) {
  [data-theme="dark"] .cat-sidebar-inner,
  html.dark .cat-sidebar-inner {
    background: transparent;
    border: none;
    box-shadow: none;
  }
  [data-theme="dark"] .cat-brand-chip,
  html.dark .cat-brand-chip {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  [data-theme="dark"] .cat-brand-chip.is-active,
  html.dark .cat-brand-chip.is-active {
    background: var(--cat-green);
    border-color: var(--cat-green);
    box-shadow: 0 3px 14px rgba(31,122,77,0.35);
  }
}

[data-theme="dark"] .cat-sidebar-inner,
html.dark .cat-sidebar-inner {
  background: var(--bg-card, #0f2419);
  border-color: rgba(255,255,255,0.07);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
}
[data-theme="dark"] .cat-sidebar-title,
html.dark .cat-sidebar-title { color: var(--text, #e0eae4); }
[data-theme="dark"] .cat-brand-link,
html.dark .cat-brand-link { color: var(--text, #e0eae4); }
[data-theme="dark"] .cat-brand-link-logo,
html.dark .cat-brand-link-logo {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .cat-brand-chip,
html.dark .cat-brand-chip {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  color: var(--text, #e0eae4);
}
[data-theme="dark"] .bd-related-list a,
html.dark .bd-related-list a {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.07);
  color: var(--text, #e0eae4);
}
[data-theme="dark"] .bd-cat-pill,
html.dark .bd-cat-pill {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE FIX — catalog pages (brands / brand / product)
   ═══════════════════════════════════════════════════════════
   ROOT CAUSE of content being cut off on phones:
   `.cat-layout` collapsed to `grid-template-columns: 1fr` below
   1024px, but `1fr` means `minmax(auto, 1fr)` and `auto` resolves to
   the column's MIN-CONTENT width. `.cat-brand-strip` (22 nowrap flex
   chips) and `.cat-sidebar` still had `min-width: auto`, so their
   min-content (~2330px) blew the single column out to 2327px inside a
   375px viewport. `overflow-x: clip` on <body> then hid the overflow
   instead of scrolling it — so the page looked "broken/empty" rather
   than merely wide. `overflow-x:auto` alone can't fix this: a scroll
   container still reports min-content as its minimum unless
   `min-width: 0` is set explicitly.
   ═══════════════════════════════════════════════════════════ */

/* 1. Grid tracks may never be sized by their content's min-width */
.cat-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (min-width: 1025px) {
  .cat-layout { grid-template-columns: 260px minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .cat-layout { grid-template-columns: minmax(0, 1fr); }
}

/* 2. Flex/scroll containers must be allowed to shrink below content */
.cat-sidebar,
.cat-sidebar-inner,
.cat-sidebar-head,
.cat-main,
.cat-brand-strip,
.bd-cat-pills,
.bd-toolbar,
.bd-search-box,
.bd-product-grid,
.bl-grid { min-width: 0; }

/* 3. Horizontal chip/pill rails: swipeable, edge-to-edge, no scrollbar */
.cat-brand-strip,
.bd-cat-pills {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}
.cat-brand-strip::-webkit-scrollbar,
.bd-cat-pills::-webkit-scrollbar { display: none; }
.cat-brand-strip > *,
.bd-cat-pills > * { flex: 0 0 auto; scroll-snap-align: start; }

/* 4. Toolbar (search + sort) stacks and fills the width on phones */
@media (max-width: 640px) {
  .bd-toolbar { flex-wrap: wrap; gap: 10px; }
  .bd-search-box { flex: 1 1 100%; min-width: 0; }
  .bd-search-box input { width: 100%; min-width: 0; }
  .bd-sort { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; }
  .bd-sort-select { flex: 1 1 auto; min-width: 0; max-width: 100%; }
}

/* 5. Product cards — app-like: bigger, square media, image always visible */
@media (max-width: 640px) {
  .bd-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bd-product-thumb {
    height: auto;
    aspect-ratio: 1 / 1;      /* square media box, like a storefront app */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
  }
  .bd-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;      /* never crop packaging artwork */
  }
}
@media (max-width: 339px) {
  /* only the very smallest phones (<=320px) drop to one column —
     375px devices keep the 2-up storefront grid shoppers expect */
  .bd-product-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 6. Product detail page: image and info stack cleanly.
   NOTE the doubled selector. `.page-product-detail .pd-layout` (two
   classes, specificity 0-2-0) sets the desktop 2-column grid, and it
   BEATS every plain `.pd-layout` mobile rule (0-1-0) no matter how
   late those appear — specificity outranks source order. That is why
   the product page still rendered a 147px image beside a 162px info
   column on a 375px phone. Matching the specificity is the fix. */
@media (max-width: 900px) {
  .page-product-detail .pd-layout,
  .pd-layout, .pd-grid, .product-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .pd-media, .pd-gallery, .pd-info, .pd-content { min-width: 0; max-width: 100%; }
  .pd-gallery { position: static; }
  .pd-figure {
    aspect-ratio: 1 / 1;
    max-height: 52vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
  }
  .pd-media img, .pd-gallery img, .pd-figure img {
    width: 100%;
    height: 100%;
    max-height: 52vh;
    object-fit: contain;
  }
  /* Full-width tap targets, like a storefront app */
  .pd-actions .btn, .pd-cta .btn, .pd-info .btn { width: 100%; }
}

/* 7. Never let a long SKU / product name force horizontal scroll */
.bd-product-title, .pd-title, .bd-product-card, .pd-info {
  overflow-wrap: anywhere;
}
