/* ==========================================================================
   Robert & Marcel — Filtre boutique (côté client) sur la grille FS Grid Pro.
   Injecté par plg_system_rmboutiquefiltre. Tout est scopé sous .rm-*.
   ========================================================================== */

/* Layout : sidebar à gauche + grille à droite (construit par le JS) --------- */
.rm-boutique-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 30px;
}
.rm-filtres-col {
  flex: 0 0 250px;
  max-width: 250px;
  position: sticky;
  top: 90px;
}
.rm-boutique-grid {
  flex: 1 1 0;
  min-width: 0; /* évite que la grille déborde du flex */
}
@media (max-width: 959px) {
  .rm-filtres-col { display: none; }
  .rm-boutique-grid { flex-basis: 100%; }
}

/* Carte de la sidebar ------------------------------------------------------- */
.rm-filtres {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 20px;
}
.rm-filtres__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.rm-filtres__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.rm-filtres__reset {
  font-size: .8rem;
  color: #999;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
}
.rm-filtres__reset:hover { color: #333; }
.rm-filtres__count { font-size: .85rem; color: #777; margin: 0 0 14px; }
.rm-filtres__count strong { color: #333; }

/* Sections « Trier par … » -------------------------------------------------- */
.rm-facet { border-top: 1px solid #eee; padding: 14px 0; margin: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.rm-facet:first-of-type { border-top: 0; padding-top: 0; }
.rm-facet__legend {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #b08d57;
  margin: 0 0 10px;
  padding: 0;
}
.rm-facet__subgroup {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #aaa;
  margin: 12px 0 6px;
}
.rm-facet__subgroup:first-child { margin-top: 0; }

/* Options ------------------------------------------------------------------- */
.rm-opt {
  display: flex;
  align-items: flex-start;       /* libellés longs : alignés en haut */
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  font-size: .84rem;
  line-height: 1.25;
}
.rm-opt input { margin: 2px 0 0; flex: 0 0 auto; }
.rm-opt__label { flex: 1 1 auto; min-width: 0; text-align: left; word-break: normal; overflow-wrap: anywhere; }
.rm-opt__count { flex: 0 0 auto; color: #bbb; font-size: .78rem; padding-top: 1px; }
.rm-opt:hover .rm-opt__label { color: #b08d57; }

/* Pastille de couleur ------------------------------------------------------- */
.rm-swatch { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; border: 1px solid rgba(0,0,0,.15); }
.rm-swatch--rouge     { background: #7b1e2b; }
.rm-swatch--rose      { background: #e8a0a8; }
.rm-swatch--blanc     { background: #f3e9c4; }
.rm-swatch--petillant { background: linear-gradient(135deg,#f3e9c4 50%,#e8d27a 50%); }

/* Curseur de prix (dual-range sans dépendance) ----------------------------- */
.rm-price__values { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 600; margin-bottom: 10px; }
.rm-price__slider { position: relative; height: 28px; }
.rm-price__track { position: absolute; top: 12px; left: 0; right: 0; height: 4px; background: #e5e5e5; border-radius: 2px; }
.rm-price__fill { position: absolute; top: 12px; height: 4px; background: #b08d57; border-radius: 2px; }
.rm-price__slider input[type="range"] {
  position: absolute; top: 0; left: 0; width: 100%; height: 28px; margin: 0;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.rm-price__slider input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto; -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid #b08d57;
  cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.rm-price__slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  border: 2px solid #b08d57; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.rm-price__slider input[type="range"]::-moz-range-track { background: none; }

/* Carte masquée + message vide --------------------------------------------- */
.fs-load-more-item.rm-hidden { display: none !important; }
.rm-noresult { display: none; padding: 40px 20px; text-align: center; color: #777; }
.rm-boutique-grid.is-empty .rm-noresult { display: block; }

/* Mobile : bouton + offcanvas ---------------------------------------------- */
.rm-filtre-trigger { margin-bottom: 16px; }
@media (min-width: 960px) { .rm-filtre-trigger { display: none; } }
#rm-filtres-oc .uk-offcanvas-bar { width: 300px; overflow-y: auto; }
#rm-filtres-oc .rm-filtres { border: 0; padding: 0; background: none; color: inherit; }

/* ==========================================================================
   Variante : filtre en BARRE HORIZONTALE au-dessus de la grille (layout=top)
   ========================================================================== */
.rm-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 16px;
  margin-bottom: 24px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}
.rm-topbar__facets { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; }
.rm-topbar__meta { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.rm-topbar .rm-filtres__count { margin: 0; }

/* Bouton de facette (déclencheur du dropdown) */
.rm-facet-dd { position: relative; }
.rm-facet-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #faf8f5;
  border: 1px solid #e0d9cf;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.rm-facet-btn:hover,
.rm-facet-dd .uk-open + .rm-facet-btn,
.rm-facet-dd.uk-open .rm-facet-btn { border-color: #b08d57; color: #b08d57; }
.rm-facet-btn.is-active { border-color: #b08d57; color: #b08d57; background: #f6efe4; }
.rm-facet-btn__badge {
  display: none; background: #b08d57; color: #fff; border-radius: 999px;
  font-size: .66rem; line-height: 1; padding: 3px 6px; margin-left: 2px;
}
.rm-facet-btn.is-active .rm-facet-btn__badge { display: inline-block; }

/* Dropdown d'une facette */
.rm-dd.uk-dropdown {
  min-width: 230px;
  max-height: 72vh;
  overflow-y: auto;
  padding: 16px 18px;
  border-radius: 8px;
}
.rm-dd--price.uk-dropdown { min-width: 260px; }
.rm-dd .rm-facet { border: 0; padding: 0; margin: 0; }
.rm-dd .rm-facet__legend { display: none; }   /* le bouton porte déjà le libellé */

/* Listes longues -> plusieurs colonnes (en-têtes de groupe sur toute la largeur) */
.rm-dd:not(.rm-dd--price) .rm-facet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  column-gap: 22px;
  row-gap: 1px;
}
.rm-dd .rm-facet__subgroup { grid-column: 1 / -1; }
.rm-dd--appellation.uk-dropdown { min-width: 480px; }

@media (max-width: 639px) {
  .rm-topbar { flex-direction: column; align-items: stretch; }
  .rm-topbar__facets { justify-content: center; }
  .rm-topbar__meta { margin-left: 0; justify-content: space-between; }
  .rm-dd--appellation.uk-dropdown { min-width: auto; width: calc(100vw - 36px); }
}
