/* =============================================================================
   W3CAM - page categorie v2 : CATALOGUE (barre, puces, panneau de filtres, vignettes)
   [2026-11-09] Reprend a l'identique la maquette validee (classes w-* -> w3c-*,
   variables --w3-*). Tout est cadre par .w3c-cat-bar / .w3c-cat-panel /
   .w3c-cat-list : aucune regle ne touche le site tant que le drapeau Smarty
   $w3cCatV2 est faux (ces classes ne sont alors pas dans le HTML).

   Gabarits : catalog/_partials/products-top.tpl, products.tpl, sort-orders.tpl,
              catalog/_partials/miniatures/w3c-card.tpl
   Script   : assets/js/w3c-categorie.js
   Orange   : #ff6501 seul (survol #df5700) ; teintes claires #fff4ec / #ffd9c0.
   ============================================================================= */

.w3c-cat-bar,
.w3c-cat-panel,
.w3c-cat-list {
  --w3-orange: #ff6501;
  --w3-orange-hover: #df5700;
  --w3-orange-soft: #fff4ec;
  --w3-orange-line: #ffd9c0;
  --w3-grey: #666666;
  --w3-title: #4d4d4d;
  --w3-note: #767676;
  --w3-soft: #f5f5f5;
  --w3-radius: 6px;
  --w3-ease: cubic-bezier(.23, 1, .32, 1);
}

.w3c-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.w3c-cat-bar a, .w3c-cat-bar button, .w3c-cat-bar label, .w3c-cat-bar select, .w3c-cat-bar input,
.w3c-cat-panel a, .w3c-cat-panel button, .w3c-cat-panel label, .w3c-cat-panel select, .w3c-cat-panel input,
.w3c-cat-list a, .w3c-cat-list button, .w3c-cat-list label, .w3c-cat-list select, .w3c-cat-list input {
  -webkit-tap-highlight-color: transparent;
}
.w3c-cat-bar :focus-visible, .w3c-cat-panel :focus-visible, .w3c-cat-list :focus-visible {
  outline: 2px solid var(--w3-orange); outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   1. BARRE : « Filtres », puces, bascules, nombre, tri, grille / liste
   --------------------------------------------------------------------------- */
.w3c-cat-bar { display: block; margin: 0; padding: 0; }
.w3c-bar {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 0; border-top: 1px solid #ececec;
}

.w3c-bar__row--filters { display: flex; flex-wrap: wrap; gap: 8px; }
.w3c-bar__row--filters:empty { display: none; }
.w3c-bar__row--tools {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 16px;
}
.w3c-bar__quick { display: flex; flex-wrap: wrap; gap: 8px; }
.w3c-bar__quick:empty { display: none; }
.w3c-bar__tools { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.w3c-bar__active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.w3c-bar__active:empty { display: none; }

/* Bloc AS4 encore dans la colonne de gauche : masque des que le JS est actif (il est deplace dans le panneau
   juste apres ; sans JS il reste visible). Couvre aussi le 2e moteur des categories a deux blocs (333, 634). */
html.w3c-cat-js .w3c-cat-grid #left-column .PM_ASBlockOutput,
.PM_ASBlockOutput.w3c-block-off { display: none !important; }

/* Hauteur reservee (pas de CLS) : par defaut des que le JS est actif (html.w3c-cat-js, pose par le
   script en tete du gabarit) ; w3c-categorie.js ajoute html.w3c-no-as4 s'il n'y a pas de bloc de
   filtres (categories 26, 453...). Bascules : html.w3c-has-quick (colonne de gauche deja parsee). */
html.w3c-cat-js:not(.w3c-no-as4) .w3c-bar__row--filters:empty { display: flex; min-height: 44px; }
html.w3c-has-quick .w3c-bar__quick:empty { display: flex; min-height: 44px; }

.w3c-bar__count { font-size: 13px; color: var(--w3-grey); }
.w3c-bar__count strong { color: var(--w3-title); }

/* Bouton « Filtres » et puces */
.w3c-fbtn, .w3c-chip {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px;
  border: 1px solid #e6e6e6 !important; border-radius: var(--w3-radius) !important; background: #fff !important; color: var(--w3-grey) !important;
  font: inherit; font-size: 13px; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease, transform .16s var(--w3-ease);
}
.w3c-fbtn { gap: 8px; padding: 0 16px; border-color: var(--w3-orange) !important; color: var(--w3-orange) !important; font-weight: 600; }
.w3c-fbtn[aria-expanded="true"] { background: var(--w3-orange-soft) !important; }
.w3c-chip[aria-expanded="true"], .w3c-chip.is-on { border-color: var(--w3-orange) !important; color: var(--w3-orange) !important; }
.w3c-fbtn:active, .w3c-chip:active, .w3c-vsw__btn:active, .w3c-act:active { transform: scale(.97); }
.w3c-chip svg { flex: none; transition: transform .2s var(--w3-ease); }
.w3c-chip[aria-expanded="true"] svg { transform: rotate(180deg); }

.w3c-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box;
  border-radius: 10px; background: var(--w3-orange); color: #fff; font-size: 11px; font-weight: 600;
}
.w3c-fbtn .w3c-badge { min-width: 22px; background: var(--w3-orange-soft); color: var(--w3-orange); }
.w3c-fbtn .w3c-badge.is-active { background: var(--w3-orange); color: #fff; }

/* Le site met un fond creme au survol de tout <button> (!important) : on garde le fond de la maquette */
.w3c-chip:hover, .w3c-chip:focus { background: #fff !important; }

/* Bascules Nouveautes / En stock */
.w3c-toggle {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  border: 1px solid #e6e6e6; border-radius: var(--w3-radius); background: #fff; color: var(--w3-grey);
  font-size: 13px; line-height: 1; cursor: pointer; margin: 0;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.w3c-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--w3-orange); }
.w3c-toggle.is-on { border-color: var(--w3-orange); background: var(--w3-orange-soft); color: var(--w3-orange); font-weight: 600; }
.w3c-toggle:focus-within { outline: 2px solid var(--w3-orange); outline-offset: 2px; }
.w3c-toggle svg { flex: none; }

@media (hover: hover) and (pointer: fine) {
  .w3c-chip:hover, .w3c-toggle:hover { border-color: var(--w3-orange) !important; color: var(--w3-orange) !important; }
  .w3c-fbtn:hover { background: var(--w3-orange-soft) !important; }
  .w3c-act:hover { background: var(--w3-orange-soft) !important; box-shadow: inset 0 0 0 1px var(--w3-orange-line); }
  .w3c-act-clear:hover, .w3c-panel__close:hover { color: var(--w3-orange) !important; }
}

/* Infobulles des puces (reprend .w-tip de la maquette) */
.w3c-tip[data-tip]::after {
  content: attr(data-tip); display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
  width: max-content; max-width: min(280px, calc(100vw - 32px)); padding: 8px 10px; border-radius: 4px;
  background: #fff; color: var(--w3-grey); font-size: 12.5px; font-weight: 500; line-height: 1.4; text-align: left;
  white-space: normal; text-transform: none; letter-spacing: 0; box-shadow: rgba(0, 0, 0, .35) -2px 4px 15px -5px;
  pointer-events: none;
}
.w3c-tip[data-tip=""]::after { display: none !important; }
@keyframes w3c-tip-in { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
@media (hover: hover) and (pointer: fine) {
  .w3c-tip[data-tip]:hover::after { display: block; animation: w3c-tip-in .12s ease .3s both; }
}
.w3c-tip[data-tip]:focus-visible::after { display: block; }

/* Tri */
.w3c-sort { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; margin: 0; font-size: 13px; color: var(--w3-grey); }
.w3c-sort__lbl { margin: 0; font-weight: 400; }
.w3c-sort__sel {
  max-width: 100%; min-width: 0; height: 44px; margin: 0; padding: 0 36px 0 14px;
  border: 1px solid #e6e6e6; border-radius: var(--w3-radius); font: inherit; font-size: 13px; color: var(--w3-title);
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px;
}
.w3c-sort__sel:hover { border-color: var(--w3-orange-line); }

/* Grille / liste */
.w3c-vsw { display: inline-flex; gap: 4px; padding: 4px; background: var(--w3-soft); border-radius: var(--w3-radius); }
html:not(.w3c-cat-js) .w3c-vsw { display: none; }
.w3c-vsw__btn {
  display: grid; place-items: center; width: 40px; height: 36px; padding: 0; border: 0 !important; border-radius: 4px !important;
  background: transparent !important; color: var(--w3-grey) !important; cursor: pointer; transition: transform .16s var(--w3-ease);
}
html[data-w3c-view="grid"] .w3c-vsw__btn[data-w3c-view="grid"],
html[data-w3c-view="list"] .w3c-vsw__btn[data-w3c-view="list"] { background: #fff !important; color: var(--w3-orange) !important; }

/* Filtres actifs */
.w3c-act {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 0 !important; border-radius: var(--w3-radius) !important;
  background: var(--w3-orange-soft) !important; color: var(--w3-orange) !important; font: inherit; font-size: 13px; font-weight: 500; line-height: 1;
  cursor: pointer; transition: background-color .2s ease, transform .16s var(--w3-ease);
}
.w3c-act-clear {
  height: 36px; padding: 0 8px; border: 0 !important; background: transparent !important; color: var(--w3-grey) !important;
  font: inherit; font-size: 13px; text-decoration: underline !important; cursor: pointer;
}

/* Telephone : puces sur une seule ligne defilante (hauteur constante), tri pleine largeur */
@media (max-width: 767px) {
  .w3c-bar__row--filters {
    flex-wrap: nowrap; overflow-x: auto; margin: -3px -3px 0; padding: 3px; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .w3c-bar__row--filters::-webkit-scrollbar { display: none; }
  .w3c-bar__tools { flex: 1 1 100%; min-width: 0; }
  .w3c-sort { flex: 1 1 100%; min-width: 0; }
  .w3c-sort__sel { width: 100%; font-size: 16px; }
  .w3c-tip[data-tip]::after { display: none !important; }
}

/* ---------------------------------------------------------------------------
   2. PANNEAU DES FILTRES : le bloc du module AS4 y est DEPLACE (pas clone) et
      habille comme la maquette. Le module garde la main (delegation d'evenements
      sur .PM_ASBlockOutput, remplacement du bloc apres chaque recherche).
   --------------------------------------------------------------------------- */
.w3c-cat-panel {
  display: block; margin: 0 0 16px; padding: 24px; background: #fff; border: 1px solid #ececec; border-radius: var(--w3-radius);
}
.w3c-cat-panel[hidden] { display: none; }
.w3c-panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 16px; }
.w3c-panel__title { margin: 0; color: var(--w3-title); font-size: 14px; font-weight: 600; }
.w3c-panel__close {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0 !important; border-radius: 4px !important;
  background: transparent !important; color: var(--w3-grey) !important; font: inherit; font-size: 22px; line-height: 1; cursor: pointer;
}
.w3c-panel__foot { display: none; margin: 20px 0 0; }
.w3c-panel__done {
  width: 100%; height: 44px; border: 0 !important; border-radius: var(--w3-radius) !important; background: var(--w3-orange) !important; color: #fff !important;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .w3c-panel__done:hover { background: var(--w3-orange-hover) !important; } }

.w3c-cat-panel .PM_ASBlockOutput {
  display: block !important; position: static; margin: 0; padding: 0; border: 0; background: none; box-shadow: none;
}
.w3c-cat-panel .PM_ASBlockOutput .card { display: block; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.w3c-cat-panel .PM_ASBlockOutput .card-header { display: none !important; }
.w3c-cat-panel .PM_ASBlockOutput .card-body,
.w3c-cat-panel .PM_ASBlockOutput .card-block { display: block !important; padding: 0; }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASShowCriterionsGroupHidden { display: none !important; }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionsGroupHidden { display: block !important; }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionsGroup.w3c-g--empty,
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionsGroup.w3c-g--off,
.w3c-cat-panel .w3c-fam[hidden] { display: none !important; }

.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionsGroupList { display: flex; flex-direction: column; gap: 28px; margin: 0; padding: 0; }
.w3c-cat-panel .w3c-fam { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.w3c-cat-panel .w3c-fam__t {
  margin: 0; padding: 0 0 10px; border-bottom: 1px solid #f2f2f2; color: var(--w3-orange); font-size: 14px; font-weight: 600; line-height: 1.4;
}
.w3c-cat-panel .w3c-fam__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 20px 32px; }
/* Liste simple (6 groupes ou moins) : pas d'intitule de famille, une seule grille */
.w3c-cat-panel[data-simple] .w3c-fam__t { display: none; }
.w3c-cat-panel[data-simple] .PM_ASBlockOutput .PM_ASCriterionsGroupList { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 20px 32px; }
.w3c-cat-panel[data-simple] .w3c-fam, .w3c-cat-panel[data-simple] .w3c-fam__grid { display: contents; }
/* Un seul groupe (clic sur une puce) */
.w3c-cat-panel[data-mode="solo"] .PM_ASBlockOutput .PM_ASCriterionsGroupList { display: block; }
.w3c-cat-panel[data-mode="solo"] .w3c-fam__t { display: none; }
.w3c-cat-panel[data-mode="solo"] .w3c-fam__grid { display: block; }

.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionsGroup { margin: 0; padding: 0; border: 0; min-width: 0; }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionsGroupTitle {
  margin: 0 0 10px; padding: 0; border: 0; color: var(--w3-title); font-size: 13px; font-weight: 600; line-height: 1.4; text-transform: none;
}
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionsGroupName { color: inherit; font-weight: inherit; }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionsGroupOuter { max-height: none; overflow: visible; padding: 0; }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionStepEnable { margin: 0; padding: 0; }

/* Options a cocher : pastilles */
.w3c-cat-panel .PM_ASBlockOutput ul.PM_ASCriterionGroupCheckbox { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.w3c-cat-panel .PM_ASBlockOutput ul.PM_ASCriterionGroupCheckbox li { margin: 0; padding: 0; list-style: none; }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionGroupCheckbox .checkbox { position: relative; margin: 0; padding: 0; min-height: 0; }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionCheckbox {
  position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none;
}
.w3c-cat-panel .PM_ASBlockOutput .PM_ASLabelLink {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; box-sizing: border-box;
  border: 1px solid #e6e6e6; border-radius: var(--w3-radius); background: #fff; color: var(--w3-grey) !important;
  font-size: 13px; font-weight: 400; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease, transform .16s var(--w3-ease);
}
.w3c-cat-panel .PM_ASBlockOutput .PM_ASLabelLink .PM_ASCriterionNbProduct { color: var(--w3-note); font-size: 11px; }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASLabelLink:active { transform: scale(.97); }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASLabelLink.PM_ASLabelCheckboxSelected {
  border-color: var(--w3-orange); background: var(--w3-orange-soft); color: var(--w3-orange) !important; font-weight: 600;
}
.w3c-cat-panel .PM_ASBlockOutput .checkbox:has(input:checked) .PM_ASLabelLink {
  border-color: var(--w3-orange); background: var(--w3-orange-soft); color: var(--w3-orange) !important; font-weight: 600;
}
.w3c-cat-panel .PM_ASBlockOutput .checkbox:focus-within .PM_ASLabelLink { outline: 2px solid var(--w3-orange); outline-offset: 2px; }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionDisable .PM_ASLabelLink,
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionDisable .PM_ASCriterionLink { opacity: .5; }
@media (hover: hover) and (pointer: fine) {
  .w3c-cat-panel .PM_ASBlockOutput .PM_ASLabelLink:hover,
  .w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionGroupImage .PM_ASCriterionLink:hover { border-color: var(--w3-orange); color: var(--w3-orange) !important; }
}

/* Options en images (marques, couleurs) */
.w3c-cat-panel .PM_ASBlockOutput ul.PM_ASCriterionGroupImage { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; clear: none; }
.w3c-cat-panel .PM_ASBlockOutput ul.PM_ASCriterionGroupImage li { display: block; margin: 0; padding: 0; }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionGroupImage .PM_ASCriterionLink {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; box-sizing: border-box;
  margin: 0 !important; padding: 5px 10px; border: 1px solid #e6e6e6; border-radius: var(--w3-radius); background: #fff; color: var(--w3-grey) !important;
  font-size: 13px; text-decoration: none; transition: border-color .2s ease, background-color .2s ease, transform .16s var(--w3-ease);
}
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionGroupImage .PM_ASCriterionLink img {
  /* [2026-11-09] logos agrandis : images carrees 300x300 a logo centre, on rogne le vide haut/bas (60x40 garde les logos empiles entiers, ex. Ubiquiti) */
  display: block; width: 60px !important; height: 40px !important; max-width: none; object-fit: cover;
}
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionGroupImage .PM_ASCriterionLinkSelected {
  margin: 0 !important; border: 1px solid var(--w3-orange) !important; background: var(--w3-orange-soft); box-shadow: inset 0 0 0 1px var(--w3-orange);
}
.w3c-cat-panel .w3c-g--color .PM_ASCriterionGroupImage .PM_ASCriterionLink { padding: 6px; }
.w3c-cat-panel .w3c-g--color .PM_ASCriterionGroupImage .PM_ASCriterionLink img { width: 24px !important; height: 24px !important; border-radius: 50%; object-fit: cover; }

/* Listes deroulantes (selectize ou select natif) */
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCriterionGroupSelect,
.w3c-cat-panel .PM_ASBlockOutput .selectize-input {
  min-height: 40px; box-sizing: border-box; border: 1px solid #e6e6e6; border-radius: var(--w3-radius); background-color: #fff; box-shadow: none;
  font: inherit; font-size: 13px; color: var(--w3-title);
}
.w3c-cat-panel .PM_ASBlockOutput .selectize-control { max-width: 100%; }
.w3c-cat-panel .PM_ASBlockOutput .selectize-input.focus { border-color: var(--w3-orange); }
.w3c-cat-panel .PM_ASBlockOutput .selectize-input .item { background: var(--w3-orange-soft); border: 0; border-radius: 4px; color: var(--w3-orange); }

/* Curseurs (prix, resolution...) : le style des poignees vient du theme */
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCritRange { max-width: calc(100% - 18px); margin: 14px 9px 6px; }
.w3c-cat-panel .PM_ASBlockOutput .PM_ASCritRangeValue { display: block; margin: 16px 0 0; color: var(--w3-title); font-size: 13px; font-weight: 500; text-align: left; }

/* « Effacer les filtres » du module (affiche / masque par le module lui-meme) */
.w3c-cat-panel .PM_ASBlockOutput .PM_ASResetSearch {
  margin: 0 0 16px; padding: 0; border: 0 !important; box-shadow: none !important; background: none;
  color: var(--w3-grey) !important; font-size: 13px; text-align: left; text-decoration: underline;
}
.w3c-cat-panel .PM_ASBlockOutput .PM_ASResetSearch::before { display: none; }

@media (max-width: 767px) {
  .w3c-cat-panel { padding: 16px; }
  .w3c-panel__foot { display: block; }
}

/* ---------------------------------------------------------------------------
   3. VIGNETTE UNIQUE : grille (ordinateur) / liste (telephone), html[data-w3c-view]
   --------------------------------------------------------------------------- */
.w3c-cat-list { display: block; }
.w3c-cat-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
html[data-w3c-view="list"] .w3c-cat-products { display: flex; flex-direction: column; gap: 12px; }

.w3c-card {
  --w3-gap: 8px;
  position: relative; box-sizing: border-box; min-width: 0; background: #fff; border: 1px solid #ececec; border-radius: var(--w3-radius);
  color: var(--w3-grey); transition: border-color .2s ease;
}
@media (hover: hover) and (pointer: fine) { .w3c-card:hover { border-color: var(--w3-orange-line); } }
.w3c-card .w3c-cover { color: inherit; text-decoration: none; }
.w3c-card .w3c-cover::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--w3-radius); }
@supports selector(:has(*)) {
  .w3c-card:has(.w3c-cover:focus-visible) { outline: 2px solid var(--w3-orange); outline-offset: 2px; }
  .w3c-card .w3c-cover:focus-visible { outline: none; }
}
/* Tout ce qui est cliquable par-dessus le lien-couverture */
.w3c-card a.w3c-tag, .w3c-card .w3c-couleurs, .w3c-card .w3c-couleur-option, .w3c-card .w3c-card__cta,
.w3c-card .w3c-card__quick, .w3c-card .product-btn-block { position: relative; z-index: 2; }

/* ---- Vue GRILLE (par defaut) : la carte est une grille, les blocs sont aplatis (display: contents) ---- */
.w3c-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; column-gap: 6px; row-gap: 0;
  grid-template-rows: auto auto auto auto auto auto 1fr auto auto auto auto auto;
  padding: 14px 20px 20px;
}
.w3c-card__media, .w3c-card__info, .w3c-card__buy, .w3c-card__id, .w3c-card picture { display: contents; }

.w3c-card__disc {
  flex: none;
  padding: 3px 8px; border-radius: 4px; background: var(--w3-orange-soft); color: var(--w3-orange);
  font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.w3c-card__tags { grid-column: 1; grid-row: 1; align-self: center; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; min-height: 26px; align-items: center; }
.w3c-card__new {
  grid-column: 2; grid-row: 1; justify-self: end; align-self: start;
  padding: 4px 10px; border-radius: var(--w3-radius); background: var(--w3-orange); color: #fff;
  font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.w3c-card__img {
  grid-column: 1 / -1; grid-row: 2; justify-self: center; display: block;
  width: 100%; max-width: 220px; height: 180px; margin: 4px 0 8px; object-fit: contain;
}
.w3c-card__brand { grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 20px; }
.w3c-card__brand img { display: block; width: 66px; height: 20px; object-fit: cover; opacity: .85; }
.w3c-card__brand-txt { color: var(--w3-title); font-size: 11px; font-weight: 600; letter-spacing: .08em; line-height: 20px; }
.w3c-card__title {
  grid-column: 1 / -1; grid-row: 4; margin: var(--w3-gap) 0 0;
  color: var(--w3-title); font-size: 15px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere;
}
.w3c-card__ref { grid-column: 1 / -1; grid-row: 5; margin: var(--w3-gap) 0 0; font-size: 12px; line-height: 1.4; color: var(--w3-grey); }
.w3c-card .w3c-couleurs { grid-column: 1 / -1; grid-row: 6; justify-self: start; }
.w3c-card__desc { display: none; }
.w3c-card__variants { grid-column: 1 / -1; grid-row: 7; margin-top: var(--w3-gap); }
.w3c-card__variants:empty { display: none; }
.w3c-card__rating { grid-column: 1 / -1; grid-row: 8; margin-top: var(--w3-gap); }
.w3c-card__price { grid-column: 1 / -1; grid-row: 9; margin-top: var(--w3-gap); padding-top: 0; }
.w3c-card__stock { grid-column: 1 / -1; grid-row: 10; margin-top: var(--w3-gap); }
.w3c-card__cta { grid-column: 1 / -1; grid-row: 11; margin-top: var(--w3-gap); }
.w3c-card__quick { grid-column: 1 / -1; grid-row: 12; justify-self: center; margin-top: 6px; }

/* ---- Vue LISTE ---- */
html[data-w3c-view="list"] .w3c-card {
  --w3-gap: 0px;
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px 32px; padding: 20px 24px;
}
html[data-w3c-view="list"] .w3c-card__media {
  position: relative; display: grid; place-items: center; flex: 0 0 180px;
}
html[data-w3c-view="list"] .w3c-card picture { display: inline; }
html[data-w3c-view="list"] .w3c-card__img { grid-column: auto; grid-row: auto; width: 160px; max-width: 100%; height: 160px; margin: 0; }
/* le badge de remise vit dans .w3c-card__tags : en liste on l'ancre au coin haut gauche de la carte (= coin de la colonne image) */
html[data-w3c-view="list"] .w3c-card__disc { position: absolute; top: 20px; left: 24px; z-index: 1; }
html[data-w3c-view="list"] .w3c-card__new { position: absolute; top: 0; right: 0; z-index: 1; }
html[data-w3c-view="list"] .w3c-card__info {
  display: flex; flex-direction: column; justify-content: center; gap: 8px; flex: 999 1 320px; min-width: 0;
}
html[data-w3c-view="list"] .w3c-card__id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
html[data-w3c-view="list"] .w3c-card__tags { min-height: 0; }
html[data-w3c-view="list"] .w3c-card__title { font-size: 16px; }
html[data-w3c-view="list"] .w3c-card .w3c-couleurs { justify-self: auto; }
html[data-w3c-view="list"] .w3c-card__desc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  margin: 0; font-size: 13px; line-height: 1.6; color: var(--w3-grey);
}
html[data-w3c-view="list"] .w3c-card__buy {
  display: flex; flex-direction: column; justify-content: center; gap: 8px; flex: 1 1 200px; min-width: 0;
  padding-left: 24px; border-left: 1px solid #f2f2f2;
}
html[data-w3c-view="list"] .w3c-card__rating,
html[data-w3c-view="list"] .w3c-card__price,
html[data-w3c-view="list"] .w3c-card__stock,
html[data-w3c-view="list"] .w3c-card__cta { margin-top: 0; }
html[data-w3c-view="list"] .w3c-card__quick { justify-self: auto; margin-top: 0; }
html[data-w3c-view="list"] .w3c-card__price .price { font-size: 24px; }

/* Telephone en liste : reprend les reglages mobiles de la maquette */
@media (max-width: 767px) {
  html[data-w3c-view="list"] .w3c-card { padding: 14px; gap: 10px 14px; }
  html[data-w3c-view="list"] .w3c-card__media { flex: 0 0 96px; align-self: start; place-items: start; gap: 6px; }
  html[data-w3c-view="list"] .w3c-card__img { width: 96px; height: 96px; }
  html[data-w3c-view="list"] .w3c-card__disc { top: 14px; left: 14px; }
  html[data-w3c-view="list"] .w3c-card__info { flex: 1 1 150px; gap: 4px; }
  html[data-w3c-view="list"] .w3c-card__title { font-size: 14px; }
  html[data-w3c-view="list"] .w3c-card__desc { display: none; }
  html[data-w3c-view="list"] .w3c-card__buy { flex: 1 1 100%; padding: 10px 0 0; border-left: 0; border-top: 1px solid #f2f2f2; }
}

/* ---- Pieces de la vignette ---- */
.w3c-tag {
  position: relative; display: inline-block; padding: 3px 8px; border-radius: 4px; background: var(--w3-soft); color: var(--w3-title);
  font-size: 12px; font-weight: 500; line-height: 1.3; white-space: nowrap; text-decoration: none;
}
a.w3c-tag { color: var(--w3-title); }
@media (hover: hover) and (pointer: fine) { a.w3c-tag:hover { color: var(--w3-orange); } }

/* Etoiles SVG (seulement si le produit a une note) */
.w3c-card__rating { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--w3-grey); }
.w3c-stars { position: relative; display: inline-block; flex: none; width: 82px; height: 14px; }
.w3c-stars svg { display: block; }
.w3c-stars__on { position: absolute; left: 0; top: 0; height: 14px; overflow: hidden; }

/* Prix (gabarit product-miniature-price.tpl conserve) */
.w3c-card__price .product-price-and-shipping { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; }
.w3c-card__price .skeepers_product__stars { display: none !important; }
.w3c-card__price .price {
  display: inline-flex; align-items: baseline; gap: 6px; margin: 0; padding: 0;
  color: var(--w3-title); font-size: 22px; font-weight: 600; line-height: 1.2; background: none;
}
.w3c-card__price .w3c-mini-taxe { color: var(--w3-grey); font-size: 12px; font-weight: 400; }
.w3c-card__price .regular-price { color: var(--w3-grey); font-size: 13px; font-weight: 400; text-decoration: line-through; }
.w3c-card__price .product-btn-block { margin: 0; }
.w3c-cat-list .w3c-card__price .product-btn-block .btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; box-sizing: border-box;
  border: 1px solid #e6e6e6 !important; border-radius: var(--w3-radius) !important; background: #fff !important; color: var(--w3-title) !important;
  font-size: 13px; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none !important; box-shadow: none; position: relative; z-index: 2;
}
@media (hover: hover) and (pointer: fine) { .w3c-cat-list .w3c-card__price .product-btn-block .btn:hover { border-color: var(--w3-orange) !important; color: var(--w3-orange) !important; background: #fff !important; } }

/* Stock : texte du module conserve, couleur par niveau (>= 10 vert, 3 a 9 orange-brun, 1 a 2 rouge, 0 / sur commande gris).
   Repli sur les classes du module (.si-lvl-N) ; le gabarit pose data-w3c-stock quand il a lu un chiffre. */
.w3c-stock { --w3-stk: #167c44; }
.w3c-stock:has(.si-lvl-2) { --w3-stk: #b45309; }
.w3c-stock:has(.si-lvl-1) { --w3-stk: #c62828; }
.w3c-stock:has(.si-lvl--1), .w3c-stock:has(.si-lvl-0) { --w3-stk: #5c6773; }
.w3c-stock[data-w3c-stock="ok"] { --w3-stk: #167c44; }
.w3c-stock[data-w3c-stock="bas"] { --w3-stk: #b45309; }
.w3c-stock[data-w3c-stock="critique"] { --w3-stk: #c62828; }
.w3c-stock[data-w3c-stock="rupture"] { --w3-stk: #5c6773; }
.w3c-stock .si-product-list, .w3c-stock .si-indicator { display: block; margin: 0; padding: 0; background: none; border: 0; }
.w3c-stock .si-tooltip-wrap, .w3c-stock .si-outer { display: none; }
.w3c-stock .si-items {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0; background: none; border-radius: 0;
  color: var(--w3-stk); font-size: 12px; font-weight: 600; line-height: 1.3; text-align: left; text-transform: none; white-space: normal;
}
.w3c-stock[data-w3c-stock="ok"] .si-items { font-weight: 500; }
.w3c-stock .si-items::before { content: ""; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--w3-stk); }

/* Choix de couleur Noir / Blanc : pastilles compactes (habille .w3c-couleurs du module w3ccouleurs) */
.w3c-card .w3c-couleurs {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; width: max-content; max-width: 100%;
  margin: 6px 0 2px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  color: var(--w3-title); font-size: 13px; line-height: 1;
}
.w3c-card .w3c-couleurs-label, .w3c-card .w3c-couleur-nom {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.w3c-card .w3c-couleur-option {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; min-height: 0; padding: 0; box-sizing: border-box;
  border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: var(--w3-title); text-decoration: none !important;
}
.w3c-card .w3c-couleur-option.is-active { border: 0; background: transparent; box-shadow: none; color: var(--w3-title); }
.w3c-card .w3c-couleur-dot {
  display: block; width: 16px; height: 16px; flex: 0 0 16px; box-sizing: border-box;
  border: 1px solid #c8c8c8; border-radius: 50%; background: #fff; transition: box-shadow .2s ease;
}
.w3c-card .w3c-couleur-option--n .w3c-couleur-dot { border-color: #171717; background: #171717; }
.w3c-card .w3c-couleur-option.is-active .w3c-couleur-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--w3-orange); }
@media (hover: hover) and (pointer: fine) {
  .w3c-card a.w3c-couleur-option:hover .w3c-couleur-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--w3-orange-line); }
}

/* Ajouter au panier / choisir une option (gabarit product-miniature-btn.tpl conserve) */
.w3c-card__cta .product-add-to-cart, .w3c-card__cta form, .w3c-card__cta .product-quantity { margin: 0; padding: 0; }
.w3c-cat-list .w3c-card__cta .btn {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; margin: 0; padding: 0 16px; box-sizing: border-box;
  border: 0 !important; border-radius: var(--w3-radius) !important; background: var(--w3-orange) !important; color: #fff !important; box-shadow: none;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1; text-align: center; text-decoration: none !important; text-transform: none; cursor: pointer;
  transition: background-color .2s ease, transform .16s var(--w3-ease);
}
.w3c-cat-list .w3c-card__cta .btn:active { transform: scale(.97); }
.w3c-cat-list .w3c-card__cta .btn:focus { box-shadow: none; }
.w3c-cat-list .w3c-card__cta .btn:focus-visible { outline: 2px solid var(--w3-orange); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .w3c-cat-list .w3c-card__cta .btn:hover, .w3c-cat-list .w3c-card__cta .btn:focus { background: var(--w3-orange-hover) !important; color: #fff !important; border: 0 !important; }
}
.w3c-cat-list .w3c-card__cta .btn.out-of-stock, .w3c-cat-list .w3c-card__cta .btn.disabled { background: #e6e6e6 !important; color: #5c6773 !important; cursor: not-allowed; }
.w3c-cat-list .w3c-card__cta .btn.out-of-stock:hover, .w3c-cat-list .w3c-card__cta .btn.disabled:hover { background: #e6e6e6 !important; color: #5c6773 !important; }

/* Apercu rapide : lien discret sous le bouton (le texte masque par le theme est reaffiche) */
.w3c-card__quick .quick-view-wrapper { position: static; display: block; margin: 0; opacity: 1; transform: none; }
.w3c-cat-list .w3c-card__quick .quick-view {
  display: inline-flex; align-items: center; width: auto; height: auto; min-height: 24px; margin: 0; padding: 0; border: 0 !important; border-radius: 0 !important;
  background: none !important; box-shadow: none; color: var(--w3-grey) !important; font: inherit; font-size: 12px; line-height: 1.4; text-decoration: underline !important; text-underline-offset: 2px;
}
.w3c-cat-list .w3c-card__quick .quick-view::before, .w3c-cat-list .w3c-card__quick .quick-view::after { display: none; }
.w3c-card__quick .lblquickview { display: inline; position: static; opacity: 1; visibility: visible; width: auto; height: auto; }
@media (hover: hover) and (pointer: fine) { .w3c-cat-list .w3c-card__quick .quick-view:hover, .w3c-cat-list .w3c-card__quick .quick-view:focus { background: none !important; color: var(--w3-orange) !important; } }

/* ---------------------------------------------------------------------------
   4. ETAT VIDE (aucun produit apres un filtre)
   --------------------------------------------------------------------------- */
.w3c-cat-empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 24px;
  background: var(--w3-soft); border-radius: var(--w3-radius); text-align: center;
}
.w3c-cat-empty__t { margin: 0; color: var(--w3-title); font-size: 18px; font-weight: 500; }
.w3c-cat-empty__p { margin: 0; max-width: 460px; font-size: 14px; color: var(--w3-grey); }
.w3c-cat-empty__btn {
  height: 44px; padding: 0 24px; border: 0 !important; border-radius: var(--w3-radius) !important; background: var(--w3-orange) !important; color: #fff !important;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background-color .2s ease;
}
html:not(.w3c-cat-js) .w3c-cat-empty__btn { display: none; }
@media (hover: hover) and (pointer: fine) { .w3c-cat-empty__btn:hover { background: var(--w3-orange-hover) !important; } }

@media (prefers-reduced-motion: reduce) {
  .w3c-fbtn, .w3c-chip, .w3c-toggle, .w3c-act, .w3c-vsw__btn, .w3c-card, .w3c-cat-list .w3c-card__cta .btn, .w3c-cat-empty__btn,
  .w3c-cat-panel .PM_ASLabelLink, .w3c-cat-panel .PM_ASCriterionLink, .w3c-chip svg, .w3c-card .w3c-couleur-dot { transition: none; }
  .w3c-tip[data-tip]:hover::after { animation: none; }
  .w3c-fbtn:active, .w3c-chip:active, .w3c-vsw__btn:active, .w3c-act:active, .w3c-cat-panel .PM_ASLabelLink:active, .w3c-cat-list .w3c-card__cta .btn:active { transform: none; }
}

/* [2026-11-09] Premier ecran stable : le bundle du theme (charge en differe sur les
   categories) donne 20px de marge a #product-list-top, que le CSS critique ne fournit
   que sous 768px. Meme valeur ici des le premier rendu : la barre ne saute plus. */
#products #product-list-top { margin: 20px 0; }
