/* ═══════════════════════════════════════════════════════════════
   Schubnel — Catalogue (boutique / archives catégorie & marque)
   Réutilise le design system du thème (theme.css) : .sbrand, .chip,
   .wc-card-img et les tokens --g700/--g50/--or/--r/--sh-* existent déjà.
   Ici on n'ajoute QUE le nécessaire, et on aliase les 5 tokens absents.
   ═══════════════════════════════════════════════════════════════ */

/* Tokens absents du thème, aliasés (pas de duplication de valeurs).
   .cathead (en-tête partagé) est désormais dans theme.css. */
.catalog {
  --surf: var(--blanc);
  --line: var(--ligne);
  --ink:  var(--noir);
  --g900: var(--noir);
}

.catalog { padding: 32px 0 72px; }
.cat-grid { display: grid; grid-template-columns: 284px 1fr; gap: 34px; align-items: start; }

/* ============ SIDEBAR FILTRES ============ */
.filters { background: var(--surf); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 20px 18px; position: sticky; top: 90px; }
.fh { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 4px; }
.fh h2 { font-size: 16px; font-weight: 800; }
.fclose { display: none; border: none; background: var(--g50); width: 34px; height: 34px; border-radius: 50%; color: var(--g700); }
.fclose svg { width: 18px; height: 18px; margin: auto; }
.clear-link { font-size: 12.5px; color: var(--muted); font-weight: 600; background: none; border: none; cursor: pointer; }
.clear-link:hover { color: var(--ink); }
.fgroup { border-top: 1px solid var(--line); padding: 16px 0; }
.fgroup h3 { font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--g700); margin-bottom: 12px; }
.fsearch { width: 100%; border: 1.5px solid var(--line); border-radius: 50px; padding: 9px 14px; font-family: var(--f); font-size: 13px; margin-bottom: 10px; outline: none; }
.fsearch:focus { border-color: var(--g700); }
.flist { display: flex; flex-direction: column; max-height: 236px; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.flist::-webkit-scrollbar { width: 7px; }
.flist::-webkit-scrollbar-thumb { background: #d8d8d8; border-radius: 50px; }
.fopt { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; cursor: pointer; color: var(--ink); }
.fopt:hover { color: var(--g900); }
.fopt input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border: 1.5px solid #c8c8c8; border-radius: 5px; flex: 0 0 auto; display: grid; place-content: center; cursor: pointer; transition: .12s; }
.fopt input:checked { background: var(--or); border-color: var(--or); }
.fopt input:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #1a1a1a; border-bottom: 2px solid #1a1a1a; transform: rotate(-45deg) translateY(-1px); }
.fopt .c { margin-left: auto; color: var(--muted); font-size: 12.5px; font-weight: 600; }

.ftoggle { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.ftoggle input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 50px; background: #d6d6d6; position: relative; cursor: pointer; transition: .18s; flex: 0 0 auto; }
.ftoggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .18s; }
.ftoggle input:checked { background: var(--or); }
.ftoggle input:checked::after { left: 21px; }

.price-in { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.price-in input { width: 100%; border: 1.5px solid var(--line); border-radius: var(--rs); padding: 9px 10px; font-family: var(--f); font-size: 13.5px; outline: none; }
.price-in input:focus { border-color: var(--g700); }
.price-in span { color: var(--muted); }
.price-apply { margin-top: 4px; border: 1.5px solid var(--line); background: var(--surf); border-radius: 50px; padding: 8px 18px; font-family: var(--f); font-weight: 700; font-size: 13px; color: var(--ink); cursor: pointer; }
.price-apply:hover { border-color: var(--g700); }

/* ============ RÉSULTATS — barre d'outils ============ */
.rtoolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.rcount { font-size: 14px; color: var(--muted); }
.rcount b { color: var(--ink); }
.rtools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.selwrap { position: relative; }
.selwrap select { appearance: none; -webkit-appearance: none; border: 1.5px solid var(--line); background: var(--surf); border-radius: 50px; padding: 9px 36px 9px 15px; font-family: var(--f); font-weight: 700; font-size: 13.5px; color: var(--ink); cursor: pointer; outline: none; }
.selwrap select:hover { border-color: var(--g700); }
.selwrap .chev { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; pointer-events: none; color: var(--g600); }
.btn-filter { display: none; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--surf); border-radius: 50px; padding: 9px 16px; font-family: var(--f); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.btn-filter svg { width: 16px; height: 16px; }

/* ============ Chips de filtres actifs ============ */
.achips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; min-height: 2px; align-items: center; }
.achip { display: inline-flex; align-items: center; gap: 8px; background: var(--g50); border: 1px solid var(--line); border-radius: 50px; padding: 6px 8px 6px 14px; font-size: 13px; font-weight: 600; }
.achip a { border: none; background: #e2e2e2; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #555; font-size: 12px; line-height: 1; text-decoration: none; }
.achip a:hover { background: var(--g700); color: #fff; }
.achip-clear { background: none; border: none; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; padding: 6px 4px; text-decoration: none; }
.achip-clear:hover { color: var(--ink); }

/* ============ Grille de cartes ============ */
.rgrid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.pcard { display: flex; flex-direction: column; background: var(--surf); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-sm); transition: .18s; color: inherit; text-decoration: none; }
.pcard:hover { box-shadow: var(--sh-md); transform: translateY(-3px); }
.pc-img { aspect-ratio: 4/3; background: var(--g50); display: flex; align-items: center; justify-content: center; position: relative; }
.pc-img .pico { width: 34px; height: 34px; }
.pc-img > img { width: 100%; height: 100%; object-fit: cover; }
.pc-img .stock { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.95); color: #1f7a3d; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 50px; display: flex; align-items: center; gap: 6px; }
.pc-img .stock i { width: 7px; height: 7px; border-radius: 50%; background: #28a745; display: block; }
.pc-img .qadd { position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 50%; background: var(--g700); color: #fff; border: none; display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(6px); transition: .2s; cursor: pointer; }
.pcard:hover .qadd { opacity: 1; transform: none; }
.pc-img .qadd:hover { background: var(--or); color: #1a1a1a; }
.pc-img .qadd svg { width: 19px; height: 19px; }
.pc-body { padding: 16px 16px 18px; display: flex; flex-direction: column; flex: 1; }
.pc-body .sbrand { margin-bottom: 5px; }
.pc-body h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; line-height: 1.34; margin-bottom: 7px; }
.pc-desc { font-size: 13px; color: var(--muted); margin-bottom: 13px; line-height: 1.5; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.pc-foot .pr { font-size: 18px; font-weight: 800; }
.pc-foot .see { color: var(--ink); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; padding-bottom: 3px; transition: box-shadow .18s; }
.pc-foot .see svg { width: 14px; height: 14px; transition: .18s; }
.pcard:hover .pc-foot .see svg { transform: translateX(3px); }
.pcard:hover .pc-foot .see { box-shadow: inset 0 -3px 0 var(--or); }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* État de chargement AJAX (léger fondu + curseur d'attente) */
#catresults { position: relative; transition: opacity .15s; }
#catresults.is-loading { opacity: .45; pointer-events: none; }
#catresults.is-loading::after {
  content: ""; position: absolute; top: 80px; left: 50%; width: 34px; height: 34px;
  margin-left: -17px; border: 3px solid var(--line); border-top-color: var(--g700);
  border-radius: 50%; animation: schubnel-spin .7s linear infinite;
}
@keyframes schubnel-spin { to { transform: rotate(360deg); } }

/* ============ Pagination (classes WordPress) ============ */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 44px; flex-wrap: wrap; }
.pager .page-numbers { min-width: 42px; height: 42px; border-radius: 50px; border: 1.5px solid var(--line); background: var(--surf); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: var(--ink); padding: 0 8px; text-decoration: none; }
.pager a.page-numbers:hover { border-color: var(--g700); }
.pager .current { background: var(--g900); color: #fff; border-color: var(--g900); }
.pager .dots { border: none; background: none; min-width: auto; }
.pager .prev svg, .pager .next svg { width: 18px; height: 18px; }

/* ============ Arbre de catégories ============ */
.ftree details { border-bottom: 1px solid var(--line); }
.ftree details:last-child { border-bottom: none; }
.ftree summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.ftree summary::-webkit-details-marker { display: none; }
.ftree summary .ar { width: 16px; height: 16px; flex: 0 0 auto; color: var(--g600); transition: .2s; }
.ftree details[open] summary .ar { transform: rotate(180deg); }
.ftree summary:hover { color: var(--g900); }
.ftree .tlinks { display: flex; flex-direction: column; padding: 0 0 10px; }
.ftree .tlinks a { font-size: 13.5px; color: #555; padding: 5px 0 5px 10px; border-left: 2px solid transparent; transition: .12s; text-decoration: none; }
.ftree .tlinks a:hover { color: var(--ink); border-left-color: var(--or); }
.ftree .tlinks a.cur { color: var(--ink); border-left-color: var(--or); font-weight: 700; }
.ftree-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; font-size: 14px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); text-decoration: none; }
.ftree-link:last-child { border-bottom: none; }
.ftree-link:hover, .ftree-link.cur { color: var(--g900); }
.ftree-link.cur { box-shadow: inset 2px 0 0 var(--or); padding-left: 8px; }
.ftree-link .c { color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* ============ Responsive ============ */
.fback { display: none; }
@media (max-width: 1100px) { .rgrid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 920px) {
  .cat-grid { grid-template-columns: 1fr; }
  .filters { position: fixed; inset: 0 auto 0 0; z-index: 120; width: 88%; max-width: 340px; border: none; border-radius: 0; transform: translateX(-105%); transition: transform .25s; overflow: auto; box-shadow: var(--sh-md); }
  .filters.open { transform: none; }
  .fclose { display: flex; }
  .fback { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 110; opacity: 0; visibility: hidden; transition: .2s; }
  .fback.open { opacity: 1; visibility: visible; }
  .btn-filter { display: inline-flex; }
}
@media (max-width: 560px) {
  .rgrid { grid-template-columns: 1fr; }
  .pc-img .qadd { opacity: 1; transform: none; }
}
