/* ======================================================
   DIMA AGLO — Styles page catalogue produits
   Catalogue dynamique avec catégories et recherche
   ====================================================== */

.catalogue-page { padding: 4rem 0 6rem; }

/* ====== Barre de recherche ====== */
.search-bar {
  position: sticky;
  top: 80px;
  z-index: 50;
  background: var(--surface);
  padding: 1.2rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px -10px rgba(45,31,23,0.15);
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
}
.search-bar svg {
  width: 22px;
  height: 22px;
  color: var(--ink-mute);
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  padding: 0.5rem 0;
}
.search-input::placeholder { color: var(--ink-mute); }
.search-clear {
  background: var(--surface-2);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--ink-soft);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}
.search-clear:hover { background: var(--clay-500); color: white; }
.search-clear.visible { display: flex; }

/* ====== Statistiques rapides ====== */
.catalogue-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
}
.catalogue-stats strong {
  color: var(--clay-500);
  font-weight: 600;
}

/* ====== Onglets de catégories ====== */
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.88rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.cat-tab:hover {
  border-color: var(--clay-500);
  color: var(--clay-500);
  transform: translateY(-1px);
}
.cat-tab.active {
  background: var(--clay-500);
  border-color: var(--clay-500);
  color: var(--sand-50);
}
.cat-tab .count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  background: rgba(0,0,0,0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}
.cat-tab.active .count {
  background: rgba(255,255,255,0.25);
  color: var(--sand-50);
}

/* ====== Section catégorie ====== */
.cat-section {
  margin-bottom: 4rem;
  scroll-margin-top: 160px;
}
.cat-section.hidden { display: none; }

.cat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--clay-500);
  flex-wrap: wrap;
}
.cat-header-left {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.cat-icon {
  width: 56px;
  height: 56px;
  background: var(--sand-100);
  color: var(--clay-500);
  display: grid;
  place-items: center;
  border-radius: 12px;
  flex-shrink: 0;
}
.cat-icon svg { width: 28px; height: 28px; }
.cat-title-wrap h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--earth-900);
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}
.cat-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cat-count-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--clay-500);
  background: rgba(196,89,62,0.08);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

/* ====== Liste des produits (table style) ====== */
.products-table {
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.products-table-head {
  display: grid;
  grid-template-columns: 200px 1fr 120px;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--surface-2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.product-row {
  display: grid;
  grid-template-columns: 200px 1fr 120px;
  gap: 1rem;
  padding: 1rem 1.5rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}
.product-row:last-child { border-bottom: none; }
.product-row:hover { background: var(--sand-50); }
.product-row.hidden { display: none; }

.product-ref {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--clay-500);
  font-weight: 600;
  letter-spacing: 0.02em;
  word-break: break-word;
}
.product-name {
  font-family: 'Manrope', sans-serif;
  font-size: 0.92rem;
  color: var(--earth-900);
  font-weight: 500;
  line-height: 1.4;
}
.product-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: transparent;
  color: var(--clay-500);
  border: 1px solid var(--clay-500);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  justify-self: end;
}
.product-action:hover {
  background: var(--clay-500);
  color: var(--sand-50);
}

/* ====== État vide / Pagination ====== */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--ink-mute);
  display: none;
}
.no-results.visible { display: block; }
.no-results h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  color: var(--earth-900);
  margin-bottom: 0.5rem;
}
.no-results p { margin-bottom: 1.5rem; }

.show-more-wrap {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--line);
}
.show-more-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
}
.show-more-btn:hover {
  border-color: var(--clay-500);
  color: var(--clay-500);
}

/* ====== Loader ====== */
.loader-wrap {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--ink-mute);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}
.loader {
  width: 36px;
  height: 36px;
  border: 3px solid var(--sand-200);
  border-top-color: var(--clay-500);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ====== Responsive ====== */
@media (max-width: 720px) {
  .catalogue-page { padding: 2rem 0 4rem; }

  .search-bar {
    top: 70px;
    padding: 0.9rem 1.2rem;
  }
  .search-input { font-size: 0.92rem; }

  .products-table-head {
    display: none;
  }
  .product-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 1.2rem 1rem;
  }
  .product-ref::before {
    content: "Réf : ";
    color: var(--ink-mute);
    font-weight: 400;
  }
  .product-action {
    justify-self: flex-start;
    margin-top: 0.4rem;
  }

  .cat-header { padding-bottom: 0.8rem; }
  .cat-icon { width: 44px; height: 44px; }
  .cat-icon svg { width: 22px; height: 22px; }
  .cat-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 1rem;
    scrollbar-width: thin;
  }
  .cat-tab { white-space: nowrap; flex-shrink: 0; }
}
