/* =====================================================================
   VITRINE 3D : style "pro" partage par les pages catalogue (categorie.php,
   recherche.php) et fiche produit (produit.php). Meme langage visuel que
   la page d'accueil : boites en verre, lisere degrade, reflet qui suit la
   souris, typo Unbounded / JetBrains Mono.
   Effets pilotes par assets/js/vitrine-3d.js ([data-incline], [data-inview],
   [data-spotlight], #buybar) et animations.js ([data-tilt], [data-reveal]).

   Performance : on n'anime que transform / opacity, aucun flou en mouvement,
   aucune animation continue.
   ===================================================================== */

/* Polices (autorisees par la CSP : fonts.googleapis.com / fonts.gstatic.com). Doit rester en tete. */
@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap");

:root {
  --font-hero: "Unbounded", var(--font-display);
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --grad-text: linear-gradient(95deg, #a78bff 0%, #00d4ff 45%, #00e39a 100%);
  --led: #3ea6ff;
  --led-soft: rgba(62, 166, 255, 0.45);
  --box-radius: 20px;
  --box-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012) 55%), rgba(17, 21, 32, 0.82);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

.text-gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Petit label technique au-dessus d'un titre */
.v3d-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-2);
}
.v3d-eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: 0.7; }

/* ==================== Boite "verre" 3D ==================== */
.box3d {
  position: relative;
  background: var(--box-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--box-radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 2px 0 rgba(0, 0, 0, 0.35),
    0 28px 60px -30px rgba(0, 0, 0, 0.85),
    0 20px 50px -30px rgba(124, 92, 255, 0.3);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease, border-color 0.35s ease;
}
.box3d::before {
  /* lisere degrade */
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 4;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(167, 139, 255, 0.75), rgba(0, 212, 255, 0.2) 35%, transparent 60%, rgba(0, 212, 255, 0.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.box3d::after {
  /* reflet qui suit le curseur (--sx/--sy poses en JS) */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  background: radial-gradient(480px circle at var(--sx, 50%) var(--sy, 0%), rgba(255, 255, 255, 0.1), transparent 45%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.box3d:hover::before,
.box3d:hover::after { opacity: 1; }
.box3d:hover { border-color: rgba(255, 255, 255, 0.13); }
@media (hover: none) {
  [data-incline] { transform: none !important; }
}

/* ==================== Apparitions (data-inview) ==================== */
html.v3d-inview-ready [data-inview]:not(.is-in) { opacity: 0; }
[data-inview].is-in {
  animation: v3d-up 0.9s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}
@keyframes v3d-up {
  from { opacity: 0; transform: translate3d(0, 32px, 0); }
  to { opacity: 1; transform: none; }
}
/* Un filter (meme nul) aplatit la 3D des cartes : on retire celui de base.css une fois apparues */
html.reveal-ready .product-grid[data-reveal-group].is-visible > * { filter: none; }

/* =====================================================================
   PAGE CATALOGUE (.shop-3d : categorie.php, recherche.php)
   ===================================================================== */
.shop-3d h1,
.shop-3d h2 { font-family: var(--font-hero); letter-spacing: -0.03em; }

/* ".container.section" : la regle .section de layout.css (padding: X 0) annule
   les marges laterales du conteneur -> contenu colle aux bords sur mobile. */
.shop-3d,
.pdp-3d { padding-left: var(--space-5); padding-right: var(--space-5); }
@media (max-width: 420px) {
  .shop-3d,
  .pdp-3d { padding-left: var(--space-4); padding-right: var(--space-4); }
}

.shop-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-6);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: var(--space-5);
  overflow: hidden;
}
.shop-hero-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 90% at 0% 0%, rgba(124, 92, 255, 0.22), transparent 70%),
    radial-gradient(ellipse 40% 80% at 100% 100%, rgba(0, 212, 255, 0.14), transparent 70%);
}
.shop-hero-glow::after {
  /* sol quadrille en perspective (fixe) */
  content: "";
  position: absolute;
  left: 30%;
  right: -20%;
  bottom: -10%;
  height: 90%;
  background-image:
    linear-gradient(rgba(62, 166, 255, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 166, 255, 0.2) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(420px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000, transparent 80%), linear-gradient(to right, transparent, #000 40%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to top, #000, transparent 80%), linear-gradient(to right, transparent, #000 40%);
  mask-composite: intersect;
  opacity: 0.35;
}
.shop-hero h1 {
  margin: 0 0 var(--space-2);
  font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem);
  line-height: 1.02;
  font-weight: 700;
}
.shop-hero p { margin: 0; max-width: 40rem; color: var(--text-muted); }
.shop-hero .shop-subcat-chips { margin-top: var(--space-4); }

.shop-hero-stats {
  display: flex;
  gap: var(--space-5);
  margin: 0;
}
.shop-hero-stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
  padding: var(--space-3) var(--space-4);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.shop-hero-stats dd {
  order: -1;
  margin: 0;
  font-family: var(--font-hero);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.shop-hero-stats dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Barre d'outils : nombre de produits + tri */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.shop-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.shop-count strong { color: #fff; font-size: 0.95rem; }
.shop-3d .sort-form select,
.shop-3d .sort-form input[type="search"] {
  min-width: 220px;
  height: 44px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 600;
  transition: border-color var(--transition), background-color var(--transition);
}
.shop-3d .sort-form select:hover,
.shop-3d .sort-form select:focus,
.shop-3d .sort-form input[type="search"]:focus { border-color: var(--primary-2); background-color: rgba(0, 212, 255, 0.06); }

/* Chips de sous-categories */
.shop-3d .shop-subcat-chip {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

/* ---- Colonne filtres en verre ---- */
.shop-3d .shop-layout { gap: var(--space-6); margin-top: 0; }
.shop-3d .filter-sidebar { top: calc(var(--header-height) + 60px); }
.shop-3d .filter-sidebar-card {
  padding: var(--space-5);
  border-radius: var(--box-radius);
  background: var(--box-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 28px 60px -30px rgba(0, 0, 0, 0.85);
}
.shop-3d .filter-sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-hero);
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.shop-3d .filter-sidebar-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-gradient);
  box-shadow: 0 0 10px var(--led-soft);
}
.shop-3d .filter-group { border-top-color: rgba(255, 255, 255, 0.07); }
.shop-3d .filter-group-summary {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.shop-3d .price-range-track { background: rgba(255, 255, 255, 0.1); }
.shop-3d .price-range-track-active { box-shadow: 0 0 12px var(--led-soft); }
.shop-3d .price-range-input::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.18), 0 2px 8px rgba(0, 0, 0, 0.5); }
.shop-3d .price-range-input::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.18), 0 2px 8px rgba(0, 0, 0, 0.5); }
.shop-3d .price-pill {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.shop-3d .price-range-apply { height: 42px; border-radius: 12px; }
/* Cases a cocher "marque" facon pastilles */
.shop-3d .filter-checkbox {
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  line-height: 1.3;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.shop-3d .filter-checkbox:hover { border-color: rgba(0, 212, 255, 0.4); background: rgba(0, 212, 255, 0.05); }
.shop-3d .filter-checkbox:has(input:checked) {
  color: #fff;
  border-color: rgba(0, 212, 255, 0.6);
  background: rgba(0, 212, 255, 0.1);
}
.shop-3d .filter-checkbox-list { gap: var(--space-2); max-height: 260px; }

/* ---- Grille produits ---- */
.shop-3d .product-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-5);
}

/* ---- Etat vide ---- */
.shop-3d .empty-state {
  border-radius: var(--box-radius);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
}

/* ---- Pagination en pastilles ---- */
.shop-3d .pagination { gap: var(--space-2); margin-top: var(--space-8); }
.shop-3d .pagination a,
.shop-3d .pagination span {
  min-width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
  font-weight: 700;
}
.shop-3d .pagination .active { box-shadow: 0 10px 26px -10px rgba(124, 92, 255, 0.8); }

@media (max-width: 900px) {
  .shop-hero { grid-template-columns: 1fr; align-items: start; }
  .shop-3d .filter-sidebar { top: auto; }
}
@media (max-width: 640px) {
  .shop-hero { text-align: center; }
  .shop-hero .v3d-eyebrow, .shop-hero .shop-subcat-chips { justify-content: center; }
  .shop-hero p { margin-left: auto; margin-right: auto; }
  .shop-hero-stats { justify-content: center; gap: var(--space-2); }
  .shop-hero-stats div { min-width: 0; flex: 1; padding: var(--space-3) var(--space-2); }
  .shop-hero-stats dd { font-size: 1.05rem; }
  .shop-toolbar { flex-direction: column; align-items: stretch; }
  .shop-3d .sort-form select,
  .shop-3d .sort-form input[type="search"] { width: 100%; }
}

/* =====================================================================
   AVIS CLIENTS / FAVORIS / COMPARATEUR (avis-clients.php, favoris.php,
   comparateur.php)
   ===================================================================== */
.avis-hero-note { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.avis-hero-note .stars { display: inline-flex; gap: 2px; color: var(--warning); }
.avis-hero-note .stars svg { width: 17px; height: 17px; }
.avis-hero-note strong { color: #fff; }
.favoris-header .btn { align-self: end; border-radius: 12px; }

/* Cartes d'avis en verre */
.shop-3d .avis-grid { gap: var(--space-4); }
.shop-3d .avis-grid .trust-card {
  position: relative;
  padding: var(--space-5);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012) 55%), #111623;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 50px -30px rgba(0, 0, 0, 0.9);
  transition: transform 0.35s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease;
}
.shop-3d .avis-grid .trust-card::before {
  /* guillemet decoratif */
  content: "\201C";
  position: absolute;
  top: 6px;
  right: 18px;
  font-family: var(--font-hero);
  font-size: 3.4rem;
  line-height: 1;
  color: rgba(124, 92, 255, 0.22);
  pointer-events: none;
}
.shop-3d .avis-grid .trust-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 212, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 30px 60px -30px rgba(62, 166, 255, 0.5);
}
.shop-3d .trust-card-title strong { font-family: var(--font-hero); font-size: 0.95rem; letter-spacing: -0.02em; color: #fff; }
@media (max-width: 640px) { .avis-hero-note { justify-content: center; } }
.shop-3d .trust-card-text { line-height: 1.6; }
.shop-3d .trust-card-meta { border-top-color: rgba(255, 255, 255, 0.07); }
.shop-3d .trust-card-meta a { color: var(--primary-2); }

/* Tableau du comparateur */
.shop-3d #comparateurTableWrap {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01) 55%), #10141f;
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.9);
}
.shop-3d #comparateurTable { border-collapse: separate; border-spacing: 0; width: 100%; }
.shop-3d #comparateurTable thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--space-4);
  background: #141a28;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}
.shop-3d #comparateurTable thead img { border-radius: 12px; }
.shop-3d #comparateurTable tbody th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.shop-3d #comparateurTable tbody th,
.shop-3d #comparateurTable tbody td {
  padding: 0.85rem var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.shop-3d #comparateurTable tbody tr:hover { background: rgba(0, 212, 255, 0.04); }
.shop-3d #comparateurTable .price-now { font-family: var(--font-hero); font-size: 1.15rem; letter-spacing: -0.03em; }
.shop-3d #comparateurTable .cmp-row-cta td { border-bottom: 0; }
.shop-3d #comparateurTable .btn-add-cart { border-radius: 12px; }
.shop-3d .cmp-toggle {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}