/* ============================================================
   T2271 — colonne gauche (accueil + pages catégorie) : arbre, [filtres], En promo / Meilleures ventes / Marques ; tiroir mobile.
   FICHIER COMMUN aux 5 thèmes Herry. Chargé après sw-tokens.css (palette du site).
   Tout est préfixé .swhc / .swc / .swb → aucun effet ailleurs.
   Bascule à 768 px, comme la colonne et les filtres Hummingbird (en dessous : bouton « Filtrer » + #offcanvas-faceted).
   ⚠️ Hummingbird est en cascade layers : pas d'utilitaires d-none/d-md-block ici, les media queries suffisent.
   ⚠️ Le tiroir n'utilise PAS transform : #offcanvas-faceted (position fixed) est rendu dans la colonne et serait sinon
      positionné par rapport au tiroir au lieu de l'écran.
   ============================================================ */

/* ---------- Grille ---------- */
.swhc-home { padding-top: 1.25rem; }
.swhc-home > .row { --bs-gutter-x: 1.5rem; }
.swhc-center .container,
.swhc-home > .row > .center-column .container { max-width: 100%; padding-left: 0; padding-right: 0; }
/* Accueil rendu par un index.tpl sans classes de colonne sur #center-column : largeur posée ici */
.swhc-home > .row > .center-column { flex: 0 0 auto; width: 100%; }
@media (min-width: 768px) { .swhc-home > .row > .center-column, .swhc-home > .row > .swhc-center { width: 66.66667%; } }
@media (min-width: 992px) { .swhc-home > .row > .center-column, .swhc-home > .row > .swhc-center { width: 75%; } }

/* ---------- Arbre (mêmes règles que .swc de sw-header.css, T1687) ---------- */
.swc { margin-bottom: 1.25rem; border: 1px solid var(--sw-border); border-radius: var(--sw-radius); overflow: hidden; background: #fff; }
.swc-title { margin: 0; padding: 12px 14px; background: var(--sw-secondary); color: var(--sw-on-secondary); font-weight: 600; }
.swc-list { list-style: none; margin: 0; padding: 0; }
.swc-list .swc-list { border-left: 2px solid var(--sw-accent-soft); margin-left: 14px; }
.swc-row { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--sw-border); }
.swc-list .swc-list .swc-row { border-top: 0; }
.swc-link { flex: 1; padding: 10px 14px; color: var(--sw-secondary); font-weight: 600; text-decoration: none; line-height: 1.3; }
.swc-list .swc-list .swc-link { font-weight: 400; padding: 7px 12px; }
.swc-link:hover, .swc-link:focus-visible { color: var(--sw-accent); background: var(--sw-accent-soft); }
.swc-item.is-current > .swc-row > .swc-link { color: var(--sw-accent); box-shadow: inset 3px 0 0 var(--sw-accent-line); background: var(--sw-accent-soft); }
.swc-toggle { width: 44px; height: 44px; border: 0; background: transparent; position: relative; flex: 0 0 44px; }
.swc-toggle::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; margin: -6px 0 0 -4px;
  border-right: 2px solid var(--sw-accent-line); border-bottom: 2px solid var(--sw-accent-line); transform: rotate(45deg); transition: transform .2s;
}
.swc-toggle:not(.collapsed)::before { transform: rotate(-135deg); margin-top: -2px; }
.swc-toggle:focus-visible { outline: 2px solid var(--sw-accent-line); outline-offset: -2px; }

/* ---------- Filtres à facettes (page catégorie) ---------- */
.swhc-left .ps-facetedsearch--desktop, .swhc-left #search_filters_wrapper { margin-bottom: 1.25rem; }

/* ---------- Blocs produits et marques ---------- */
.swb { margin-bottom: 1.25rem; border: 1px solid var(--sw-border); border-radius: var(--sw-radius); overflow: hidden; background: #fff; }
.swb-list, .swb-brands { list-style: none; margin: 0; padding: 0; }
.swb-prod { display: flex; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--sw-border); align-items: center; }
.swb-img { flex: 0 0 64px; }
.swb-img img { width: 64px; height: 64px; object-fit: contain; display: block; }
.swb-name { display: block; color: var(--sw-secondary); font-size: .875rem; line-height: 1.3; text-decoration: none; }
.swb-name:hover, .swb-name:focus-visible { color: var(--sw-accent); }
.swb-price { font-size: .875rem; margin-top: 2px; }
.swb-price strong { color: var(--sw-accent); }
.swb-price s { color: #6b6b6b; margin-left: 4px; }
.swb-brands li { border-top: 1px solid var(--sw-border); }
.swb-brands a { display: block; padding: 8px 14px; color: var(--sw-secondary); text-decoration: none; }
.swb-brands a:hover, .swb-brands a:focus-visible { color: var(--sw-accent); background: var(--sw-accent-soft); }
.swb-more { display: block; padding: 10px 14px; border-top: 1px solid var(--sw-border); color: var(--sw-accent); font-weight: 600; text-decoration: none; }

/* ---------- Bouton et tiroir : < 768 px ---------- */
.swhc-open { display: none; }
.swhc-drawer-head { display: none; }
@media (max-width: 767.98px) {
  .swhc-open { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin-bottom: 1rem; padding: 0 16px;
    border: 0; border-radius: var(--sw-radius); background: var(--sw-secondary); color: var(--sw-on-secondary); font-weight: 600; }
  .swhc-burger, .swhc-burger::before, .swhc-burger::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
  .swhc-burger::before, .swhc-burger::after { content: ""; position: absolute; left: 0; }
  .swhc-burger::before { top: -6px; } .swhc-burger::after { top: 6px; }

  /* La colonne devient le tiroir : arbre seul (décision Cédric 16/11). Les filtres passent par le bouton « Filtrer » de Hummingbird. */
  .swhc-left { position: fixed; top: 0; bottom: 0; left: -105vw; z-index: 1060; width: min(88vw, 360px); max-width: none; padding: 0;
    background: #fff; overflow-y: auto; visibility: hidden; transition: left .25s, visibility .25s; }
  .swhc-left.is-open { left: 0; visibility: visible; }
  .swhc-left .swb, .swhc-left .swc-title, .swhc-left .ps-facetedsearch--desktop { display: none; }
  .swhc-left .swc { border: 0; border-radius: 0; margin: 0; }
  .swhc-drawer-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1;
    padding: 4px 4px 4px 16px; background: var(--sw-secondary); color: var(--sw-on-secondary); font-weight: 600; }
  .swhc-close { width: 44px; height: 44px; border: 0; background: transparent; color: inherit; font-size: 28px; line-height: 1; }
  .swhc-backdrop { position: fixed; inset: 0; z-index: 1055; background: rgba(0, 0, 0, .45); }
  .swhc-backdrop[hidden] { display: none; }
  body.swhc-locked { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .swc-toggle::before, .swhc-left { transition: none; } }
