/* ============================================================
   Sélecteur de templates pro — design aligné sur la charte plugin
   Palette : charbon #1A1A18, doré #B8945F, crème #fcfaf6, bordure #e6dfd0
   ============================================================ */

.lcr-tp {
    margin: 0 0 18px;
    background: #fcfaf6;
    border: 1px solid #e6dfd0;
    border-radius: 10px;
    overflow: hidden;
    color: #1A1A18;
    font-family: inherit;
    width: 100%;
}

/* La sidebar parent est un CSS grid auto-fit (colonnes ~220px). Sans cet
   override, .lcr-tp et .lcr-ps-legacy-block ne prendraient qu'une colonne.
   On force grid-column: 1 / -1 pour qu'ils traversent toute la largeur. */
.lcr-poster-sidebar__body > .lcr-tp,
.lcr-poster-sidebar__body > .lcr-ps-legacy-block,
.lcr-poster-sidebar__body > .lcr-ps-include-toggles { grid-column: 1 / -1; }

/* ─ Header compact (titre seul depuis que la checkbox legacy est sortie) ── */
.lcr-tp__header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfaf6 100%);
    border-bottom: 1px solid #e6dfd0;
}

.lcr-tp__title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1A1A18;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lcr-tp__title::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #B8945F;
    border-radius: 50%;
}

/* .lcr-tp__legacy : style appliqué uniquement via .lcr-tp-legacy-bar ci-dessous
   (la checkbox a été sortie du header de .lcr-tp pour permettre le masquage
   complet du bloc Modèle d'affiche). */

/* ─ Body ─────────────────────────────────────────────────────── */
.lcr-tp__body { padding: 14px 16px 12px; }

/* ─ Récap "modèle sélectionné" (toujours visible) ─────────────── */
.lcr-tp__selected {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: linear-gradient(180deg, #fcfaf6 0%, #f7f1e6 100%);
    border: 1.5px solid #B8945F;
    border-radius: 7px;
    box-shadow: 0 2px 6px rgba(184, 148, 95, 0.15);
}

.lcr-tp__selected[hidden] { display: none; }

.lcr-tp__selected-thumb {
    flex: 0 0 44px;
    width: 44px;
    height: 55px;
    border-radius: 4px;
    overflow: hidden;
    background: #e6dfd0;
}

.lcr-tp__selected-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lcr-tp__selected-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.lcr-tp__selected-label {
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #B8945F;
}

.lcr-tp__selected-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #1A1A18;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lcr-tp__selected-meta {
    font-size: 10.5px;
    color: #6b6862;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    margin-top: 1px;
}

.lcr-tp__selected-clear {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    background: transparent;
    border: 1px solid #d6cfc0;
    border-radius: 50%;
    color: #6b6862;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.12s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lcr-tp__selected-clear:hover {
    border-color: #c0392b;
    color: #c0392b;
    background: rgba(192, 57, 43, 0.06);
}

.lcr-tp__selected-empty {
    padding: 8px 12px;
    margin-bottom: 12px;
    background: #ffffff;
    border: 1px dashed #d6cfc0;
    border-radius: 6px;
    font-size: 11px;
    color: #a39e93;
    text-align: center;
    font-style: italic;
}

.lcr-tp__selected-empty[hidden] { display: none; }

/* État legacy : on cache TOUT le bloc Modèle d'affiche (la classe is-legacy
   est posée par le JS sur .lcr-tp). La checkbox est dans une barre séparée
   .lcr-tp-legacy-bar qui reste visible. */
.lcr-tp.is-legacy { display: none !important; }

/* ─ Barre toggle "Mode libre" sortie du bloc Modèle d'affiche ─────── */
.lcr-tp-legacy-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    flex-wrap: wrap;
}

/* Bouton "Copier le design" — pill dans le bar legacy, style outline doré */
.lcr-tp__copy-design {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #B8945F;
    color: #B8945F;
    border-radius: 999px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.12s;
}

.lcr-tp__copy-design:hover {
    background: #B8945F;
    color: #fff;
}

.lcr-tp__copy-design.is-copied {
    background: #5a8a5a;
    border-color: #5a8a5a;
    color: #fff;
}

.lcr-tp-legacy-bar .lcr-tp__legacy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b6862;
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    background: #fcfaf6;
    border: 1px solid #e6dfd0;
    border-radius: 999px;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.lcr-tp-legacy-bar .lcr-tp__legacy:hover {
    background: rgba(184, 148, 95, 0.10);
    border-color: #B8945F;
    color: #1A1A18;
}

.lcr-tp-legacy-bar .lcr-tp__legacy input {
    margin: 0;
    cursor: pointer;
    accent-color: #B8945F;
}

/* Quand "Mode libre" est coché, on indique visuellement la pill comme active */
.lcr-tp-legacy-bar:has(input:checked) .lcr-tp__legacy {
    background: #1A1A18;
    color: #fcfaf6;
    border-color: #1A1A18;
}

/* ─ Recherche ────────────────────────────────────────────────── */
.lcr-tp__search-wrap {
    position: relative;
    margin-bottom: 10px;
}

.lcr-tp__search-wrap::before {
    content: "🔍";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.5;
    pointer-events: none;
}

.lcr-tp__search {
    width: 100%;
    padding: 8px 12px 8px 30px;
    background: #ffffff;
    border: 1px solid #e6dfd0;
    border-radius: 6px;
    font-size: 13px;
    color: #1A1A18;
    transition: border-color 0.12s, box-shadow 0.12s;
    box-sizing: border-box;
}

.lcr-tp__search::placeholder { color: #a39e93; }

.lcr-tp__search:focus {
    outline: none;
    border-color: #B8945F;
    box-shadow: 0 0 0 3px rgba(184, 148, 95, 0.15);
}

/* ─ Filtres (pills horizontales) ─────────────────────────────── */
.lcr-tp__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.lcr-tp__filter {
    padding: 5px 11px;
    background: #ffffff;
    border: 1px solid #e6dfd0;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    color: #6b6862;
    cursor: pointer;
    transition: all 0.12s ease;
    font-family: inherit;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lcr-tp__filter:hover {
    border-color: #B8945F;
    color: #1A1A18;
}

.lcr-tp__filter.is-active {
    background: #1A1A18;
    border-color: #1A1A18;
    color: #fcfaf6;
    font-weight: 600;
}

.lcr-tp__filter-count {
    font-size: 10px;
    opacity: 0.6;
    font-weight: 400;
}

.lcr-tp__filter.is-active .lcr-tp__filter-count {
    opacity: 0.8;
    color: #B8945F;
}

/* Rangée photo : visuellement distincte (nuance plus douce, fond beige) */
.lcr-tp__filters--photo {
    margin-top: -4px;
    margin-bottom: 14px;
    padding-top: 8px;
    border-top: 1px dashed #e6dfd0;
}

.lcr-tp__filter--photo {
    background: #fcfaf6;
    font-size: 11px;
}

.lcr-tp__filter--photo.is-active {
    background: #B8945F;
    border-color: #B8945F;
    color: #fff;
}

.lcr-tp__filter--photo.is-active .lcr-tp__filter-count {
    color: #fff;
}

/* ─ Grille de cards ──────────────────────────────────────────── */
.lcr-tp__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px;
    margin: 0 -2px;
}

/* Scrollbar discrète */
.lcr-tp__grid::-webkit-scrollbar { width: 6px; }
.lcr-tp__grid::-webkit-scrollbar-track { background: transparent; }
.lcr-tp__grid::-webkit-scrollbar-thumb { background: #d6cfc0; border-radius: 3px; }
.lcr-tp__grid::-webkit-scrollbar-thumb:hover { background: #B8945F; }

/* ─ Card ─────────────────────────────────────────────────────── */
.lcr-tp__card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #ffffff;
    border: 1.5px solid #e6dfd0;
    border-radius: 7px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    text-align: left;
    color: #1A1A18;
    font-family: inherit;
    overflow: hidden;
}

.lcr-tp__card:hover {
    transform: translateY(-2px);
    border-color: #B8945F;
    box-shadow: 0 6px 14px rgba(26, 26, 24, 0.10);
}

.lcr-tp__card:hover .lcr-tp__card-img { transform: scale(1.04); }

.lcr-tp__card.is-selected {
    border-color: #B8945F;
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(184, 148, 95, 0.20), 0 4px 12px rgba(184, 148, 95, 0.20);
    background: linear-gradient(180deg, #fcfaf6 0%, #f7f1e6 100%);
}

.lcr-tp__card-img-wrap {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: linear-gradient(135deg, #f0e8d8 0%, #e6dfd0 100%);
    position: relative;
}

.lcr-tp__card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

/* Placeholder quand pas de preview */
.lcr-tp__card-img:not([src]),
.lcr-tp__card-img[src=""],
.lcr-tp__card-img[src*="_missing"] {
    display: none;
}

.lcr-tp__card-img-wrap::before {
    content: "Aucune preview";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #a39e93;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    z-index: 0;
}

.lcr-tp__card-img-wrap:has(img[src]:not([src=""]):not([src*="_missing"]))::before {
    display: none;
}

.lcr-tp__card-body {
    padding: 6px 8px 8px;
}

.lcr-tp__card-name {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: #1A1A18;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.005em;
}

.lcr-tp__card-fam {
    display: block;
    font-size: 9.5px;
    color: #a39e93;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* Badge "photo requise" */
.lcr-tp__card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    background: rgba(26, 26, 24, 0.75);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    backdrop-filter: blur(4px);
}

/* Picto œil "voir en grand" : déclenche Fancybox sans propager le clic
   à la card (event.stopPropagation côté inline). Visible au hover de la card. */
.lcr-tp__card-eye {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 26, 24, 0.78);
    color: #fff;
    border-radius: 50%;
    backdrop-filter: blur(4px);
    text-decoration: none;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.15s, transform 0.15s, background 0.12s;
    z-index: 2;
}

.lcr-tp__card:hover .lcr-tp__card-eye,
.lcr-tp__card-eye:focus-visible {
    opacity: 1;
    transform: scale(1);
}

.lcr-tp__card-eye:hover {
    background: #B8945F;
    transform: scale(1.08);
}

/* Check sélection */
.lcr-tp__card-check {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    background: #B8945F;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(184, 148, 95, 0.40);
}

.lcr-tp__card.is-selected .lcr-tp__card-check { display: flex; }

/* ─ Empty state ──────────────────────────────────────────────── */
.lcr-tp__empty {
    grid-column: 1 / -1;
    padding: 32px 16px;
    text-align: center;
    color: #a39e93;
    font-size: 12px;
    font-style: italic;
}

/* ─ Footer (régénération) ────────────────────────────────────── */
.lcr-tp__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #f7f1e6;
    border-top: 1px solid #e6dfd0;
    font-size: 11px;
    color: #6b6862;
}

.lcr-tp__regen {
    background: transparent;
    border: 0;
    color: #B8945F;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: background 0.12s, color 0.12s;
    font-family: inherit;
}

.lcr-tp__regen:hover { background: rgba(184, 148, 95, 0.12); color: #1A1A18; }
.lcr-tp__regen:disabled { opacity: 0.5; cursor: wait; }

.lcr-tp__regen-status { font-size: 11px; color: #6b6862; }

/* ─ Masquage des contrôles legacy en mode libre+template ──────
   Quand l'utilisateur est sur l'onglet libre ET que le mode "Mode libre
   (sans modèle)" n'est pas activé, on cache tout l'ancien système
   prompt-driven (Presets / Mood / Palette / Typo / Layout / Logo / etc.)
   La classe `is-libre-template-mode` est posée par template-picker.php sur
   l'ancêtre `.lcr-poster-sidebar` selon les events lcr:source-changed et
   lcr:template-legacy-toggled. */
.lcr-poster-sidebar.is-libre-template-mode .lcr-ps-legacy-block { display: none; }

/* Bloc legacy compact + responsive : les selects (Style / Ambiance / Palette /
   Typo / Layout / Qualité / Position logo) s'arrangent en grille 2-4 colonnes
   selon la largeur dispo. Plus dense, plus moderne, plus lisible. */
.lcr-ps-legacy-block {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 14px;
    padding: 4px 0;
}

/* Éléments qui doivent garder la pleine largeur dans la grille legacy */
.lcr-ps-legacy-block > .lcr-poster-sidebar__field--toggles,
.lcr-ps-legacy-block > #lcr-ps-save-defaults,
.lcr-ps-legacy-block > #lcr-ps-save-status,
.lcr-ps-legacy-block > .lcr-poster-sidebar__field:has(.lcr-poster-presets),
.lcr-ps-legacy-block > .lcr-poster-sidebar__field:has(#lcr-ps-configs-list),
.lcr-ps-legacy-block > style {
    grid-column: 1 / -1;
}

/* Selects compacts dans le bloc legacy */
.lcr-ps-legacy-block .lcr-poster-sidebar__field { margin: 0; }
.lcr-ps-legacy-block .lcr-poster-sidebar__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b6862;
    margin-bottom: 4px;
    display: block;
}
.lcr-ps-legacy-block .lcr-poster-sidebar__select {
    width: 100%;
    padding: 6px 10px;
    font-size: 12.5px;
    background: #fff;
    border: 1px solid #e6dfd0;
    border-radius: 5px;
    color: #1A1A18;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.lcr-ps-legacy-block .lcr-poster-sidebar__select:focus {
    outline: none;
    border-color: #B8945F;
    box-shadow: 0 0 0 3px rgba(184, 148, 95, 0.15);
}

/* Presets rapides : pills compactes en flex-wrap */
.lcr-ps-legacy-block .lcr-poster-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.lcr-ps-legacy-block .lcr-poster-preset-btn {
    padding: 4px 10px;
    font-size: 11.5px;
    background: #fcfaf6;
    border: 1px solid #e6dfd0;
    border-radius: 999px;
    color: #6b6862;
    cursor: pointer;
    transition: all 0.12s;
}
.lcr-ps-legacy-block .lcr-poster-preset-btn:hover {
    background: rgba(184, 148, 95, 0.10);
    border-color: #B8945F;
    color: #1A1A18;
}

/* Range slider taille logo plus compact */
.lcr-ps-legacy-block input[type="range"] { margin-top: 4px; }

/* En mode libre+template, on cache aussi dans le workspace event :
   - les slots "Modèle d'affiche" et "Inspiration" (gérés par le template)
   - la section "Texte de l'affiche" (Brief libre + Accroche IA, sans usage en template)
   La classe `is-libre-template-mode` est posée sur <body> par le JS du picker. */
/* En TOUS modes libre (template ET legacy) :
   - Slots "Modèle d'affiche" et "Inspiration" cachés (le rendu est piloté par
     le template ou les paramètres mood/palette, pas par des références photo)
   - Section "Texte de l'affiche" (Brief libre + Accroche IA) cachée
     (redondant avec les champs Titre/Sous-titre du formulaire affiche libre) */
body.lcr-libre-active .lcr-poster-slot--hide-in-libre,
body.lcr-libre-active .lcr-poster-section--hide-in-libre { display: none; }

/* En mode libre, on cache le bouton flottant de réglages : la sidebar est
   directement disponible dans l'accordéon en haut de l'onglet libre. */
body.lcr-libre-active .lcr-poster-settings-fab { display: none; }

/* En mode libre (template OU legacy) : on cache les contrôles spécifiques
   au logo La Cueille (Inclure le logo / Position / Taille). Ces contrôles
   n'ont aucun sens pour les affiches libres qui définissent leur propre
   logo via le formulaire d'édition de l'affiche. */
body.lcr-libre-active .lcr-poster-sidebar__field--logo-cueille { display: none; }

/* Inverse : champs réservés au générateur libre (style de bande infos),
   masqués sur les onglets La Cueille / Euphoribes pour préserver leur
   branding strict (footer = full-bar imposé serveur-side de toute façon). */
body:not(.lcr-libre-active) .lcr-poster-sidebar__field--libre-only { display: none; }

.lcr-poster-sidebar__hint {
    font-size: 11px;
    line-height: 1.35;
    opacity: 0.65;
    margin: 6px 0 0;
}

/* ── Toolbar de filtres pour les presets rapides ─────────────────────────
   Boutons en ligne au-dessus de la grille de presets. Filtre `data-filter`
   posé sur le conteneur `.lcr-poster-presets`, masque tout preset dont le
   data-style ne matche pas (sauf en mode "all"). */
.lcr-poster-presets-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.lcr-poster-presets-filters__btn {
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    border: 1px solid #d4cab0;
    color: #5c4630;
    font: 600 11px/1 system-ui, sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.lcr-poster-presets-filters__btn:hover {
    border-color: #B8923A;
    color: #B8923A;
}
.lcr-poster-presets-filters__btn.is-active {
    background: #1A1A18;
    border-color: #1A1A18;
    color: #F2EBD9;
}
.lcr-poster-presets[data-filter="pro"]          .lcr-poster-preset-btn:not([data-style="pro"]),
.lcr-poster-presets[data-filter="photo"]        .lcr-poster-preset-btn:not([data-style="photo"]),
.lcr-poster-presets[data-filter="illustration"] .lcr-poster-preset-btn:not([data-style="illustration"]) {
    display: none;
}

/* Bouton "🎲 Surprise" — palette distincte des filtres pour signaler une action,
   pas un filtre. Pousse-toi à droite pour ne pas se confondre avec eux. */
.lcr-poster-surprise-btn {
    margin-left: auto;
    background: linear-gradient(135deg, #B8923A 0%, #C9A961 100%);
    border-color: #B8923A;
    color: #1A1A18;
}
.lcr-poster-surprise-btn:hover {
    background: linear-gradient(135deg, #C9A961 0%, #E0BF7A 100%);
    border-color: #C9A961;
    color: #1A1A18;
    transform: rotate(-2deg) scale(1.04);
}

/* ─ Accordéon "Réglages de génération" — affiché sur les 3 onglets ─────
   Réglages inline (au-dessus de la liste d'événements), replié par défaut.
   Héberge la sidebar via #lcr-libre-settings-host (le JS template-picker
   la déplace ici au load). Chaque onglet conserve ses propres valeurs. */
.lcr-libre-settings {
    margin-bottom: 18px;
    background: #fcfaf6;
    border: 1px solid #e6dfd0;
    border-radius: 10px;
    overflow: hidden;
}

.lcr-libre-settings__summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfaf6 100%);
    border-bottom: 1px solid #e6dfd0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1A1A18;
    user-select: none;
    transition: background 0.12s;
}

.lcr-libre-settings__summary::-webkit-details-marker { display: none; }
.lcr-libre-settings__summary::marker { content: ''; }

.lcr-libre-settings__summary:hover {
    background: linear-gradient(180deg, #f7f1e6 0%, #fcfaf6 100%);
}

.lcr-libre-settings__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #B8945F;
    color: #fff;
    border-radius: 50%;
    flex-shrink: 0;
}

.lcr-libre-settings__label { flex: 1 1 auto; }

.lcr-libre-settings__chevron {
    font-size: 14px;
    color: #B8945F;
    transition: transform 0.18s ease;
    flex-shrink: 0;
}

.lcr-libre-settings[open] .lcr-libre-settings__chevron {
    transform: rotate(180deg);
}

.lcr-libre-settings:not([open]) .lcr-libre-settings__summary {
    border-bottom-color: transparent;
}

.lcr-libre-settings__body {
    padding: 14px 16px;
    background: #fcfaf6;
}

/* Quand la sidebar est déplacée dans l'accordéon, on neutralise le styling popup
   (overlay, position fixed, transitions de la popup) hérité de la popup d'origine. */
.lcr-libre-settings__body .lcr-poster-sidebar {
    position: static;
    transform: none;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    box-shadow: none;
    border: 0;
    background: transparent;
    overflow: visible;
}

.lcr-libre-settings__body .lcr-poster-settings-popup__head {
    display: none; /* Le titre + close de la popup ne servent pas inline */
}

.lcr-libre-settings__body .lcr-poster-sidebar__body {
    padding: 0;
    overflow: visible;
}

/* Range slider pour le nombre de variations */
.lcr-poster-sidebar__field input[type="range"] {
    width: 100%;
    margin-top: 4px;
}

.lcr-poster-sidebar__field output {
    font-weight: 700;
    margin-left: 6px;
}

/* ── Grille de variations (Task 7) ─────────────────────────────────────── */
.lcr-variation-grid {
    display: grid;
    grid-template-columns: repeat(var(--lcr-grid-cols, 2), 1fr);
    gap: 8px;
    padding: 8px;
}
.lcr-variation-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease;
}
.lcr-variation-cell:hover {
    transform: scale(1.02);
    border-color: rgba(255, 200, 0, 0.4);
}
.lcr-variation-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.lcr-variation-cell .lcr-variation-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #FFC107;
    color: #1A1A18;
    font-size: 14px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    pointer-events: none;
}
.lcr-variation-cell.is-primary {
    border-color: #FFC107;
}
.lcr-variation-cell.is-primary .lcr-variation-badge {
    display: flex;
}

/* ============================================================
   Toast notifications (lcr-poster-admin.js — showToast)
   ============================================================ */
.lcr-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1A1A18;
    color: #F4EDE3;
    padding: 12px 18px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    font-size: 13px;
    max-width: 360px;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 200ms ease, opacity 200ms ease;
    z-index: 100000;
}
.lcr-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}
.lcr-toast--error   { border-left: 3px solid #D9534F; }
.lcr-toast--success { border-left: 3px solid #5CB85C; }

