/* Catalogue · la lumière du jour pour parcourir, le plateau pour regarder */

.cat-tete { padding: calc(72px + 2rem) 0 1.5rem; }
.cat-tete-grille { display: grid; gap: 1.5rem; align-items: end; }
.fil { font-size: .875rem; color: var(--encre-2); margin-bottom: .9rem; }
.fil a { color: var(--encre-2); }
.cat-tete h1 { font-size: clamp(2.3rem, 1.7rem + 2.6vw, 4rem); font-weight: 400; }
.cat-tete .chapeau { margin-top: .9rem; }
.cat-tete-photo { display: none; margin: 0; position: relative; }
.cat-tete-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.cat-tete-photo figcaption { position: absolute; right: .6rem; bottom: .5rem; font-size: .8125rem; background: rgba(245, 248, 251, .85); padding: .15rem .45rem; border-radius: 3px; color: var(--encre-2); }
@media (min-width: 980px) {
  .cat-tete { padding: calc(84px + 3rem) 0 2rem; }
  .cat-tete-grille { grid-template-columns: 1fr minmax(0, 520px); gap: 3rem; }
  .cat-tete-photo { display: block; height: 240px; }
}

.cat-zone { padding: 1.75rem 0 var(--section); }
.cat-grille { display: grid; gap: 2rem; }
.cat-barre {
  position: sticky; top: 72px; z-index: 20;
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .75rem var(--marge); margin: 0 calc(-1 * var(--marge)) 1rem;
  background: rgba(238, 242, 246, .97); border-bottom: 1px solid var(--trait-doux);
}
.cat-compte { font-size: 1rem; margin-right: auto; }
.cat-compte strong { font-family: var(--f-titre); font-weight: 500; font-size: 1.35rem; }
.btn-filtres { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1.5px solid var(--encre); background: var(--encre); color: var(--papier); font: 600 .9375rem var(--f-texte); cursor: pointer; transition: transform 160ms var(--ease-out); }
.btn-filtres:active { transform: scale(.97); }
.btn-filtres .pastille { min-width: 1.4rem; height: 1.4rem; border-radius: 999px; background: var(--flamme); color: #fff; font-size: .8125rem; display: inline-grid; place-items: center; padding: 0 .35rem; }
.btn-filtres .pastille:empty { display: none; }
.tri { display: inline-flex; align-items: center; gap: .5rem; font-size: .9375rem; }
.tri select { min-height: 44px; border-radius: 999px; border: 1.5px solid var(--trait); background: #fff; padding: 0 2.2rem 0 1rem; font: 500 .9375rem var(--f-texte); color: var(--encre); appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2322201E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; cursor: pointer; }
.tri select:focus-visible { outline: 2px solid var(--flamme); outline-offset: 2px; }
.tri .libelle-tri { color: var(--encre-2); }
@media (max-width: 639px) { .tri .libelle-tri { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .cat-compte { width: 100%; order: -1; } }

.actifs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.actifs:empty { display: none; }
.actif { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: 0 .55rem 0 .8rem; border-radius: 999px; border: 1px solid var(--trait); background: #fff; font: 500 .875rem var(--f-texte); color: var(--encre); cursor: pointer; }
.actif .ic { width: 1rem; height: 1rem; color: var(--encre-2); }
@media (hover: hover) and (pointer: fine) { .actif:hover { border-color: var(--encre); } }

/* filtres */
.filtres { display: grid; gap: 1.6rem; align-content: start; }
.filtres fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: .55rem; }
.filtres legend, .filtres .titre-filtre { font-weight: 600; font-size: .9375rem; margin-bottom: .55rem; padding: 0; }
.coche { display: flex; align-items: center; gap: .7rem; min-height: 40px; cursor: pointer; font-size: 1rem; }
.coche input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 5px; border: 1.5px solid #8C97A3; background: #fff; display: grid; place-items: center; flex: none; cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease; }
.coche input[type="radio"] { border-radius: 50%; }
.coche input::after { content: ""; width: 11px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg) scale(.6); opacity: 0; transition: opacity 140ms ease, transform 160ms var(--ease-out); }
.coche input[type="radio"]::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; transform: scale(.6); }
.coche input:checked { background: var(--encre); border-color: var(--encre); }
.coche input:checked::after { opacity: 1; transform: translateY(-1px) rotate(-45deg) scale(1); }
.coche input[type="radio"]:checked::after { transform: scale(1); }
.coche input:focus-visible { outline: 2px solid var(--flamme); outline-offset: 2px; }
.coche .n { margin-left: auto; color: var(--encre-2); font-size: .875rem; font-variant-numeric: tabular-nums; }
.filtre-surface .surface-ligne { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.filtre-surface output { font-family: var(--f-titre); font-size: 1.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.filtre-surface .curseur[disabled] { opacity: .45; cursor: not-allowed; }
.filtres .effacer { justify-self: start; min-height: 44px; padding: 0; border: 0; background: none; font: 600 .9375rem var(--f-texte); color: var(--flamme-fonce); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.filtres-aide { font-size: .875rem; color: var(--encre-2); }
.filtres-aide a { color: var(--encre); font-weight: 600; }


/* tiroir sur téléphone */
.tiroir-haut, .tiroir-bas { display: none; }
@media (max-width: 979px) {
  .filtres-panneau {
    position: fixed; inset: 0; z-index: 70; background: var(--neige);
    display: flex; flex-direction: column;
    transform: translateY(100%); visibility: hidden;
    transition: transform 320ms cubic-bezier(.32, .72, 0, 1), visibility 0s linear 320ms;
  }
  .filtres-panneau.est-ouvert { transform: none; visibility: visible; transition: transform 320ms cubic-bezier(.32, .72, 0, 1); }
  .tiroir-haut { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 var(--marge); border-bottom: 1px solid var(--trait-doux); flex: none; }
  .tiroir-haut h2 { font-family: var(--f-texte); font-size: 1.125rem; font-weight: 600; letter-spacing: 0; }
  .tiroir-haut button { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .5rem; margin-right: -.5rem; border: 0; background: none; font: 600 1rem var(--f-texte); color: var(--encre); cursor: pointer; }
  .filtres { overflow-y: auto; padding: 1.5rem var(--marge) 2rem; flex: 1; overscroll-behavior: contain; }
  .tiroir-bas { display: block; flex: none; padding: .75rem var(--marge) calc(.75rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--trait-doux); background: var(--neige); }
  .tiroir-bas .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .filtres-panneau, .filtres-panneau.est-ouvert { transition: none; } }
@media (min-width: 980px) {
  .filtres { gap: 1.3rem; }
  .filtres .coche { min-height: 34px; }
  .filtres fieldset { gap: .3rem; }
  .cat-grille { grid-template-columns: 260px 1fr; gap: clamp(2rem, 3vw, 3.5rem); align-items: start; }
  .btn-filtres { display: none; }
  .filtres-panneau { padding-right: .5rem; }
  .cat-barre { top: 84px; margin: 0 0 1rem; padding: .75rem 0; background: transparent; border-bottom: 1px solid var(--trait-doux); position: static; }
}

.vide-cat { display: grid; gap: 1rem; justify-items: start; padding: 2.5rem; border: 1px dashed var(--trait); border-radius: 6px; }
.vide-cat[hidden] { display: none; }
.vide-cat h2 { font-size: 1.8rem; }
.vide-cat p { color: var(--encre-2); max-width: 32rem; }
.vide-cat .actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* bandeau de fin */
.cat-fin { background: var(--heure-bleue); color: var(--papier); padding: clamp(4rem, 3rem + 5vw, 8rem) 0; position: relative; z-index: 1; overflow: hidden; isolation: isolate; }
.cat-fin-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 75% 50%; z-index: -2; }
.cat-fin::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(16, 20, 30, .86) 0%, rgba(16, 20, 30, .7) 55%, rgba(16, 20, 30, .25) 100%); }
@media (max-width: 979px) { .cat-fin::before { background: rgba(16, 20, 30, .74); } }
.cat-fin .legende { position: absolute; right: var(--marge); bottom: .8rem; color: var(--papier); background: rgba(14, 18, 26, .62); padding: .2rem .5rem; border-radius: 3px; font-size: .8125rem; }
.cat-fin .cadre { display: grid; gap: 1.5rem; }
.cat-fin .cadre > div:first-child { display: grid; gap: .9rem; }
.cat-fin p { color: var(--papier-2); max-width: 34rem; }
.cat-fin .actions { display: flex; flex-wrap: wrap; gap: .75rem; }
@media (min-width: 980px) { .cat-fin .cadre { grid-template-columns: 1fr auto; align-items: center; } }

/* familles : quatre onglets sous le titre */
.cat-familles { display: grid; gap: 1rem; margin-top: 1.75rem; }
.cat-familles .onglets { justify-self: start; overflow-x: auto; scrollbar-width: none; }
.cat-familles .onglets::-webkit-scrollbar { display: none; }
.cat-explication { max-width: 44rem; color: var(--encre-2); font-size: 1.0625rem; }
.cat-explication[hidden] { display: none; }
@media (max-width: 559px) { .cat-familles .onglets { justify-self: stretch; } .cat-familles .onglet { padding: 0 .7rem; } .cat-familles .onglet .n { display: none; } }
.filtre-appareil[hidden] { display: none; }

/* grille des modèles : on parcourt vite, on touche pour voir en grand */
.liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.liste:empty { display: none; }
.plus { margin: 2rem auto 0; display: flex; }
.plus[hidden] { display: none; }
.carte { position: relative; height: 100%; }
.carte-lien {
  display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--encre);
  background: #fff; border-radius: 6px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(34, 40, 52, .06), 0 10px 30px -18px rgba(34, 40, 52, .22);
  transition: box-shadow 260ms var(--ease-out), transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.carte-lien:active { transform: scale(.985); }
.carte-visuel { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: #fff; }
.carte-visuel img { position: absolute; max-width: none; height: auto; transition: transform 360ms var(--ease-out); }
.carte-exclu { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.carte-exclu span { background: var(--encre); color: var(--papier); font-size: .8125rem; font-weight: 600; padding: .3rem .5rem; border-radius: 3px; line-height: 1.2; }
.carte-exclu span.clair { background: var(--givre); color: var(--encre); }
.carte-corps { display: grid; gap: .3rem; padding: .85rem .95rem 1rem; border-top: 1px solid #EEF1F4; flex: 1; align-content: start; }
.carte-marque { font-size: .8125rem; color: var(--encre-2); font-weight: 500; }
.carte-nom { font-family: var(--f-titre); font-weight: 450; font-size: 1.22rem; letter-spacing: -.01em; line-height: 1.15; }
.carte-donnees { font-size: .9375rem; color: var(--encre-2); font-variant-numeric: tabular-nums; margin-top: .15rem; }
.carte-donnees b { color: var(--encre); font-weight: 600; }
.carte-voir { display: inline-flex; align-items: center; gap: .35rem; margin-top: .45rem; font-size: .9375rem; font-weight: 600; color: var(--flamme-fonce); }
.carte-voir .ic { width: 1.1em; height: 1.1em; transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .carte-lien:hover { box-shadow: 0 1px 2px rgba(34, 40, 52, .06), 0 18px 40px -22px rgba(34, 40, 52, .45); }
  .carte-lien:hover .carte-visuel img { transform: translateY(-4px); }
  .carte-lien:hover .carte-voir .ic { transform: translateX(3px); }
}
@media (max-width: 639px) {
  .carte-corps { padding: .7rem .7rem .8rem; }
  .carte-nom { font-size: 1.05rem; }
  .carte-donnees { font-size: .875rem; }
  .carte-voir { font-size: .875rem; }
}
@media (min-width: 640px) { .liste { gap: 1rem; } }
@media (min-width: 1100px) { .liste { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } }

/* ---------- la fiche produit : le plateau en grand ---------- */
.fiche-plateau {
  padding: 0; border: 0; margin: auto; color: var(--encre); background: transparent;
  width: min(1240px, calc(100vw - 48px)); max-width: none; max-height: none;
  overflow: visible;
}
.fiche-plateau::backdrop { background: rgba(18, 22, 30, .5); }
.fp-feuille {
  position: relative; display: flex; flex-direction: column;
  max-height: calc(100dvh - 48px); overflow: hidden;
  background: var(--neige); border-radius: 8px;
  box-shadow: 0 2px 6px rgba(18, 22, 30, .12), 0 30px 80px -30px rgba(18, 22, 30, .55);
}
.fp-haut { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--trait-doux); flex: none; }
.fp-poignee { display: none; }
.fp-pos { margin-right: auto; font-size: .9375rem; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.fp-fermer { display: inline-flex; align-items: center; gap: .4rem; min-height: 48px; padding: 0 1rem; border: 0; border-radius: 999px; background: var(--encre); color: var(--papier); font: 600 .9375rem var(--f-texte); cursor: pointer; transition: transform 160ms var(--ease-out); touch-action: manipulation; }
.fp-fermer:active { transform: scale(.97); }
.fp-corps { overflow-y: auto; overscroll-behavior: contain; padding: clamp(1rem, .5rem + 1.5vw, 2rem); }
.fp-corps .scene { touch-action: none; }

/* ouverture : la feuille monte depuis la carte touchée (ordinateur) ou depuis le bas (téléphone) */
@media (prefers-reduced-motion: no-preference) {
  .fiche-plateau[open] .fp-feuille { animation: feuille-entre 260ms var(--ease-out); transform-origin: var(--ox, 50%) var(--oy, 50%); }
  .fiche-plateau[open]::backdrop { animation: voile-entre 220ms ease-out; }
  .fiche-plateau.ferme .fp-feuille { animation: feuille-sort 170ms ease-in forwards; }
  .fiche-plateau.ferme::backdrop { animation: voile-sort 170ms ease-in forwards; }
  @keyframes feuille-entre { from { opacity: 0; transform: scale(.96); } }
  @keyframes feuille-sort { to { opacity: 0; transform: scale(.97); } }
  @keyframes voile-entre { from { opacity: 0; } }
  @keyframes voile-sort { to { opacity: 0; } }
}

@media (max-width: 899px) {
  .fiche-plateau { width: 100vw; height: 100dvh; margin: 0; max-height: 100dvh; }
  .fiche-plateau::backdrop { background: rgba(18, 22, 30, .6); }
  .fp-feuille { height: 100dvh; max-height: 100dvh; border-radius: 0; transition: transform 320ms cubic-bezier(.32, .72, 0, 1); }
  .fp-haut { position: relative; padding: 1rem var(--marge) .6rem; padding-top: calc(1rem + env(safe-area-inset-top)); touch-action: none; border-bottom: 0; }
  .fp-poignee { display: block; position: absolute; left: 50%; top: calc(6px + env(safe-area-inset-top)); width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--trait); }
  .fp-corps { padding: 0 var(--marge) 0; flex: 1; }
  .fp-corps .scene { margin-inline: calc(-1 * var(--marge)); border-radius: 0; height: min(46dvh, 420px); }
  .fp-corps .plateau { gap: 1.25rem; }
  .fp-corps .pfiche { padding-bottom: 1.25rem; }
  .fp-corps .pfiche-actions {
    position: sticky; bottom: 0; z-index: 2; margin: 0 calc(-1 * var(--marge));
    padding: .75rem var(--marge) calc(.75rem + env(safe-area-inset-bottom));
    background: var(--neige); border-top: 1px solid var(--trait-doux);
  }
  @media (prefers-reduced-motion: no-preference) {
    .fiche-plateau[open] .fp-feuille { animation: feuille-monte 340ms cubic-bezier(.32, .72, 0, 1); }
    .fiche-plateau.ferme .fp-feuille { animation: feuille-descend 220ms ease-in forwards; }
    @keyframes feuille-monte { from { transform: translateY(100%); } }
    @keyframes feuille-descend { to { transform: translateY(100%); } }
  }
}
@media (min-width: 900px) {
  .fp-corps .plateau { grid-template-columns: minmax(0, 7fr) minmax(0, 4.6fr); }
  .fp-corps .scene { height: min(62dvh, 600px); }
}
