/* =============================================
   CSS Design Tokens — מבוסס על merital.co.il
   ============================================= */
:root {
  --brand-primary:   #005385;
  --brand-secondary: #2da4e3;
  --brand-dark:      #023f5d;
  --text-color:      #000000;
  --text-muted:      #7a7a7a;
  --body-bg:         #ffffff;
  --gray-light:      #f1f1f1;
  --gray-border:     #e0e0e0;
  --success:         #27ae60;
  --warning:         #f39c12;
  --danger:          #e74c3c;

  --font-base: 'Heebo', 'open sans hebrew', Arial, sans-serif;
  --font-size-base: 15px;
  --line-height-base: 1.6;

  --container-max: 1200px;
  --card-radius: 8px;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-hover: 0 6px 18px rgba(0,83,133,0.18);
}

/* =============================================
   Reset + Base
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  color: var(--text-color);
  background: var(--body-bg);
  direction: rtl;
  text-align: right;
  line-height: var(--line-height-base);
}
a { color: var(--brand-secondary); text-decoration: none; }
a:hover { color: var(--brand-primary); text-decoration: underline; }
img { max-width: 100%; display: block; }

/* =============================================
   HEADER
   ============================================= */
.site-header {
  background: #fff;
  border-bottom: 2px solid var(--brand-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.header-top {
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 20px;
  font-size: 13px;
}
.header-top a { color: #fff; }
.back-to-store {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0.88;
  white-space: nowrap;
  transition: opacity 0.2s;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 3px 10px;
  border-radius: 12px;
}
.back-to-store:hover { opacity: 1; text-decoration: none; background: rgba(255,255,255,0.12); }
.header-main {
  display: flex;
  justify-content: center;
  padding: 10px 20px 8px;
}
.header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.header-breadcrumb a { color: var(--text-muted); }
.header-breadcrumb a:hover { color: var(--brand-primary); text-decoration: none; }
.breadcrumb-sep { color: var(--gray-border); font-size: 14px; }
.breadcrumb-current { font-weight: 700; color: var(--brand-primary); }
.site-logo { height: 55px; object-fit: contain; }
.header-nav {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--gray-border);
  background: #fff;
  overflow: hidden;
}
/* Scrollable category zone */
.nav-cats-scroll {
  display: flex;
  flex: 1 1 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-cats-scroll::-webkit-scrollbar { display: none; }
.nav-cats-scroll .main-nav-btn {
  flex: 1 1 auto;
  text-align: center;
  min-width: max-content;
}

/* Main category nav buttons */
.main-nav-btn {
  padding: 11px 22px;
  border: none;
  background: transparent;
  font-family: var(--font-base);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.18s;
  letter-spacing: 0.01em;
}
.main-nav-btn:hover {
  color: var(--brand-primary);
  background: var(--gray-light);
}
.main-nav-btn.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  background: #f0f7ff;
}

/* Home & Store special nav buttons */
.nav-home {
  flex: 0 0 auto;
  color: var(--brand-secondary) !important;
  font-weight: 700 !important;
  border-left: 1px solid var(--gray-border);
  white-space: nowrap;
  background: #f7fbff;
}
.nav-home:hover { background: #e8f5ff !important; }

.nav-store {
  flex: 0 0 auto;
  color: var(--brand-primary) !important;
  font-weight: 700 !important;
  border-right: 1px solid var(--gray-border);
  border-bottom: none !important;
  background: #f7fbff !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 11px 20px;
}
.nav-store:hover { background: #e8f5ff !important; }

/* Clear filter button */
.btn-clear-filters {
  background: #fff3f3 !important;
  color: var(--danger) !important;
  border: 1.5px solid var(--danger) !important;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-clear-filters:hover { background: var(--danger) !important; color: #fff !important; }

/* =============================================
   PAGE HERO
   ============================================= */
.page-hero {
  background: linear-gradient(140deg, var(--brand-primary) 0%, #004a78 50%, var(--brand-dark) 100%);
  color: #fff;
  text-align: center;
  padding: 22px 20px 18px;
  position: relative;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(45,164,227,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}
.hero-top-row { margin-bottom: 14px; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.95);
  padding: 3px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}
.page-title {
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
  line-height: 1.25;
}
.page-subtitle {
  font-size: 0.92rem;
  opacity: 0.82;
  margin-bottom: 0;
}

/* Compact 3-step hint row */
.hero-steps-compact {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.hsc-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12.5px;
  opacity: 0.9;
}
.hsc-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--brand-secondary);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.hsc-sep {
  font-size: 14px;
  opacity: 0.5;
}

/* Search */
.search-container {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}
.search-input {
  width: 100%;
  padding: 14px 50px 14px 20px;
  border: none;
  border-radius: 30px;
  font-size: 15px;
  font-family: var(--font-base);
  direction: rtl;
  outline: none;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  transition: box-shadow 0.2s;
}
.search-input:focus { box-shadow: 0 3px 18px rgba(0,0,0,0.3); }
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  pointer-events: none;
}

/* =============================================
   SEARCH DROPDOWN
   ============================================= */
.search-container { position: relative; }

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.10);
  z-index: 300;
  overflow: hidden;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  text-align: right;
}
.search-dropdown.show { display: block; }

.sd-header {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: #f7f9fc;
  border-bottom: 1px solid var(--gray-border);
}

.sd-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f2f2f2;
  cursor: pointer;
  transition: background 0.15s;
}
.sd-item:hover { background: #f0f7ff; }
.sd-item:last-of-type { border-bottom: none; }

.sd-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8f8f8;
  flex-shrink: 0;
  border: 1px solid var(--gray-border);
}
.sd-img-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.sd-info { flex: 1; min-width: 0; }
.sd-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sd-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.sd-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.sd-cat {
  font-size: 10.5px;
  background: #e8f2fb;
  color: var(--brand-primary);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
}
.sd-sku {
  font-size: 10.5px;
  color: #aaa;
  font-family: monospace;
}
.sd-guides {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.sd-guide-btn {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 0.15s;
}
.sd-guide-btn:hover { opacity: 0.82; text-decoration: none; }
.sd-replace      { background: var(--brand-secondary); color: #fff; }
.sd-install      { background: transparent; color: var(--brand-primary); border: 1.5px solid var(--brand-primary); }
.sd-troubleshoot { background: transparent; color: var(--warning); border: 1.5px solid var(--warning); }
.sd-errors       { background: transparent; color: var(--danger);  border: 1.5px solid var(--danger); }

.sd-empty {
  padding: 22px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.sd-more {
  padding: 10px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--brand-secondary);
  background: #f7f9fc;
  font-weight: 600;
  border-top: 1px solid var(--gray-border);
}

/* Card highlight flash */
.card-highlight {
  outline: 3px solid var(--brand-secondary) !important;
  outline-offset: 2px;
  animation: highlightPulse 2.2s ease-out forwards;
}
@keyframes highlightPulse {
  0%   { box-shadow: 0 0 0 0 rgba(45,164,227,0.6); }
  40%  { box-shadow: 0 0 0 10px rgba(45,164,227,0.25); }
  100% { box-shadow: 0 0 0 0 rgba(45,164,227,0); outline-color: transparent; }
}

/* Deep-link banner */
.deeplink-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #e8f4fe 0%, #d0eafb 100%);
  border: 1.5px solid var(--brand-secondary);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  font-size: 15px;
  color: var(--brand-primary);
  flex-wrap: wrap;
}
.deeplink-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.deeplink-banner span:nth-child(2) {
  flex: 1;
}
.deeplink-clear {
  margin-right: auto;
  background: transparent;
  border: 1.5px solid var(--brand-primary);
  color: var(--brand-primary);
  padding: 5px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}
.deeplink-clear:hover {
  background: var(--brand-primary);
  color: #fff;
}

/* =============================================
   SUB-CATEGORY TABS
   ============================================= */
.tabs-container {
  background: #fafafa;
  border-bottom: 1px solid var(--gray-border);
  position: sticky;
  top: 154px; /* exact header height: phone(30) + logo(79) + nav(45) */
  z-index: 50;
  min-height: 44px;
}
.tabs {
  display: flex;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

/* Each main-category's sub-tab group — hidden by default */
.sub-tabs-group {
  display: none;
  flex-direction: row;
  gap: 0;
}
.sub-tabs-group.active {
  display: flex;
}

.tab-btn {
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: var(--font-base);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.18s;
}
.tab-btn:hover { color: var(--brand-primary); }
.tab-btn.active {
  color: var(--brand-secondary);
  border-bottom-color: var(--brand-secondary);
  font-weight: 700;
}

/* =============================================
   MAIN CONTENT + GRID
   ============================================= */
.main-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 28px 16px 40px;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

/* =============================================
   PRODUCT CARD
   ============================================= */
.product-card {
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* Image area */
.card-image-wrap {
  position: relative;
  background: #f8f8f8;
  border-bottom: 1px solid var(--gray-border);
  overflow: hidden;
}
.card-image {
  width: 100%;
  height: 180px;
  object-fit: contain;
  padding: 12px;
  background: #fff;
  transition: transform 0.25s;
}
.product-card:hover .card-image { transform: scale(1.04); }
.card-image-placeholder {
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.5rem;
  gap: 8px;
}
.card-image-placeholder small { font-size: 12px; }

/* Category badge */
.category-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Card body */
.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1.3;
}
.card-subtitle { font-size: 13px; color: var(--text-muted); }
.card-sku { font-size: 11px; color: #aaa; }
.card-sku code {
  background: var(--gray-light);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

/* Variant chips (one card per product family) */
.variant-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.variant-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--gray-light);
  border-radius: 4px;
  padding: 2px 7px;
  line-height: 1.5;
}
.variant-chip a { display: inline-flex; align-items: center; gap: 5px; }
.variant-chip a:hover { color: var(--brand-primary); text-decoration: none; }
.variant-sku {
  font-size: 10.5px;
  color: #999;
  direction: ltr;
}

/* Guide buttons */
.guide-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.guide-btn {
  display: block;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.btn-replace  { background: var(--brand-secondary); color: #fff; }
.btn-replace:hover  { background: var(--brand-primary); color: #fff; text-decoration: none; }
.btn-install  { background: transparent; color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-install:hover  { background: var(--brand-primary); color: #fff; text-decoration: none; }
.btn-troubleshoot { background: transparent; color: var(--warning); border-color: var(--warning); }
.btn-troubleshoot:hover { background: var(--warning); color: #fff; text-decoration: none; }
.btn-errors { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-errors:hover { background: var(--danger); color: #fff; text-decoration: none; }
.btn-help { background: #25d366; color: #fff; }
.btn-help:hover { background: #1da851; color: #fff; text-decoration: none; }
.no-guide-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* Buy link */

/* =============================================
   FOOTER CTA
   ============================================= */
.footer-cta {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  color: #fff;
  text-align: center;
  padding: 40px 20px;
}
.footer-cta h2 { font-size: 1.4rem; margin-bottom: 8px; }
.footer-cta p  { opacity: 0.85; margin-bottom: 20px; }
.cta-buttons   { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-btn {
  padding: 12px 28px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-base);
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  text-decoration: none;
}
.cta-btn:hover { transform: scale(1.04); opacity: 0.92; text-decoration: none; }
.cta-phone    { background: #fff; color: var(--brand-primary); }
.cta-whatsapp { background: #25D366; color: #fff; }
.cta-store    { background: rgba(255,255,255,0.15); color: #fff; border: 2px solid rgba(255,255,255,0.4); }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: #f7f7f7;
  border-top: 1px solid var(--gray-border);
  text-align: center;
  padding: 24px 20px;
  color: var(--text-muted);
  font-size: 13px;
}
.site-footer img { margin: 0 auto 12px; }
.cache-info { font-size: 11px; margin-top: 6px; opacity: 0.6; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  /* Hero */
  .page-hero { padding: 16px 16px 14px; }
  .page-title { font-size: 1.35rem; }
  .page-subtitle { font-size: 0.85rem; }
  .hero-badge { font-size: 11.5px; }

  /* Nav */
  .main-nav-btn { padding: 9px 12px; font-size: 12.5px; }
  .nav-home, .nav-store { padding: 9px 12px; font-size: 12.5px; }

  /* Grid */
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 16px; }
  .card-image { height: 130px; }
  .card-body { padding: 12px; }
  .card-title { font-size: 13.5px; }
  .guide-btn { font-size: 12px; padding: 7px 10px; }

  /* Tabs sticky offset */
  .tabs-container { top: 100px; }

  /* Trust bar compact */
  .trust-item { padding: 4px 14px; }
  .trust-number { font-size: 1.2rem; }

  /* Knowledge section */
  .knowledge-intro-inner { padding: 24px 16px; }

  /* Cat cards */
  .cat-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cat-card { padding: 14px 8px 12px; }
  .cat-card-icon { font-size: 1.6rem; }
  .cat-card-title { font-size: 11.5px; }

  /* Search dropdown full width */
  .search-input { font-size: 14px; }

  /* Back-to-store */
  .back-to-store { font-size: 11.5px; }
}

@media (max-width: 480px) {
  /* Hero very compact */
  .page-hero { padding: 12px 12px 10px; }
  .page-title { font-size: 1.2rem; }
  .hero-steps-compact { gap: 4px; }
  .hsc-item { font-size: 11px; padding: 3px 9px; }

  /* Nav */
  .main-nav-btn { padding: 8px 10px; font-size: 11.5px; }
  .nav-home, .nav-store { padding: 8px 10px; font-size: 11.5px; }

  /* Grid → 2 columns */
  .products-grid { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
  .card-image { height: 110px; }
  .card-body { padding: 10px; }
  .card-title { font-size: 12.5px; }
  .card-subtitle { font-size: 11px; }
  .card-sku { font-size: 10.5px; }
  .guide-btn { font-size: 11.5px; padding: 6px 8px; }

  /* Cat cards 2 col */
  .cat-cards { grid-template-columns: 1fr 1fr; }

  /* Trust bar wrap 2x2 */
  .trust-divider { display: none; }
  .trust-item { padding: 4px 12px; }

  /* Filter legend wraps */
  .guide-types-legend { gap: 5px; padding: 8px 12px; }
  .legend-item { font-size: 11px; padding: 4px 10px; }
  .legend-title { font-size: 11px; }

  /* Search */
  .search-input { font-size: 14px; padding: 13px 42px 13px 16px; }

  /* FAQ */
  .faq-section { padding: 28px 14px 32px; }
  .faq-title { font-size: 1.2rem; }

  /* Footer CTA */
  .footer-cta { padding: 24px 14px; }
  .cta-buttons { flex-direction: column; gap: 8px; }
  .cta-btn { width: 100%; text-align: center; }

  /* Deep-link banner */
  .deeplink-banner { font-size: 13px; padding: 10px 14px; }
}

/* =============================================
   TRUST BAR
   ============================================= */
.trust-bar {
  background: var(--brand-dark);
  color: #fff;
  padding: 14px 20px;
}
.trust-bar-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 28px;
  text-align: center;
}
.trust-number {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand-secondary);
  line-height: 1.1;
}
.trust-label {
  font-size: 12px;
  opacity: 0.82;
  margin-top: 2px;
  white-space: nowrap;
}
.trust-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.2);
}
@media (max-width: 560px) {
  .trust-item { padding: 6px 14px; }
  .trust-number { font-size: 1.15rem; }
  .trust-divider { height: 28px; }
}

/* =============================================
   CATEGORY OVERVIEW
   ============================================= */
.category-overview {
  background: #f5f9fe;
  border-bottom: 1px solid var(--gray-border);
  padding: 36px 20px 30px;
}
.cat-overview-inner {
  max-width: var(--container-max);
  margin: 0 auto;
}
.cat-overview-header {
  text-align: center;
  margin-bottom: 22px;
}
.cat-overview-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 6px;
}
.cat-overview-header p {
  font-size: 13.5px;
  color: var(--text-muted);
}
.cat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.cat-card {
  background: #fff;
  border: 2px solid var(--gray-border);
  border-radius: 12px;
  padding: 22px 14px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cat-card:hover {
  border-color: var(--brand-secondary);
  box-shadow: 0 5px 18px rgba(0,83,133,0.13);
  transform: translateY(-3px);
}
.cat-card.active {
  border-color: var(--brand-primary);
  background: #eef5fd;
  box-shadow: 0 4px 14px rgba(0,83,133,0.15);
}
.cat-card-icon { font-size: 2.1rem; line-height: 1; }
.cat-card-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1.3;
}
.cat-card-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}
.cat-card-count {
  font-size: 11px;
  background: var(--gray-light);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
  margin-top: 4px;
  transition: all 0.2s;
}
.cat-card.active .cat-card-count {
  background: var(--brand-primary);
  color: #fff;
}

/* Guide types legend */
.guide-types-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 12px 0 2px;
  border-top: 1px solid var(--gray-border);
}
.legend-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.legend-item {
  font-size: 11.5px;
  padding: 5px 13px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.12s, box-shadow 0.15s;
  position: relative;
}
.legend-item:hover  { opacity: 0.82; transform: translateY(-1px); }
.legend-item:active { transform: translateY(0); }

/* Default (inactive) styles */
.btn-replace-legend      { background: var(--brand-secondary); color: #fff; border: 1.5px solid var(--brand-secondary); }
.btn-install-legend      { background: transparent; color: var(--brand-primary); border: 1.5px solid var(--brand-primary); }
.btn-troubleshoot-legend { background: transparent; color: var(--warning); border: 1.5px solid var(--warning); }
.btn-errors-legend       { background: transparent; color: var(--danger);  border: 1.5px solid var(--danger); }

/* Active (selected) state — solid fill + shadow */
.btn-replace-legend.active      { box-shadow: 0 0 0 3px rgba(45,164,227,0.35); }
.btn-install-legend.active      { background: var(--brand-primary); color: #fff; box-shadow: 0 0 0 3px rgba(0,83,133,0.25); }
.btn-troubleshoot-legend.active { background: var(--warning); color: #fff; box-shadow: 0 0 0 3px rgba(230,119,0,0.25); }
.btn-errors-legend.active       { background: var(--danger);  color: #fff; box-shadow: 0 0 0 3px rgba(220,38,38,0.25); }

/* Dimmed non-active siblings */
.legend-item:not(.active)[data-guide-type] { opacity: 0.55; }
/* Override when none is active */
.legend-item[data-guide-type]:only-of-type { opacity: 1; }

@media (max-width: 480px) {
  .cat-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat-card { padding: 16px 10px 14px; }
  .cat-card-icon { font-size: 1.7rem; }
  .guide-types-legend { gap: 6px; }
}

/* =============================================
   FAQ SECTION
   ============================================= */
.faq-section {
  background: #fff;
  padding: 48px 20px 52px;
  border-top: 1px solid var(--gray-border);
}
.faq-inner {
  max-width: 860px;
  margin: 0 auto;
}
.faq-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-align: center;
  margin-bottom: 8px;
}
.faq-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}
.faq-item[open] {
  box-shadow: 0 3px 12px rgba(0,83,133,0.10);
  border-color: var(--brand-secondary);
}
.faq-question {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  user-select: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--brand-secondary);
  flex-shrink: 0;
  transition: transform 0.25s;
}
.faq-item[open] .faq-question::after {
  transform: rotate(45deg);
}
.faq-answer {
  padding: 0 20px 18px;
  font-size: 14px;
  color: #333;
  line-height: 1.7;
  border-top: 1px solid var(--gray-light);
}
.faq-answer p { margin-bottom: 8px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer ul {
  margin: 8px 0 8px 4px;
  padding-right: 20px;
}
.faq-answer ul li { margin-bottom: 4px; }
@media (max-width: 600px) {
  .faq-title { font-size: 1.2rem; }
  .faq-question { font-size: 14px; }
}
