/**
 * Page "Explora por marca" - styles scopes sous .ra-brands pour ne pas
 * entrer en collision avec le theme. Repris de la maquette statique du collegue.
 */
/* Poppins : chargee par repiauto_brands.php (registerStylesheet remote), pas en @import
   (un @import ne demarre qu'apres le telechargement de ce fichier). */

.ra-brands {
  /* Tout le texte du module en Poppins (cf. autres pages du theme). */
  font-family: 'Poppins', sans-serif;
  --red: #E81F1F;
  --red-dark: #c41616;
  --navy: #0B1E3D;
  --navy-light: #0B1E3D;
  --gray-bg: #f4f4f2;
  --gray-mid: #e2e2df;
  --gray-text: #777771;
  --white: #ffffff;
  --text: #0B1E3D;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 6px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.13);
  --border: 1px solid var(--gray-mid);
  color: var(--text);
}

.ra-brands *, .ra-brands *::before, .ra-brands *::after { box-sizing: border-box; }
/* Force Poppins meme sur les elements de formulaire (input/button/select
   n'heritent pas toujours la font-family du parent). */
.ra-brands input, .ra-brands button, .ra-brands select, .ra-brands textarea { font-family: inherit; }

/* ── SECTION HEADER ── */
.ra-brands .section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}
.ra-brands .section-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 5px;
}
.ra-brands .section-eyebrow::before {
  content: '';
  display: block;
  width: 18px;
  height: 2.5px;
  background: var(--red);
  border-radius: 2px;
}
.ra-brands .section-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.ra-brands .section-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  margin-top: 3px;
}
.ra-brands .ra-intro {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin-top: 10px;
}
.ra-brands .ra-intro p { margin: 0 0 8px; }
.ra-brands .ra-intro p:last-child { margin-bottom: 0; }

/* ── SEARCH INPUT ── */
.ra-brands .search-wrap {
  position: relative;
  width: 240px;
}
.ra-brands .search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text);
  pointer-events: none;
}
.ra-brands .search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 36px;
  border: var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ra-brands .search-input:focus {
  outline: none;
  /* Meme epaisseur (1px), juste une bordure plus foncee ; pas de halo. */
  border-color: var(--text);
  box-shadow: none;
}
/* Placeholder : bleu #0B1E3D mais attenue (meme aspect discret que l'ancien gris). */
.ra-brands .search-input::placeholder { color: rgba(11,30,61, 0.55); opacity: 1; }

/* Ligne du label "Les plus recherchees" + bouton "effacer la selection" a droite. */
.ra-brands .sidebar-section-label.pills-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
/* Bouton "effacer la selection" pres des pills : apparait quand une marque est
   selectionnee (via pill), et remet la liste a zero. */
.ra-brands .pills-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--navy);
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.ra-brands .pills-clear:hover { background: var(--navy); color: #fff; }
.ra-brands .pills-clear svg { flex-shrink: 0; }

/* ── FILTER CHIPS ── */
.ra-brands .filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
}
.ra-brands .filter-chip {
  height: 34px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: var(--border);
  background: var(--white);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ra-brands .filter-chip:hover { border-color: var(--red); color: var(--red); background: #fff5f6; }
.ra-brands .filter-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 600;
}
.ra-brands .chip-count {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  padding: 1px 6px;
  border-radius: 20px;
}
.ra-brands .filter-chip:not(.active) .chip-count {
  background: var(--gray-mid);
  color: var(--gray-text);
}

/* ── RESULTS META ── */
.ra-brands .results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.ra-brands .results-count {
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
}
.ra-brands .results-count strong { color: var(--text); font-weight: 600; }
.ra-brands .results-count .highlight { color: var(--red); font-weight: 600; }

/* ── PAGE LAYOUT ── */
.ra-brands .page-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
  padding: 0px 0 64px;
  box-sizing: border-box;
}

/* Au-dessus de 768px : on recupere le padding lateral du container du theme (≈15px)
   via une marge negative scopee, pour elargir la zone (sans coller aux bords : on
   compense par un padding equivalent sur le layout). */
@media (min-width: 769px) {
  .ra-brands {
    margin-left: -15px;
    margin-right: -15px;
  }
  .ra-brands .page-layout {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Plage tablette (769–1024px) : la sidebar fixe + 3 colonnes rendaient les cartes
   trop etroites → le compteur et le CTA "Voir" se chevauchaient. On resserre la
   sidebar et le gap pour donner plus de largeur aux blocs, et on autorise le corps
   de carte a passer le CTA sous le compteur si la place manque. */
@media (min-width: 769px) and (max-width: 1024px) {
  .ra-brands .sidebar { width: 200px; padding: 18px 14px; }
  .ra-brands .page-layout { gap: 16px; }
  .ra-brands .brand-grid { gap: 12px; }
  .ra-brands .brand-card-body {
    flex-wrap: wrap;
    gap: 4px 8px;
  }
  .ra-brands .brand-card-count { font-size: 11px; }
  .ra-brands .brand-card-cta { font-size: 10px; }
}

/* ── SIDEBAR ── */
.ra-brands .sidebar {
  width: 235px;
  flex-shrink: 0;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  position: sticky;
  top: 135px;
  max-height: calc(100vh - 155px);
  overflow-y: auto;
  /* Masque la barre de scroll (Firefox / IE) */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
/* Masque la barre de scroll (Chrome / Safari / Edge) */
.ra-brands .sidebar::-webkit-scrollbar { display: none; }
.ra-brands .sidebar-brand { margin-bottom: 4px; }
.ra-brands .sidebar-divider {
  height: 1px;
  background: var(--gray-mid);
  margin: 16px 0;
}
.ra-brands .sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 10px;
}
.ra-brands .sidebar .filter-bar {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  margin-bottom: 0;
}
.ra-brands .sidebar .filter-chip {
  border-radius: var(--radius-sm);
  justify-content: space-between;
  padding: 0 14px;
  height: 36px;
  font-size: 13px;
}
.ra-brands .sidebar .search-wrap { width: 100%; }
.ra-brands .sidebar .search-input {
  width: 100%;
  border-radius: var(--radius-sm);
}

/* ── MAIN CONTENT ── */
.ra-brands .main-content { flex: 1; min-width: 0; }

/* ── BRAND GRID ── */
.ra-brands .brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
  width: 100%;
}

/* ── RESPONSIVE ── */
/* La grille reste en 3 colonnes tant qu'on est AU-DESSUS de ~600px (y compris en
   tablette, sidebar repliee au-dessus). On ne passe a 2 colonnes que sous 600px. */
@media (max-width: 1024px) {
  .ra-brands .brand-grid { gap: 14px; }
}
@media (max-width: 720px) {
  .ra-brands .page-layout { flex-direction: column; }
  .ra-brands .sidebar { width: 100%; position: static; }
  .ra-brands .sidebar .filter-bar { flex-direction: row; flex-wrap: wrap; }
  .ra-brands .sidebar .filter-chip { flex: unset; }
}
/* Telephone : 2 colonnes seulement sous 600px. */
@media (max-width: 600px) {
  .ra-brands .brand-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 400px) {
  .ra-brands .brand-grid { gap: 10px; }
}

.ra-brands .brand-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: var(--border);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
}
.ra-brands .brand-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: #ccc;
}

.ra-brands .brand-card-img {
  position: relative;
  height: 148px;
  overflow: hidden;
  background: var(--gray-mid);
}
.ra-brands .brand-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  display: block;
}
.ra-brands .brand-card:hover .brand-card-img img { transform: scale(1.07); }

.ra-brands .brand-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s;
}
.ra-brands .brand-card:hover .brand-card-overlay { background: rgba(232,31,31,0.52); }

/* <h2> pour le SEO : on neutralise les styles de titre du theme
   (margin, line-height) pour garder le rendu du <span> d'origine. */
.ra-brands .brand-card-name {
  margin: 0;
  padding: 0;
  line-height: 1.2;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.45);
  text-align: center;
}

.ra-brands .brand-card-body {
  padding: 11px 14px 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: var(--border);
}
.ra-brands .brand-card-label {
  display: none;
}
.ra-brands .brand-card-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.ra-brands .brand-card-cta {
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.ra-brands .brand-card-cta svg { transition: transform 0.2s; }
.ra-brands .brand-card:hover .brand-card-cta svg { transform: translateX(3px); }

.ra-brands .badge-premium {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--navy);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  z-index: 2;
}
.ra-brands .badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  z-index: 2;
}

/* ── NO RESULTS ── */
.ra-brands .no-results {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  text-align: center;
  gap: 10px;
  grid-column: 1 / -1;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: var(--border);
}
.ra-brands .no-results-icon { font-size: 40px; opacity: 0.25; }
.ra-brands .no-results-title { font-size: 16px; font-weight: 700; }
.ra-brands .no-results-sub { font-size: 13px; color: var(--text); }
.ra-brands .no-results-btn {
  margin-top: 8px;
  height: 38px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  border: var(--border);
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.ra-brands .no-results-btn:hover { background: var(--gray-bg); }

/* ── SORT DROPDOWN ──
   Meme famille que le selecteur "Cuadricula / Lista" de la page categories : piste
   grise #f5f7fa en pilule, face blanche avec ombre douce, Poppins 600. Liste stylee
   (pas le <select> natif) avec ouverture/fermeture animee. */
.ra-brands .ra-sort { position: relative; display: inline-block; }
.ra-brands .ra-sort-btn {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: var(--radius-pill);
  background: #f5f7fa;
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.ra-brands .ra-sort-face {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px 0 14px;
  border-radius: var(--radius-pill);
  background: var(--white);
  box-shadow: 0 1px 6px rgba(11,30,61,.14);
  white-space: nowrap;
}
.ra-brands .ra-sort-ic { flex: none; transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.ra-brands .ra-sort-btn:hover .ra-sort-ic { transform: scale(1.15); }
.ra-brands .ra-sort-chev { flex: none; transition: transform .3s cubic-bezier(.22,1,.36,1); }
.ra-brands .ra-sort.open .ra-sort-chev { transform: rotate(180deg); }
.ra-brands .ra-sort-btn:focus { outline: none; }
.ra-brands .ra-sort-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.ra-brands .ra-sort-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  min-width: 100%;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--white);
  border: 1px solid #e6ebf1;
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px -20px rgba(11,30,61,.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  transform-origin: top left;
  transition: opacity .18s ease, transform .25s cubic-bezier(.22,1,.36,1), visibility 0s linear .25s;
}
.ra-brands .ra-sort.open .ra-sort-list {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .18s ease, transform .25s cubic-bezier(.22,1,.36,1), visibility 0s;
}
.ra-brands .ra-sort-list > li.ra-sort-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: none;
  list-style: none;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--navy);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s;
}
.ra-brands .ra-sort-list > li.ra-sort-opt::before,
.ra-brands .ra-sort-list > li.ra-sort-opt::marker { content: none; display: none; }
.ra-brands .ra-sort-list > li.ra-sort-opt:hover,
.ra-brands .ra-sort-list > li.ra-sort-opt:focus { background: #f5f7fa; outline: none; }
.ra-brands .ra-sort-list > li.ra-sort-opt[aria-selected="true"] { font-weight: 600; }
.ra-brands .ra-sort-opt svg { flex: none; color: var(--red); opacity: 0; transition: opacity .15s; }
.ra-brands .ra-sort-opt[aria-selected="true"] svg { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .ra-brands .ra-sort-list, .ra-brands .ra-sort-chev, .ra-brands .ra-sort-ic { transition: none; }
}

/* ── RECENT / POPULAR BRANDS ── */
.ra-brands .sidebar-brand-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ra-brands .brand-pill {
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  /* Contour bleu (demande collegue) au lieu du gris. */
  border: 1px solid var(--navy);
  background: var(--white);
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ra-brands .brand-pill:hover { border-color: var(--navy); color: var(--navy); background: #eef0f3; }
/* Pill selectionnee (marque choisie via clic) : remplie en bleu. */
.ra-brands .brand-pill.selected {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 600;
}
.ra-brands .brand-pill.recent { text-transform: capitalize; }

/* ── COUNT POP ANIMATION ── */
@keyframes raCountPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.ra-brands .pop { animation: raCountPop 0.3s ease; }

/* ── MOBILE ONLY ── */
@media (max-width: 768px) {

  .ra-brands .sidebar {
    width: 100%;
    position: static;
    max-height: none;
    overflow: visible;
    padding: 16px 12px 8px;
  }

  .ra-brands .section-title { font-size: 18px; }
  .ra-brands .section-eyebrow { font-size: 9px; }

  /* Aere l'intro avant la recherche mobile (qui suit directement). */
  .ra-brands .ra-intro { margin-bottom: 14px; }

  .ra-brands .sidebar .search-wrap,
  .ra-brands .sidebar #popular-pills,
  .ra-brands .sidebar #recent-block,
  .ra-brands .sidebar #results-count,
  .ra-brands .sidebar .sidebar-divider,
  .ra-brands .sidebar .sidebar-section-label { display: none; }

  .ra-brands .sidebar .sidebar-section-label.filter-label { display: none; }

  .ra-brands .sidebar .filter-bar {
    flex-direction: row !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
    margin-bottom: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .ra-brands .sidebar .filter-bar::-webkit-scrollbar { display: none; }
  .ra-brands .sidebar .filter-chip {
    border-radius: var(--radius-pill) !important;
    flex-shrink: 0;
    height: 32px;
    font-size: 12px;
    padding: 0 12px;
  }

  .ra-brands .mobile-search-wrap {
    display: flex !important;
    position: relative;
    margin-bottom: 10px;
  }
  .ra-brands .mobile-search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text);
    pointer-events: none;
  }
  .ra-brands .mobile-search-wrap input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 36px;
    border: var(--border);
    border-radius: var(--radius-pill);
    font-size: 13px;
    color: var(--text);
    background: var(--white);
  }
  .ra-brands .mobile-search-wrap input:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: none;
  }
  .ra-brands .mobile-search-wrap input::placeholder { color: rgba(11,30,61, 0.55); opacity: 1; }

  .ra-brands .page-layout {
    flex-direction: column;
    gap: 8px;
    padding: 12px 0 40px;
  }

  /* Pas de nombre de colonnes ici : la grille reste en 3 col jusqu'a 600px
     (voir @media max-width:600px). On n'ajuste que l'espacement. */
  .ra-brands .brand-grid {
    gap: 10px;
  }

  .ra-brands .brand-card-img { height: 110px; }

  .ra-brands .brand-card-body {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 10px 10px;
  }
  .ra-brands .brand-card-count {
    font-size: 11px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.5;
    display: block;
  }
  .ra-brands .brand-card-count .line1 { display: block; }
  .ra-brands .brand-card-count .line2-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .ra-brands .brand-card-count .line2-wrap .mobile-cta {
    font-size: 11px;
    font-weight: 600;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
  }
  .ra-brands .brand-card-cta { display: none; }

  .ra-brands .results-meta { margin-bottom: 10px; }
}

/* ── BRIEF 28/10/2026 : sidebar identique a "Recambios por categoria" ──
   Titre, marges et espacements alignes sur la page categories (reference pour ces
   points) ; un seul bleu (#0B1E3D) et un seul rouge (#E81F1F), via les variables. */
.ra-brands .section-title {
  font-size: 1.3rem;
  line-height: 1.25;
  margin: .3rem 0 0;
  text-wrap: balance;
}
.ra-brands .ra-intro { margin-top: 10px; }
.ra-brands .sidebar-divider { margin: 14px 0; }
@media (min-width: 769px) and (max-width: 1024px) {
  .ra-brands .section-title { font-size: 1.1rem; }
}
@media (max-width: 768px) {
  .ra-brands .sidebar { padding: 18px 16px 16px; }
  .ra-brands .section-title { font-size: 19px; line-height: 1.2; margin: .45rem 0 0; }
}
