
/* =========================================================================
   Rally Mega Store — refonte visuelle page catégorie (v5)
   Fichier chargé APRÈS category-rms-v2.css et custom-rms-category-v4.css.
   Périmètre : body#category.page-category uniquement (listing catégorie).
   Auteur : Prime Agent, 09/09/2026. Revert : retirer le <link> dans category.tpl.
   ========================================================================= */

body#category.page-category {
  --d-ink: #151719;
  --d-ink-2: #2b2f33;
  --d-muted: #5b6064;
  --d-line: #e5e5e1;
  --d-line-2: #d4d4ce;
  --d-soft: #f5f5f2;
  --d-accent: #fc4c01;
  --d-accent-ink: #b93600;
  --d-radius: 16px;
}

/* =======================  1. EN-TÊTE « PADDOCK »  ======================== */
body#category.page-category .rally-category-header {
  margin: 0 0 18px !important;
}

body#category.page-category .rally-category-header__inner {
  background: linear-gradient(128deg, #151719 0%, #1c2025 58%, #262b31 100%) !important;
  border: 0 !important;
  border-radius: var(--d-radius) !important;
  overflow: hidden !important;
  padding: 30px 34px 26px !important;
  position: relative !important;
}

/* hachures façon carbone */
body#category.page-category .rally-category-header__inner::after {
  background-image: repeating-linear-gradient(118deg,
      rgba(255, 255, 255, .055) 0 2px,
      rgba(255, 255, 255, 0) 2px 13px);
  content: "" !important;
  display: block !important;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

/* liseré orange en haut */
body#category.page-category .rally-category-header__inner::before {
  background: var(--d-accent) !important;
  content: "" !important;
  display: block !important;
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 2;
}

body#category.page-category .rally-category-header__inner > * {
  position: relative;
  z-index: 3;
}

body#category.page-category .rally-category-header__topline {
  align-items: center !important;
  color: #ff9a63 !important;
  display: flex !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  gap: 10px !important;
  letter-spacing: .18em !important;
  margin: 0 0 14px !important;
  text-transform: uppercase;
}

body#category.page-category .rally-category-header__topline::before {
  background: var(--d-accent) !important;
  content: "" !important;
  display: block !important;
  height: 3px !important;
  width: 26px !important;
}

body#category.page-category .rally-category-header__title {
  color: #fff !important;
  font-family: "Archivo Black", "Arial Black", "Helvetica Neue", sans-serif !important;
  font-size: clamp(34px, 4.6vw, 62px) !important;
  font-weight: 400 !important;
  letter-spacing: -.035em !important;
  line-height: .95 !important;
  margin: 0 !important;
  text-wrap: balance;
}

body#category.page-category .rally-category-header__bottomline {
  align-items: center !important;
  gap: 12px 16px !important;
  margin: 18px 0 0 !important;
}

body#category.page-category .rally-category-header__count {
  background: rgba(255, 255, 255, .10) !important;
  border: 1px solid rgba(255, 255, 255, .24) !important;
  border-radius: 999px !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .08em !important;
  padding: 8px 14px !important;
}

body#category.page-category .rally-category-header__hint {
  color: rgba(255, 255, 255, .74) !important;
  font-size: 13px !important;
}

/* bouton guide des tailles dans l'en-tête */
body#category.page-category .rally-category-header__cta {
  align-items: center;
  background: var(--d-accent);
  border: 1px solid var(--d-accent);
  border-radius: 999px;
  color: #fff !important;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  letter-spacing: .06em;
  line-height: 1;
  margin-left: auto;
  padding: 12px 18px;
  text-decoration: none !important;
  text-transform: uppercase;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

body#category.page-category .rally-category-header__cta:hover,
body#category.page-category .rally-category-header__cta:focus-visible {
  background: #fff;
  border-color: #fff;
  color: var(--d-ink) !important;
}

/* =======================  2. CHAPEAU ÉDITORIAL  ========================== */
body#category.page-category .rms-cat-intro {
  background: #fff;
  border: 1px solid var(--d-line);
  border-left: 4px solid var(--d-accent);
  border-radius: 12px;
  color: var(--d-ink-2);
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 18px;
  padding: 16px 20px;
}

body#category.page-category .rms-cat-intro p {
  margin: 0 0 8px;
}

body#category.page-category .rms-cat-intro p:last-child {
  margin-bottom: 0;
}

body#category.page-category .rms-cat-intro strong {
  color: var(--d-ink);
  font-weight: 800;
}

body#category.page-category .rms-cat-intro a {
  color: var(--d-accent-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===========================  3. BARRE TRI  ============================== */
body#category.page-category #js-product-list-top {
  border-radius: 14px !important;
  margin: 0 0 18px !important;
  padding: 9px 12px !important;
}

body#category.page-category #js-product-list-top .showing {
  color: var(--d-muted) !important;
  font-size: 11px !important;
  letter-spacing: .04em !important;
}

body#category.page-category #js-product-list-top .view-switcher a {
  height: 40px !important;
  width: 40px !important;
}

/* =========================  4. GRILLE + CARTES  ========================== */
body#category.page-category #js-product-list .products-grid {
  gap: 24px 20px !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body#category.page-category .products-grid .product-miniature {
  background: #fff !important;
  border: 1px solid var(--d-line) !important;
  border-radius: 14px !important;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  body#category.page-category .products-grid .product-miniature:hover,
  body#category.page-category .products-grid .product-miniature:focus-within {
    border-color: var(--d-line-2) !important;
    box-shadow: 0 16px 34px rgba(21, 23, 26, .11);
    transform: translateY(-3px);
  }
}

/* --- image : fond blanc pour fondre les visuels produits --- */
body#category.page-category #js-product-list .product-miniature .thumbnail-container {
  background: #fff !important;
}

body#category.page-category #js-product-list .product-miniature .product-thumbnail {
  aspect-ratio: 4 / 5 !important;
  background: #fff !important;
}

body#category.page-category #js-product-list .product-miniature .product-thumbnail img {
  background: #fff !important;
  object-fit: contain !important;
  padding: 6px !important;
}

/* --- badge --- */
body#category.page-category #js-product-list .product-miniature .product-flags {
  left: 12px !important;
  top: 12px !important;
}

body#category.page-category #js-product-list .product-miniature .product-flag {
  border-radius: 999px !important;
  font-size: 10px !important;
  letter-spacing: .1em !important;
  padding: 6px 11px !important;
}

/* --- corps de carte --- */
body#category.page-category #js-product-list .product-miniature .product-description {
  padding: 16px 18px 18px !important;
}

body#category.page-category #js-product-list .product-miniature .product-brand {
  color: var(--d-muted) !important;
  font-size: 10px !important;
  letter-spacing: .14em !important;
  margin: 0 0 8px !important;
}

body#category.page-category #js-product-list .product-miniature .product-title {
  font-size: 15px !important;
  height: 41px !important;
  line-height: 1.35 !important;
  margin: 0 0 10px !important;
  min-height: 41px !important;
}

body#category.page-category #js-product-list .product-miniature .product-price,
body#category.page-category #js-product-list .product-miniature .product-price * {
  font-size: 20px !important;
  letter-spacing: -.025em !important;
}

/* --- bouton panier : discret au repos, franc au survol --- */
body#category.page-category #js-product-list .product-miniature .product-add-cart {
  padding-top: 16px !important;
}

body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list {
  background: #fff !important;
  border: 1px solid var(--d-line-2) !important;
  border-radius: 10px !important;
  color: var(--d-ink) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: .05em !important;
  min-height: 44px !important;
  transition: background .18s ease, border-color .18s ease, color .18s ease !important;
}

body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list:hover,
body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list:focus-visible {
  background: var(--d-accent) !important;
  border-color: var(--d-accent) !important;
  color: #fff !important;
}

body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list .bag-icon {
  margin-right: 6px;
}

/* --- aperçu rapide : pastille en bas à droite de l'image --- */
body#category.page-category .product-miniature .product-functional-buttons {
  bottom: 12px !important;
  left: auto !important;
  top: auto !important;
  right: 12px !important;
  transform: translateY(8px) !important;
}

body#category.page-category .product-miniature:hover .product-functional-buttons,
body#category.page-category .product-miniature:focus-within .product-functional-buttons {
  transform: translateY(0) !important;
}

/* =====================  5. FILTRES (COLONNE GAUCHE)  ===================== */
body#category.page-category #left-column .PM_ASBlockOutput .card,
body#category.page-category #left-column .card {
  border: 1px solid var(--d-line) !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  overflow: hidden;
}

body#category.page-category #left-column .card-header {
  background: #fff !important;
  border-bottom: 1px solid var(--d-line) !important;
  padding: 14px 16px !important;
}

body#category.page-category #left-column .PM_ASBlockTitle {
  color: var(--d-ink) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: .14em !important;
  text-transform: uppercase;
}

body#category.page-category #left-column .card-block {
  padding: 6px 16px 16px !important;
}

body#category.page-category #left-column .PM_ASCriterionsGroup {
  border-top: 1px solid var(--d-line);
  padding: 14px 0;
}

body#category.page-category #left-column .PM_ASCriterionsGroup:first-child {
  border-top: 0;
}

body#category.page-category #left-column .PM_ASCriterionsGroupTitle {
  color: var(--d-ink) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .12em !important;
  margin: 0 0 10px !important;
  text-transform: uppercase;
}

body#category.page-category #left-column .PM_ASLabelLink,
body#category.page-category #left-column .PM_ASCriterionNbProduct {
  color: var(--d-muted) !important;
}

/* liste de marques : hauteur bornée + défilement */
body#category.page-category #left-column .PM_ASCriterionGroupCheckbox {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-color: var(--d-line-2) transparent;
  scrollbar-width: thin;
}

body#category.page-category #left-column .PM_ASCriterionGroupCheckbox::-webkit-scrollbar {
  width: 6px;
}

body#category.page-category #left-column .PM_ASCriterionGroupCheckbox::-webkit-scrollbar-thumb {
  background: var(--d-line-2);
  border-radius: 999px;
}

/* ==========================  6. PAGINATION  ============================== */
body#category.page-category .pagination .page-list {
  gap: 6px;
}

body#category.page-category .pagination .page-list li a,
body#category.page-category .pagination .page-list li span {
  border-radius: 10px;
  font-weight: 700;
}

/* ===========================  7. RESPONSIVE  ============================= */
@media (min-width: 992px) and (max-width: 1399px) {
  body#category.page-category #js-product-list .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 991px) {
  body#category.page-category #js-product-list .products-grid {
    gap: 18px 14px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 767px) {
  body#category.page-category .rally-category-header__inner {
    padding: 20px 18px 18px !important;
  }

  body#category.page-category .rally-category-header__title {
    font-size: 34px !important;
  }

  body#category.page-category .rally-category-header__cta {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  body#category.page-category .rms-cat-intro {
    font-size: 13.5px;
    padding: 14px 16px;
  }

  body#category.page-category #js-product-list .product-miniature .product-description {
    padding: 12px 12px 14px !important;
  }

  body#category.page-category #js-product-list .product-miniature .product-title {
    font-size: 13.5px !important;
    height: 37px !important;
    min-height: 37px !important;
  }

  body#category.page-category #js-product-list .product-miniature .product-price,
  body#category.page-category #js-product-list .product-miniature .product-price * {
    font-size: 17px !important;
  }

  /* sur mobile le bouton reste plein : c'est le seul affordance tactile */
  body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list {
    background: var(--d-ink) !important;
    border-color: var(--d-ink) !important;
    color: #fff !important;
    font-size: 11px !important;
    letter-spacing: .02em !important;
    min-height: 42px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body#category.page-category .product-miniature,
  body#category.page-category .product-miniature * {
    transition: none !important;
  }

  body#category.page-category .products-grid .product-miniature:hover,
  body#category.page-category .products-grid .product-miniature:focus-within {
    transform: none !important;
  }
}

/* --- doublon de groupe « Couleur » (module Advanced Search 4) --- */
body#category.page-category #left-column #PM_ASCriterionsGroup_1_21 {
  display: none !important;
}

/* ==================  8. CORRECTIONS ITÉRATION 2 (16h30)  ================= */
/* le surtitre avait été masqué par une passe précédente : on le remet,
   il structure le bandeau et donne le contexte « collection officielle » */
body#category.page-category .rally-category-header__topline,
body#category.page-category.category-id-12 .rally-category-header__topline {
  height: auto !important;
  margin: 0 0 14px !important;
  opacity: 1 !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

/* bouton panier : bord plus franc, sinon il paraît désactivé */
body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list {
  border-color: #c9c9c2 !important;
  color: var(--d-ink) !important;
}

/* mention TTC : repère prix attendu sur un site FR */
body#category.page-category #js-product-list .product-miniature .product-price::after {
  content: "TTC";
  color: var(--d-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  margin-left: 5px;
  vertical-align: 2px;
}

/* ==================  9. CORRECTIONS ITÉRATION 3 (mobile)  ================ */
/* Sur 2 colonnes le libellé complet débordait du bouton : libellé court
   « Ajouter » + icône, et on bloque tout débordement horizontal. */
@media (max-width: 767px) {
  body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list {
    font-size: 0 !important;
    overflow: hidden !important;
    padding: 0 8px !important;
    white-space: nowrap !important;
  }

  body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list .bag-icon,
  body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list .spinner-icon {
    font-size: 13px !important;
  }

  body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list::after {
    content: "Ajouter";
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list .bag-icon {
    margin-right: 7px;
  }
}

/* ==================  10. CORRECTIONS ITÉRATION 4 (mobile)  =============== */
/* le bouton mobile doit rester blanc sur fond encre : la règle desktop
   « color: ink » passait après celle du media query. On force ici. */
@media (max-width: 767px) {
  body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list {
    color: #fff !important;
    line-height: 42px !important;
  }

  body#category.page-category #js-product-list .product-miniature .product-add-cart .btn-product-list::after {
    line-height: 1.2;
  }
}

/* ==================  11. ITÉRATION 5 — palier tablette  ================= */
/* Entre 768 et 991 px la colonne filtres restait un rail statique avec une
   croix « fermer » sans effet. On garde le rail, mais avec un vrai titre et
   des pastilles de taille plus compactes (3 par ligne). */
@media (min-width: 768px) and (max-width: 991px) {
  body#category.page-category #left-column:not(.rms-filters-open) .rms-f-head {
    display: none !important;
  }

  body#category.page-category #left-column:not(.rms-filters-open) #PM_ASBlock_1 > .card-header {
    display: flex !important;
  }

  body#category.page-category #left-column .card-block {
    padding: 4px 10px 12px !important;
  }

  body#category.page-category #left-column .PM_ASCriterionsGroupAttribute .PM_ASLabelLink {
    font-size: 12px !important;
    min-width: 46px;
    padding: 0 8px;
  }

  body#category.page-category #left-column .PM_ASCriterionsGroupTitle {
    font-size: 10px !important;
    letter-spacing: .08em !important;
  }
}

/* ==================  12. ITÉRATION 6 — finitions filtres  =============== */
/* Icône en « tofu » (glyphe absent de la police) sur le titre du module
   Advanced Search : on la supprime. */
body#category.page-category #left-column .PM_ASBlockTitle::after {
  content: none !important;
}

/* Palier tablette : on récupère de la largeur utile pour les pastilles */
@media (min-width: 768px) and (max-width: 991px) {
  body#category.page-category #left-column .card,
  body#category.page-category #left-column .card-block {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body#category.page-category #left-column .card-header,
  body#category.page-category #left-column .PM_ASCriterionsGroup,
  body#category.page-category #left-column .PM_ASCriterionsGroupOuter {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body#category.page-category #left-column .PM_ASCriterionGroupCheckbox {
    padding: 0 !important;
  }

  body#category.page-category #left-column .PM_ASCriterionsGroupAttribute .PM_ASLabelLink {
    min-width: 44px;
    padding: 0 7px;
  }
}

/* ==================  13. ITÉRATION 7 — largeur utile du rail  =========== */
@media (min-width: 768px) and (max-width: 991px) {
  body#category.page-category #left-column #PM_ASBlockOutput_1,
  body#category.page-category #left-column #PM_ASBlock_1,
  body#category.page-category #left-column .PM_ASCriterionsGroupOuter {
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* Grille de tailles à 2 colonnes dans le rail tablette */
@media (min-width: 768px) and (max-width: 991px) {
  body#category.page-category #left-column .PM_ASCriterionsGroupAttribute .PM_ASCriterionGroupCheckbox li {
    flex: 0 0 calc(50% - 4px);
  }

  body#category.page-category #left-column .PM_ASCriterionsGroupAttribute .PM_ASLabelCheckbox,
  body#category.page-category #left-column .PM_ASCriterionsGroupAttribute .PM_ASLabelLink {
    min-width: 0;
    width: 100%;
  }
}

/* ==================  14. ITÉRATION 8 — demandes Mike  ==================== */
/* 1) le surtitre « Collections officielles » a été retiré du gabarit :
      on garde la règle inerte, aucun impact.
   2) le texte de catégorie descend en bas de page, en version discrète. */
body#category.page-category .rms-cat-intro--bottom {
  background: none !important;
  border: 0 !important;
  border-top: 1px solid var(--d-line) !important;
  border-radius: 0 !important;
  color: var(--d-ink-2);
  font-size: 14.5px;
  line-height: 1.7;
  margin: 46px 0 0 !important;
  max-width: 74ch;
  padding: 26px 0 0 !important;
}

/* le bandeau gagne un peu de place depuis la suppression du surtitre */
body#category.page-category .rally-category-header__inner {
  padding: 26px 34px 24px !important;
}

@media (max-width: 767px) {
  body#category.page-category .rally-category-header__inner {
    padding: 20px 18px 18px !important;
  }

  body#category.page-category .rms-cat-intro--bottom {
    font-size: 13.5px;
    margin-top: 34px !important;
    padding-top: 20px !important;
  }
}

/* ==================  15. ITÉRATION 9 — perfection des vignettes  ========= */
/* Le cadre reprend le ratio natif des photos produits (236 x 305) : plus de
   bandes blanches latérales. Le retrait est proportionnel (5 % de la largeur)
   pour que le vêtement respire, car les visuels sources sont cadrés au plus
   juste et touchent leurs bords. */
body#category.page-category #js-product-list .product-miniature .product-thumbnail {
  aspect-ratio: 236 / 305 !important;
}

body#category.page-category #js-product-list .product-miniature .product-thumbnail img {
  padding: 5% !important;
}

/* badge un peu plus sobre sur mobile */
@media (max-width: 767px) {
  body#category.page-category #js-product-list .product-miniature .product-flag {
    font-size: 9px !important;
    letter-spacing: .08em !important;
    padding: 5px 9px !important;
  }

  body#category.page-category #js-product-list .product-miniature .product-description {
    padding: 12px 13px 14px !important;
  }
}

/* Le conteneur doit avoir le même ratio que la vignette, sinon il la rognait
   de 13 px (overflow hidden) et faussait la hauteur de carte. */
body#category.page-category #js-product-list .product-miniature .thumbnail-container {
  aspect-ratio: 236 / 305 !important;
  height: auto !important;
}

/* ==================  16. ITÉRATION 10 — uniformité des fonds  ============ */
/* ~12 % des visuels produits ont un fond gris clair (studio) au lieu du blanc :
   dans une carte blanche, cela dessine un rectangle visible. Un très léger
   gain (7 %) ramène ces fonds à blanc sans toucher aux vêtements sombres
   (vérifié : noir 30 -> 32, imperceptible ; blanc saturé inchangé). */
body#category.page-category #js-product-list .product-miniature .product-thumbnail img {
  filter: brightness(1.07) saturate(1.02);
}

/* ==================  17. ITÉRATION 11 — barre tri NON collante  ========== */
/* À la demande de Mike : la barre tri/affichage ne doit plus se fixer en
   haut de l'écran au défilement. Le script category-toolbar-sticky.js est
   retiré de category.tpl ; ces règles servent de garde-fou (styles en ligne
   posés par l'ancien script, ou HTML encore en cache). */
body#category.page-category #js-product-list-top,
body#category.page-category #js-product-list-top.rms-toolbar-fixed {
  box-shadow: none !important;
  left: auto !important;
  margin: 0 0 18px !important;
  position: static !important;
  top: auto !important;
  width: auto !important;
  z-index: auto !important;
}

body#category.page-category .rms-toolbar-spacer {
  display: none !important;
  height: 0 !important;
}
