/* ═══════════════════════════════════════════════════════
   Numeric Solutions — Product Catalog
   ZKTeco-inspired theme with glassmorphism & smooth animations
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables — Dark Theme (default) — ZKTeco palette ── */
:root, [data-theme="dark"] {
  --bg-primary: #050608;
  --bg-secondary: #121419;
  --bg-tertiary: #1C1F26;
  --bg-card: rgba(18, 20, 25, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);
  --border-glass: #262A33;
  --border-glass-hover: rgba(122, 201, 67, 0.25);
  --text-primary: #F5F5F5;
  --text-secondary: #B0B3B8;
  --text-muted: #7C7C84;
  --accent: #7AC943;
  --accent-light: #8BD84F;
  --accent-glow: rgba(122, 201, 67, 0.3);
  --accent-subtle: rgba(122, 201, 67, 0.1);
  --secondary: #7BC4DC;
  --green: #7AC943;
  --green-glow: rgba(122, 201, 67, 0.2);
  --orange: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Poppins', 'Inter', 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --hero-gradient: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 50%, var(--secondary) 100%);
  --card-img-bg: linear-gradient(135deg, rgba(122,201,67,0.04), rgba(123,196,220,0.04));
  --navbar-bg: rgba(5, 6, 8, 0.85);
  --navbar-bg-scrolled: rgba(5, 6, 8, 0.95);
  --modal-bg: var(--bg-secondary);
  --loading-bg: var(--bg-primary);
  --scrollbar-thumb: rgba(255,255,255,0.15);
  --scrollbar-thumb-hover: rgba(255,255,255,0.25);
}

/* ── CSS Variables — Light Theme — ZKTeco palette ── */
[data-theme="light"] {
  --bg-primary: #F5F7FA;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F0F2F5;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-glass: rgba(0, 0, 0, 0.03);
  --bg-glass-hover: rgba(0, 0, 0, 0.06);
  --border-glass: #E0E0E0;
  --border-glass-hover: rgba(122, 201, 67, 0.35);
  --text-primary: #222222;
  --text-secondary: #555555;
  --text-muted: #ADABAA;
  --accent: #7AC943;
  --accent-light: #6AB03A;
  --accent-glow: rgba(122, 201, 67, 0.2);
  --accent-subtle: rgba(122, 201, 67, 0.08);
  --secondary: #7BC4DC;
  --green: #7AC943;
  --green-glow: rgba(122, 201, 67, 0.15);
  --orange: #d97706;
  --red: #dc2626;
  --purple: #7c3aed;
  --pink: #db2777;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 30px var(--accent-glow);
  --hero-gradient: linear-gradient(135deg, #222222 0%, var(--accent) 50%, var(--secondary) 100%);
  --card-img-bg: linear-gradient(135deg, rgba(122,201,67,0.04), rgba(123,196,220,0.04));
  --navbar-bg: rgba(245, 247, 250, 0.85);
  --navbar-bg-scrolled: rgba(245, 247, 250, 0.95);
  --modal-bg: #FFFFFF;
  --loading-bg: #F5F7FA;
  --scrollbar-thumb: rgba(0,0,0,0.15);
  --scrollbar-thumb-hover: rgba(0,0,0,0.25);
}

/* ── Theme Toggle Button ── */
.theme-toggle {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-hover);
  color: var(--text-primary);
  transform: rotate(15deg);
}

.theme-toggle .icon-dark,
.theme-toggle .icon-light {
  font-size: 20px;
  transition: var(--transition);
}

[data-theme="dark"] .theme-toggle .icon-light { display: none; }
[data-theme="dark"] .theme-toggle .icon-dark { display: block; }
[data-theme="light"] .theme-toggle .icon-dark { display: none; }
[data-theme="light"] .theme-toggle .icon-light { display: block; }

/* ── Light theme body gradient override ── */
[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(122, 201, 67, 0.04), transparent),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(123, 196, 220, 0.03), transparent),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(122, 201, 67, 0.02), transparent);
}

/* ── Light theme modal overlay ── */
[data-theme="light"] .modal-overlay {
  background: rgba(0, 0, 0, 0.4);
}

/* ── Light theme card image bg ── */
[data-theme="light"] .product-card .card-image {
  background: linear-gradient(135deg, rgba(122,201,67,0.03), rgba(123,196,220,0.03));
}

/* ── Light theme badge adjustments ── */
[data-theme="light"] .badge-category {
  background: rgba(122, 201, 67, 0.1);
  border-color: rgba(122, 201, 67, 0.2);
}

[data-theme="light"] .badge-pdf {
  background: rgba(123, 196, 220, 0.1);
  border-color: rgba(123, 196, 220, 0.2);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background Gradient Mesh ── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(122, 201, 67, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(123, 196, 220, 0.06), transparent),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(122, 201, 67, 0.04), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* ── Selection ── */
::selection { background: var(--accent); color: white; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; }

a { color: var(--accent-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }

/* ── Layout ── */
.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ═══════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--navbar-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.navbar.scrolled {
  background: var(--navbar-bg-scrolled);
  box-shadow: var(--shadow-md);
}

.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.navbar-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.navbar-brand span.brand-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  display: block;
  margin-top: -2px;
}

.navbar-stats {
  display: flex;
  gap: 20px;
  align-items: center;
}

.navbar-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.navbar-stat .stat-num {
  font-weight: 700;
  color: var(--accent-light);
  font-size: 0.9rem;
}

/* ── Hamburger button (mobile only) ── */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.hamburger-btn:hover { background: var(--bg-glass-hover); }

/* ── Drawer backdrop (mobile only) ── */
.drawer-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 899;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════ */
.hero {
  padding: 120px 0 60px;
  text-align: center;
  position: relative;
}

.hero.hero-compact {
  padding: 80px 0 24px;
}

.hero.hero-compact .hero-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 8px;
}

.hero.hero-compact .hero-subtitle {
  font-size: 0.95rem;
  margin: 0 auto 16px;
  max-width: 700px;
}

.hero-stats-inline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
}

.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 100px;
}

.hero-stat i {
  font-size: 16px;
  color: var(--accent-light);
}

.hero-stat strong {
  color: var(--accent-light);
  font-weight: 700;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* ── Stats Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto 48px;
}

.stat-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
  display: block;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-light);
  display: block;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════
   SEARCH & FILTERS
   ═══════════════════════════════════════════════════════ */
.search-section {
  max-width: 900px;
  margin: 0 auto 40px;
}

.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-box input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle), var(--shadow-glow);
  background: rgba(255, 255, 255, 0.06);
}

.search-box .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.25rem;
  pointer-events: none;
}

.search-box .search-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  border-radius: 50%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-box .search-clear:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.1);
}

/* ── Filter Chips ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.filter-chip {
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.filter-chip:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-hover);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent-light);
  box-shadow: 0 0 12px var(--accent-glow);
}

.filter-chip .chip-count {
  background: rgba(255,255,255,0.1);
  padding: 1px 7px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
}

.filter-chip.active .chip-count {
  background: rgba(122, 201, 67, 0.3);
}

/* ── Results Info ── */
.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 0 4px;
}

.results-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.results-count strong {
  color: var(--accent-light);
  font-weight: 700;
}

.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border-glass);
}

.view-toggle button {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.view-toggle button.active {
  background: var(--accent-subtle);
  color: var(--accent-light);
}

/* ═══════════════════════════════════════════════════════
   CATALOG LAYOUT WITH FACETS
   ═══════════════════════════════════════════════════════ */
.catalog-section {
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px 24px 48px;
}
.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
.facets-sidebar {
  position: sticky;
  top: 80px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}
.facets-sidebar.collapsed { width: 48px; }
.facets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-glass);
}
.facets-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.facets-header h3 i { font-size: 18px; color: var(--accent-light); }
.facet-badge {
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.facet-clear-btn, .facet-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}
.facet-clear-btn:hover, .facet-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.08);
}
.facets-body {
  padding: 8px 0;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}
.facet-group {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-glass);
}
.facet-group:last-child { border-bottom: none; }
.facet-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.facet-group-title i { font-size: 14px; color: var(--accent-light); }
.facet-options { display: flex; flex-direction: column; gap: 2px; }
.facet-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.facet-checkbox:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}
.facet-checkbox.dimmed { opacity: 0.4; }
.facet-checkbox input[type="checkbox"] { display: none; }
.facet-check-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 1.5px solid var(--border-glass-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  color: var(--text-muted);
}
.facet-checkbox input:checked ~ .facet-check-icon {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent-light);
}
.facet-label {
  flex: 1; min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.facet-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 2px 7px;
  border-radius: 100px;
  font-weight: 600;
  flex-shrink: 0;
}
.facet-search-box { position: relative; }
.facet-search-box input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}
.facet-search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}
.facet-search-box input::placeholder { color: var(--text-muted); }
.facet-search-clear {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
}
.facet-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.facet-select:focus { border-color: var(--accent); }
.facet-perpage { display: flex; gap: 6px; }
.perpage-btn {
  flex: 1;
  padding: 6px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.perpage-btn:hover {
  border-color: var(--border-glass-hover);
  color: var(--text-primary);
}
.perpage-btn.active {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent-light);
}
.catalog-main { min-width: 0; }
.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 4px;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.active-facet-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  color: var(--accent-light);
  padding: 2px 8px 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0 2px;
}
.active-facet-tag button {
  background: none;
  border: none;
  color: var(--accent-light);
  cursor: pointer;
  padding: 0;
  display: flex;
  opacity: 0.7;
}
.active-facet-tag button:hover { opacity: 1; }
.facets-mobile-btn {
  display: none;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 10px;
  cursor: pointer;
  position: relative;
}
.facet-badge-sm {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--accent);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════
   PRODUCT GRID
   ═══════════════════════════════════════════════════════ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.products-grid.list-view {
  grid-template-columns: 1fr;
}

/* ── Product Card ── */
.product-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  border-color: var(--border-glass-hover);
  background: var(--bg-glass-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-card .card-image {
  position: relative;
  height: 220px;
  padding: 40px 16px 16px;
  background: var(--card-img-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card .card-image img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .card-image img {
  transform: scale(1.08);
}

.product-card .card-image .placeholder-icon {
  font-size: 3rem;
  color: var(--text-muted);
  opacity: 0.3;
}

.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 2;
}

.badge {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px);
}

.badge-category {
  background: var(--accent-subtle);
  color: var(--accent-light);
  border: 1px solid rgba(122, 201, 67, 0.2);
}

.badge-pdf {
  background: rgba(123, 196, 220, 0.15);
  color: var(--secondary);
  border: 1px solid rgba(123, 196, 220, 0.2);
}

.badge-marketing {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body .card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.card-body .card-ref {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.card-body .card-pitch {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.card-features .feature-tag {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.06);
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.card-actions .btn {
  flex: 1;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn i { font-size: 1rem; }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

.btn-ghost:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--modal-bg);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure template-if inner div fills modal and scrolls properly */
.modal > div,
.modal > template + div {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 24px 28px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-glass);
}

.modal-header .modal-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-header .modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-close {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  overflow-x: auto;
  border: 1px solid var(--border-glass);
}

.tab-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.tab-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.tab-content {
  display: none;
  animation: fadeInTab 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Detail Modal Specific ── */
.detail-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

.detail-image {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.detail-image img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}

.detail-info h2 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.detail-info .detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-info .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-glass);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--border-glass);
}

.detail-info .meta-item i {
  font-size: 0.9rem;
  color: var(--accent-light);
}

.detail-pitch {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Specs Table ── */
.specs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.specs-table tr:nth-child(even) {
  background: rgba(255,255,255,0.02);
}

.specs-table th,
.specs-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-glass);
}

.specs-table th {
  color: var(--text-secondary);
  font-weight: 500;
  width: 40%;
  background: rgba(255,255,255,0.02);
}

.specs-table td {
  color: var(--text-primary);
  font-weight: 600;
}

.specs-table tr:last-child th,
.specs-table tr:last-child td {
  border-bottom: none;
}

/* ── Feature List ── */
.feature-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.feature-list li:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-hover);
}

.feature-list li .check-icon {
  color: var(--green);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Target Cards ── */
.target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.target-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  transition: var(--transition);
}

.target-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.target-card i {
  font-size: 1.5rem;
  color: var(--accent-light);
  margin-bottom: 8px;
  display: block;
}

.target-card span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════
   MARKETING MODAL
   ═══════════════════════════════════════════════════════ */
.marketing-content-block {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}

.marketing-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-glass);
}

.marketing-content-header .channel-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.marketing-content-header .channel-label i {
  font-size: 1.1rem;
}

.marketing-content-body {
  padding: 18px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

.copy-feedback {
  font-size: 0.75rem;
  color: var(--green);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.copy-feedback.show {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 32px 0 64px;
}

.pagination .page-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.pagination .page-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
}

.pagination .page-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 10px var(--accent-glow);
}

.pagination .page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border-glass);
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer a {
  color: var(--accent-light);
}

/* ═══════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state i {
  font-size: 4rem;
  color: var(--text-muted);
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════════════════ */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--loading-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-glass);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════
   SCROLL TO TOP
   ═══════════════════════════════════════════════════════ */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--accent-glow);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px var(--accent-glow);
}

/* ═══════════════════════════════════════════════════════
   LIST VIEW CARD
   ═══════════════════════════════════════════════════════ */
.products-grid.list-view .product-card {
  flex-direction: row;
}

.products-grid.list-view .card-image {
  width: 200px;
  height: auto;
  min-height: 160px;
  flex-shrink: 0;
}

.products-grid.list-view .card-body .card-pitch {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .catalog-layout {
    grid-template-columns: 240px 1fr;
  }
  .detail-hero {
    grid-template-columns: 1fr;
  }
  .detail-image {
    height: 200px;
  }
}

@media (max-width: 768px) {
  /* ── Navbar mobile ── */
  .navbar { padding: 0 12px; height: 56px; }
  .navbar-inner { gap: 8px; }
  .navbar-brand { font-size: 1rem; gap: 8px; }
  .navbar-brand .logo-icon img { height: 26px !important; }
  .navbar-brand span.brand-sub { display: none; }
  .navbar-stats .navbar-stat { display: none; }
  .navbar-stats .btn { font-size: 0.65rem; padding: 5px 10px; }

  /* ── Hero mobile ── */
  .container { padding: 0 12px; }
  .catalog-section { padding: 8px 12px 48px; }
  .hero.hero-compact { padding: 66px 0 12px; }
  .hero-title { font-size: 1.3rem; }
  .hero-subtitle { font-size: 0.8rem; }
  .hero-stats-inline { gap: 6px; flex-wrap: wrap; }
  .hero-stat { font-size: 0.65rem; padding: 3px 8px; }

  /* ── Layout: single column ── */
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  /* ── Sidebar: off-canvas drawer ── */
  .facets-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    z-index: 900;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
    background: var(--bg-secondary);
    overflow-y: auto;
  }
  .facets-sidebar:not(.collapsed) {
    transform: translateX(0);
  }
  .facets-sidebar.collapsed {
    width: 300px;
    transform: translateX(-100%);
  }
  .facets-mobile-btn { display: flex; align-items: center; }

  /* ── Hamburger & backdrop visible on mobile ── */
  .hamburger-btn { display: flex; align-items: center; justify-content: center; }
  .drawer-backdrop { display: block; }
  .navbar-cta .cta-text { display: none; }
  .navbar-cta { padding: 5px 8px !important; border-radius: 50% !important; min-width: 0; }

  /* ── Product grid mobile ── */
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .products-grid.list-view .product-card { flex-direction: column; }
  .products-grid.list-view .card-image { width: 100%; min-height: 140px; }
  .product-card .card-image { height: 160px; padding: 32px 12px 12px; }
  .card-body { padding: 14px; }
  .card-body .card-title { font-size: 0.95rem; }
  .card-body .card-pitch { font-size: 0.8rem; -webkit-line-clamp: 2; line-clamp: 2; }
  .card-actions .btn { font-size: 0.7rem; padding: 6px 10px; }

  /* ── Modal mobile ── */
  .modal { max-height: 95vh; border-radius: var(--radius-md); margin: 8px; width: calc(100% - 16px); }
  .modal-header { padding: 16px; }
  .modal-body { padding: 16px; }
  .tabs { gap: 2px; flex-wrap: wrap; }
  .tab-btn { padding: 6px 10px; font-size: 0.7rem; }
  .detail-hero { gap: 16px; }
  .detail-image { height: 160px; }

  /* ── Footer mobile ── */
  .footer { padding: 24px 0; font-size: 0.75rem; }
  .footer div[style*="gap:24px"] { gap: 12px !important; flex-direction: column; align-items: center; }
  .footer div[style*="gap:16px"] { gap: 10px !important; }
}

@media (max-width: 480px) {
  .hero-stats-inline { display: none; }
  .hero-title { font-size: 1.2rem; }
  .hero-subtitle { font-size: 0.75rem; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-card .card-image { height: 130px; padding: 28px 8px 8px; }
  .card-body { padding: 10px; }
  .card-body .card-title { font-size: 0.85rem; }
  .card-body .card-ref { font-size: 0.65rem; }
  .card-body .card-pitch { display: none; }
  .card-actions { flex-direction: row; }
  .card-actions .btn { font-size: 0.65rem; padding: 5px 8px; }
  .badge { font-size: 0.55rem; padding: 2px 6px; }
  .target-grid { grid-template-columns: 1fr 1fr; }
  .modal { margin: 4px; width: calc(100% - 8px); }
  .tabs { gap: 1px; }
  .tab-btn { padding: 5px 8px; font-size: 0.65rem; }
}

/* ═══════════════════════════════════════════════════════
   CATEGORY COLORS
   ═══════════════════════════════════════════════════════ */
.cat-access-control { --cat-color: #3b82f6; }
.cat-video-surveillance { --cat-color: #8b5cf6; }
.cat-time-attendance { --cat-color: #10b981; }
.cat-entrance-control { --cat-color: #f59e0b; }
.cat-smart-lock { --cat-color: #ec4899; }
.cat-accessories { --cat-color: #64748b; }
.cat-alarm-detection { --cat-color: #ef4444; }
.cat-digital-signage { --cat-color: #06b6d4; }
.cat-autres { --cat-color: #94a3b8; }

/* ═══════════════════════════════════════════════════════
   ANIMATIONS (complement to AOS & GSAP)
   ═══════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-glass) 25%, rgba(255,255,255,0.06) 50%, var(--bg-glass) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
