/* Bootstrap 5 souligne tous les <a> de la page via son Reboot
   (a { text-decoration: underline }). En local le theme l'emporte grace a
   l'ordre de chargement, mais en production un plugin de fusion/minification CSS
   peut charger Bootstrap en dernier : le soulignement debordait alors sur le
   menu et le pied de page du theme. On retablit le comportement normal des liens.
   Specificite "body a" (0,0,2) > "a" (0,0,1) : gagne quel que soit l'ordre, et
   reste sous les regles de menu du theme (plus specifiques) si elles existent.
   Le catalogue n'a aucun lien souligne, ses filtres sont des <button>. */
body a {
    text-decoration: none;
}

.sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    padding: 1rem 0.5rem;
    border-radius: 6px;
    width: auto !important;
    float:none!important;
}
.modele-card {
    cursor: pointer;
    transition: .2s;
}
.modele-card:hover {
    transform: translateY(-4px);
}
/* ===== ETIQUETTE PROMOTION =====
   promo: true dans l'api d'ACPORTAIL, sur la carte du modele comme sur les
   variations de la modale. */
.modele-card,
.pc-promo-host {
    position: relative;
}
.pc-promo {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 3px 9px;
    border-radius: 4px;
    background: #d62828;
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    line-height: 1.2;
    pointer-events: none;
}
/* ===== BOUTON DEMANDE DE DEVIS ===== */
/* nom a gauche, bouton a droite sur la meme ligne, sur la carte comme dans
   la modale. Un nom long passe sur plusieurs lignes a cote du bouton ; si meme
   son mot le plus long ne tient pas a cote (carte tres etroite), le bouton
   passe dessous et reste cale a droite grace a son margin-left. */
.pc-ligne {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.pc-ligne > strong {
    flex: 1 1 0;
    text-align: left;
}
.pc-devis {
    flex: none;
    margin-left: auto;
    white-space: nowrap;
    padding: 7px 16px;
    border: 1.5px solid #d62828;
    border-radius: 4px;
    background: #fff;
    color: #d62828;
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.pc-devis:hover,
.pc-devis:focus-visible {
    background: #d62828;
    color: #fff;
}
.modele-card img {
    width: 100%;
    object-fit: contain;
    border-radius: 6px;
}

/* ===== APPARITION AU FILTRAGE =====
   Posee par animateBlocks() (catalogue.js) au clic sur un style de la sidebar,
   sur "Tous les modeles" et au changement de type. On anime la colonne et non
   la carte, pour ne pas se battre avec le translateY du survol. */
@keyframes pc-apparition {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}
.style-block.pc-apparition > h3,
.style-block.pc-apparition > h4 {
    animation: pc-apparition .3s ease-out backwards;
}
.style-block.pc-apparition .models-grid > * {
    animation: pc-apparition .35s ease-out backwards;
    animation-delay: calc(var(--pc-i, 0) * 40ms);
}
@media (prefers-reduced-motion: reduce) {
    .style-block.pc-apparition > h3,
    .style-block.pc-apparition > h4,
    .style-block.pc-apparition .models-grid > * {
        animation: none;
    }
}

/* ===== GRID VARIATIONS MODALE =====
   3 colonnes plutot que 4 sur grand ecran : les portails sont des images tres
   larges, une colonne de moins les rend nettement plus lisibles. */
.pc-modal-grid {
    display: grid;
    gap: 20px;
    /* plus d'air entre deux rangs : le bouton devis d'une variation ne doit
       pas sembler appartenir a l'image du dessous */
    row-gap: 36px;
}
@media (min-width: 992px) {
    .pc-modal-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 576px) and (max-width: 991px) {
    .pc-modal-grid { grid-template-columns: repeat(2, 1fr); }
}
/* telephone : une variation par ligne, chacune fermee par un trait */
@media (max-width: 575px) {
    .pc-modal-grid { grid-template-columns: 1fr; row-gap: 20px; }
    .pc-modal-grid:not(.pc-modal-grid--single) > .pc-promo-host {
        padding-bottom: 20px;
        border-bottom: 1px solid #e5e5e5;
    }
    .pc-modal-grid:not(.pc-modal-grid--single) > .pc-promo-host:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }
}

/* ===== MODELE D'ORIGINE =====
   En tete de l'onglet des variations (catalogue.js) : l'image de la carte en
   grand, assez basse pour laisser voir le haut des variations dessous. Le
   nom et le bouton devis prennent la largeur de l'image. */
.pc-original {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 8px;
}
.pc-original__visuel img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(48vh, 520px);
    margin: 0 auto;
    border-radius: 6px;
    object-fit: contain;
}
.pc-original .pc-ligne {
    margin-top: 8px;
}
.pc-original__mention {
    display: block;
    color: #6c757d;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.pc-variations-titre {
    margin: 16px 0 14px !important;
    padding-top: 14px;
    border-top: 1px solid #e5e5e5;
    font-weight: 700;
    font-size: .95rem;
}

/* leger zoom au survol d'un modele de la modale ; z-index pour passer
   au-dessus de ses voisins plutot que dessous. */
.pc-modal-grid .pc-promo-host {
    transition: transform .2s ease-out;
}
.pc-modal-grid .pc-promo-host:hover {
    transform: scale(1.04);
    z-index: 1;
}

/* modele sans variation : une seule image, affichee en grand et centree
   au lieu d'occuper une petite colonne de la grille. */
.pc-modal-grid--single {
    grid-template-columns: 1fr !important;
    max-width: 1000px;
    margin: 0 auto;
}
/* ... mais entiere a l'ecran, avec son nom et « Demander un devis » dessous,
   sans faire defiler la fenetre : sa hauteur est ce que laissent l'en-tete
   et les onglets (90vh de fenetre, ~290 points autour). La ligne du nom
   prend la largeur de l'image, le bouton reste sous son bord droit. */
.pc-modal-grid--single .pc-promo-host {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}
.pc-modal-grid--single .pc-promo-host:hover {
    transform: none;
}
.pc-modal-grid--single img {
    display: block;
    width: auto !important;
    max-width: 100%;
    max-height: max(200px, calc(90vh - 290px));
    margin: 0 auto;
}

/* ===== ANIMATION MODALE ===== */
#variationsModal .modal-content {
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}
#variationsModal .modal-content.open {
    transform: scale(1);
    opacity: 1;
}
/* ===== ROUGE ===== */
.list-group-item.active {
    background-color: #dc3545;
    border-color: #dc3545;
}

/* ===== SELECTEURS DE LA SIDEBAR =====
   Certains themes (Avada notamment) imposent une hauteur fixe aux <select>,
   ce qui rogne le texte verticalement. Bootstrap, lui, calcule la hauteur a
   partir du padding : on retablit ce fonctionnement, uniquement sur les
   selecteurs du catalogue pour ne rien changer ailleurs sur le site. */
.sidebar select.form-select,
.sidebar #pc-type-select,
.sidebar #pc-color-select {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    line-height: 1.5 !important;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    vertical-align: middle;
    text-overflow: ellipsis;
}

/* Au filtrage, la page remonte au debut de la grille. Cette marge evite que
   l'en-tete fixe du theme ne recouvre la premiere rangee de modeles. */
#pc-models {
    scroll-margin-top: 100px;
}

/* le label ne doit pas non plus etre colle ou tronque */
.sidebar .form-label {
    display: block;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

/* ===== PHOTOS DE CHANTIER =====
   Pastille sur la carte (partial-card.php), onglets Variations / Realisations
   dans la fenetre et visionneuse (catalogue.js). */
.pc-visuel {
    position: relative;
}
.pc-photos-pastille {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    /* les themes (Avada) etirent et grossissent les boutons : la pastille
       reste une etiquette d'une ligne, dans le coin */
    width: auto !important;
    max-width: calc(100% - 16px);
    margin: 0 !important;
    padding: 3px 9px !important;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, .78);
    color: #fff;
    font-size: .75rem !important;
    font-weight: 600;
    line-height: 1.3 !important;
    white-space: nowrap;
    cursor: pointer;
}
.pc-photos-pastille:hover,
.pc-photos-pastille:focus-visible {
    background: #d62828;
}

.pc-onglets {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}
.pc-onglet {
    margin-bottom: -1px;
    padding: 10px 0;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    color: #000;
    font-size: 1rem;
    cursor: pointer;
}
.pc-onglet[aria-selected="true"] {
    border-bottom-color: #d62828;
    color: #d62828;
    font-weight: 700;
}
.pc-panneau:not([hidden]) {
    animation: pc-apparition .25s ease-out;
}

.pc-realisations {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (min-width: 576px) and (max-width: 991px) {
    .pc-realisations { grid-template-columns: repeat(3, 1fr); }
}
/* telephone : une photo par ligne, comme les variations ; a deux, un portail
   ne faisait que 140 points de large */
@media (max-width: 575px) {
    .pc-realisations { grid-template-columns: 1fr; }
}
.pc-realisation {
    position: relative;
    display: block;
    padding: 0;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
    cursor: zoom-in;
}
.pc-realisation img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .2s ease-out;
}
.pc-realisation:hover img,
.pc-realisation:focus-visible img {
    transform: scale(1.05);
}
.pc-realisation__legende {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff;
    color: #000;
    font-size: .75rem;
    font-weight: 700;
}

/* au-dessus de la fenetre des variations (999999) */
.pc-visionneuse {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, .9);
}
.pc-visionneuse[hidden] {
    display: none;
}
.pc-visionneuse:not([hidden]) {
    animation: pc-visionneuse-ouvre .2s ease-out;
}
.pc-visionneuse__cadre {
    flex: 0 1 1400px;
    min-width: 0;
    margin: 0;
    text-align: center;
    color: #fff;
}
/* le cadre du slider : taille fixe, les deux photos s'y croisent en glissant
   (montrerPhoto), chacune contenue sans etre rognee */
.pc-visionneuse__piste {
    position: relative;
    height: calc(100vh - 110px);
    margin-bottom: 10px;
    overflow: hidden;
    touch-action: pan-y;
    cursor: grab;
}
.pc-visionneuse__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
}
@keyframes pc-visionneuse-ouvre {
    from { opacity: 0; }
    to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .pc-visionneuse:not([hidden]) { animation: none; }
}
.pc-visionneuse__fermer {
    position: absolute;
    top: 10px;
    right: 16px;
    border: 0;
    background: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
}
.pc-visionneuse__fleche {
    flex: none;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}
.pc-visionneuse__fleche:hover,
.pc-visionneuse__fleche:focus-visible {
    background: #d62828;
}
.pc-visionneuse__fleche[hidden] {
    display: none;
}
/* telephone : les fleches passent sur la photo */
@media (max-width: 575px) {
    .pc-visionneuse__fleche {
        position: absolute;
        z-index: 2; /* au-dessus des photos qui glissent */
        top: 50%;
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, .55);
    }
    .pc-visionneuse__fleche--avant { left: 8px; }
    .pc-visionneuse__fleche--apres { right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .pc-panneau:not([hidden]) { animation: none; }
}

/* ===== BANDEAU DES PROMOTIONS =====
   partial-promo.php, en tete de la grille. Le tampon respire, un reflet
   traverse le bandeau ; une fois la grille filtree (--actif), plus rien ne
   bouge : il ne reste qu'a revenir au catalogue entier. */
.pc-bandeau-promo {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 16px;
    padding: 16px 20px;
    border-radius: 10px;
    background: #d62828;
    color: #fff;
}
.pc-bandeau-promo__tampon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff;
    color: #d62828;
    font-size: 1.2rem;
    font-weight: 800;
    animation: pc-tampon 1.8s ease-in-out infinite;
}
.pc-bandeau-promo__texte {
    flex: 1 1 260px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pc-bandeau-promo__texte strong {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.pc-bandeau-promo__bouton {
    position: relative;
    z-index: 1;
    flex: none;
    width: auto !important;
    margin: 0 !important;
    padding: 12px 18px !important;
    border: 2px solid #fff !important;
    border-radius: 6px;
    background: #fff;
    color: #d62828;
    font-size: 1rem !important;
    font-weight: 700;
    line-height: 1.2 !important;
    cursor: pointer;
}
.pc-bandeau-promo__bouton:hover,
.pc-bandeau-promo__bouton:focus-visible {
    background: #000;
    border-color: #000 !important;
    color: #fff;
}
.pc-bandeau-promo__bouton--retour {
    background: transparent;
    color: #fff;
}
.pc-bandeau-promo__reflet {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 18%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
    pointer-events: none;
    animation: pc-reflet 3.5s ease-in-out infinite;
}
.pc-bandeau-promo--actif .pc-bandeau-promo__tampon,
.pc-bandeau-promo--actif .pc-bandeau-promo__reflet {
    animation: none;
}
.pc-bandeau-promo--actif .pc-bandeau-promo__reflet {
    display: none;
}
@keyframes pc-tampon {
    0%, 100% { transform: rotate(-6deg) scale(1); }
    50% { transform: rotate(-6deg) scale(1.08); }
}
@keyframes pc-reflet {
    0% { transform: translateX(-120%) skewX(-20deg); }
    50%, 100% { transform: translateX(560%) skewX(-20deg); }
}
/* telephone : tampon plus petit, bouton sur toute la largeur dessous */
@media (max-width: 575px) {
    .pc-bandeau-promo {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px;
    }
    .pc-bandeau-promo__tampon {
        width: 52px;
        height: 52px;
        font-size: 1rem;
    }
    .pc-bandeau-promo__texte {
        flex-basis: 0;
        flex-grow: 1;
    }
    .pc-bandeau-promo__texte strong {
        font-size: 1rem;
    }
    .pc-bandeau-promo__bouton {
        width: 100% !important;
    }
}

/* ===== PASTILLE FLOTTANTE (telephone) =====
   Creee par catalogue.js, montree quand le bandeau sort de l'ecran. */
.pc-promo-flottante {
    display: none;
}
@media (max-width: 575px) {
    .pc-promo-flottante:not([hidden]) {
        position: fixed;
        right: 16px;
        bottom: 20px;
        z-index: 99990;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        width: auto !important;
        margin: 0 !important;
        padding: 12px 18px !important;
        border: 0;
        border-radius: 999px;
        background: #d62828;
        color: #fff;
        font-size: 15px !important;
        font-weight: 700;
        line-height: 1.2 !important;
        cursor: pointer;
        animation: pc-rebond 3s ease-in-out infinite, pc-halo 2s ease-out infinite;
    }
}
@keyframes pc-rebond {
    0%, 70%, 100% { transform: translateY(0); }
    78% { transform: translateY(-10px); }
    86% { transform: translateY(0); }
    92% { transform: translateY(-4px); }
}
@keyframes pc-halo {
    0% { box-shadow: 0 6px 18px rgba(0, 0, 0, .25), 0 0 0 0 rgba(214, 40, 40, .5); }
    80%, 100% { box-shadow: 0 6px 18px rgba(0, 0, 0, .25), 0 0 0 14px rgba(214, 40, 40, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .pc-bandeau-promo__tampon,
    .pc-bandeau-promo__reflet,
    .pc-promo-flottante:not([hidden]) {
        animation: none;
    }
}

/* ===== EN-TETE DE LA FENETRE =====
   Ou l'on est dans le catalogue (fil), le nom du modele en grand, son
   etiquette de promo ; la croix a droite. Prefixe par #variationsModal :
   les titres du theme (Avada) ne doivent pas l'emporter. */
#variationsModal .pc-entete {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin: 6px 4px 18px;
}
#variationsModal .pc-entete__texte {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
#variationsModal .pc-entete__fil {
    color: #d62828;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1.3;
    text-transform: uppercase;
}
#variationsModal .pc-entete__ligne {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}
#variationsModal .pc-entete__nom {
    margin: 0;
    padding: 0;
    color: #000;
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
}
#variationsModal .pc-entete__promo {
    padding: 5px 12px;
    border-radius: 999px;
    background: #d62828;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}
#variationsModal .pc-entete__fil[hidden],
#variationsModal .pc-entete__promo[hidden] {
    display: none;
}
#variationsModal .pc-entete__fermer {
    flex: none;
    width: 44px !important;
    height: 44px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    border-radius: 50%;
    background: #f1f1f1;
    color: #000;
    font-size: 26px !important;
    line-height: 1 !important;
    cursor: pointer;
}
#variationsModal .pc-entete__fermer:hover,
#variationsModal .pc-entete__fermer:focus-visible {
    background: #000;
    color: #fff;
}
@media (max-width: 575px) {
    #variationsModal .pc-entete {
        margin: 0 0 14px;
    }
    #variationsModal .pc-entete__nom {
        font-size: 1.75rem;
    }
    #variationsModal .pc-entete__fil {
        font-size: .7rem;
    }
}

/* ===== LIBELLES LONG / COURT =====
   Les boutons de la sidebar portent deux libelles : le long sur ordinateur,
   le court dans la barre collee. Le long reste lu par les lecteurs d'ecran
   (masque visuellement seulement), le court est aria-hidden. */
.pc-court {
    display: none;
}

/* ===== TELEPHONE : UN RANG QUI DEFILE PAR SOUS-STYLE =====
   Une carte par ligne, empilees, faisaient ~25 ecrans pour un type. Chaque
   rang (style ou sous-style) devient une piste horizontale : une carte
   presque pleine largeur, le bord de la suivante visible pour inviter a
   glisser, et le compteur « 1 / n » dessous (partial-models.php,
   catalogue.js). Jusqu'a 800 et non 576 : Avada met .col-sm-6 a 100 % sous
   800, les cartes y etaient empilees aussi (telephone a l'horizontale). */
.pc-defile {
    display: none;
}
@media (min-width: 576px) and (max-width: 799.98px) {
    .models-grid > * {
        flex: 0 0 60% !important;
        max-width: 60% !important;
    }
}
@media (max-width: 799.98px) {
    .models-grid {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-left: calc(var(--bs-gutter-x) * .5);
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .models-grid::-webkit-scrollbar {
        display: none;
    }
    .models-grid > * {
        flex: 0 0 86%;
        max-width: 86%;
        margin-bottom: 0 !important;
        scroll-snap-align: start;
    }
    .models-grid > *:only-child {
        flex-basis: 100% !important;
        max-width: 100% !important;
    }
    /* la piste rogne le haut : pas de soulevement au toucher */
    .models-grid .modele-card:hover {
        transform: none;
    }
    /* a 86 % de largeur, nom et « Demander un devis » tiennent tout juste :
       un peu moins de marge, et un nom (« C-800 ») ne se coupe jamais sur
       son tiret ; s'il ne tient pas, le bouton passe dessous */
    .models-grid .modele-card .card-body {
        padding: .75rem;
    }
    .models-grid .modele-card .pc-ligne > strong {
        white-space: nowrap;
    }
    .models-grid .modele-card .pc-devis {
        padding: 7px 12px;
    }
    .pc-defile {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 14px;
        margin: 6px 0 18px;
        color: #555;
        font-size: .85rem;
        font-variant-numeric: tabular-nums;
    }
    .pc-defile__fleche {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px !important;
        height: 34px;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid #ccc !important;
        border-radius: 50% !important;
        background: #fff !important;
        color: #222 !important;
        font-size: 20px !important;
        line-height: 1 !important;
        box-shadow: none !important;
        cursor: pointer;
    }
    .pc-defile__fleche:disabled {
        opacity: .35;
        cursor: default;
    }
}

/* ===== PETIT ORDINATEUR : TROIS COLONNES =====
   Entre 992 et 1299 points, a cote de la sidebar, une carte sur quatre est
   trop etroite (186 points a 1200) : « Demander un devis » debordait. Il
   lui faut ~206 points de carte, atteints vers 1300 ; un portable en 1366
   garde ses quatre colonnes. En CSS et non en col-lg-4 : une grille
   Bootstrap 3 chargee par le site redefinit .col-lg-4 (33 %) au-dela de
   1200 et ecraserait toute colonne Bootstrap 5 plus large. */
@media (min-width: 992px) and (max-width: 1299.98px) {
    .models-grid > .col-lg-3 {
        flex: 0 0 auto;
        width: 33.333333%;
    }
}
/* nom et bouton sur une ligne : un code (« C-100 ») ne se coupe pas sur son
   tiret, le bouton passe dessous s'il ne tient pas a cote. Pas sur
   telephone, ou la carte est trop etroite pour un nom sur une ligne. */
@media (min-width: 992px) {
    .modele-card .pc-ligne > strong {
        white-space: nowrap;
    }
}

/* ===== TELEPHONE ET TABLETTE : BARRE COLLEE =====
   Sous 992 points la sidebar s'empilait au-dessus de la grille : il fallait
   la traverser avant le premier portail, puis tout remonter pour changer de
   style. Elle devient une barre collee en haut de l'ecran : « Filtres »
   (type et couleur, en panneau deroulant), « Tous », puis une pastille par
   style, qui defilent au doigt. Une pastille fait descendre a son style
   (sans masquer les autres), et celle du style a l'ecran s'allume
   (catalogue.js). */
.pc-barre__filtres {
    display: none;
}
@media (max-width: 991.98px) {
    /* !important : Avada pose position: relative sur les colonnes */
    /* top : sous la barre d'admin WordPress quand elle est fixee (connecte),
       sinon elle recouvre la barre ; mesure par catalogue.js */
    .pc-barre {
        position: sticky !important;
        top: var(--pc-barre-top, 0px);
        z-index: 50;
        margin-bottom: .75rem !important;
        background: #fff;
        border-bottom: 1px solid #e5e5e5;
    }
    .pc-barre .sidebar {
        position: static !important;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 0 !important;
        border-radius: 0 !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .pc-barre .sidebar::-webkit-scrollbar {
        display: none;
    }
    .pc-barre #pc-style-filters {
        display: contents;
    }
    .pc-barre .pc-long {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .pc-barre .pc-court {
        display: inline;
    }
    /* les pastilles : Avada et Bootstrap (list-group, btn, w-100, mb-2)
       habillent chacun ces boutons, d'ou les !important */
    .pc-barre .pc-barre__filtres,
    .pc-barre #filter-all,
    .pc-barre .sidebar-item {
        flex: none;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        width: auto !important;
        margin: 0 !important;
        padding: 6px 13px !important;
        border: 1px solid #ccc !important;
        border-radius: 999px !important;
        background: #fff !important;
        color: #222 !important;
        font-size: 13px !important;
        font-weight: 500;
        line-height: 1.2 !important;
        white-space: nowrap;
        box-shadow: none !important;
    }
    .pc-barre .sidebar-item.active {
        border-color: #d62828 !important;
        background: #d62828 !important;
        color: #fff !important;
    }
    .pc-barre .pc-barre__filtres[aria-expanded="true"] {
        border-color: #222 !important;
        background: #222 !important;
        color: #fff !important;
    }
    /* type et couleur : panneau deroulant sous la barre, par-dessus la grille */
    .pc-barre .pc-reglages {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 12px 15px 4px;
        background: #fff;
        border-bottom: 1px solid #e5e5e5;
        box-shadow: 0 8px 16px rgba(0, 0, 0, .12);
    }
    .pc-barre.pc-barre--ouverte .pc-reglages {
        display: block;
    }
    /* « Filtres » reste visible a gauche quand la barre defile vers la
       pastille allumee ; le halo blanc estompe les pastilles qui passent dessous */
    .pc-barre .pc-barre__filtres {
        position: sticky;
        left: 0;
        z-index: 1;
        box-shadow: 8px 0 8px -2px #fff !important;
    }
    /* les images arrivent en differe (GIF 1x1 en attendant) : sans hauteur
       reservee, la page s'allonge pendant le defilement vers un style et on
       s'arrete trop haut. Les visuels des modeles sont en 1024x576. */
    .modele-card img {
        aspect-ratio: 16 / 9;
    }
    /* le style vise par une pastille arrive sous la barre, pas dessous */
    #pc-models,
    .style-block {
        /* la barre d'admin, elle, est deja comptee par WordPress
           (html { scroll-padding-top }) */
        scroll-margin-top: calc(var(--pc-barre-h, 52px) + 8px);
    }
}
