/**
 * La Case à Épices — Styles Public (Front-end)
 * Développé par Tsingytech
 */

/* ===========================
   Variables
   =========================== */
:root {
    --lcae-primary: #d4a843;
    --lcae-primary-dark: #b8902f;
    --lcae-text-color: #333;
    --lcae-text-muted: #777;
    --lcae-bg: #fff;
    --lcae-radius: 8px;
    --lcae-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ===========================
   Container principal
   =========================== */
.lcae-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.lcae-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--lcae-text-color);
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.lcae-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--lcae-primary);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* ===========================
   Contenu
   =========================== */
.lcae-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.lcae-placeholder {
    text-align: center;
    color: var(--lcae-text-muted);
    font-style: italic;
    padding: 40px 20px;
    width: 100%;
}

/* ===========================
   Style : Grille
   =========================== */
.lcae-style-grid .lcae-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ===========================
   Style : Liste
   =========================== */
.lcae-style-list .lcae-content {
    flex-direction: column;
    gap: 16px;
}

/* ===========================
   Style : Carrousel
   =========================== */
.lcae-style-carousel .lcae-content {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 16px;
}

.lcae-style-carousel .lcae-content > * {
    scroll-snap-align: start;
    flex: 0 0 300px;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
    .lcae-container {
        padding: 0 16px;
        margin: 24px auto;
    }

    .lcae-title {
        font-size: 24px;
    }

    .lcae-style-grid .lcae-content {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   Accessibilité — Screen Reader Only
   =========================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===========================
   Bouton recherche (loupe inline)
   =========================== */
.lcae-search-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--lcae-text-color);
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.lcae-search-trigger:hover {
    color: var(--lcae-primary);
    background-color: rgba(212, 168, 67, 0.1);
    transform: scale(1.1);
}

.lcae-search-trigger:focus-visible {
    outline: 2px solid var(--lcae-primary);
    outline-offset: 2px;
}

.lcae-search-trigger svg {
    display: block;
}

/* ===========================
   Dialog Modal — Recherche
   =========================== */
.lcae-search-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    border: none;
    border-radius: 16px;
    background: #fff;
    padding: 40px 36px 32px;
    width: 90vw;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 999999;
}

.lcae-search-dialog[open] {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Backdrop */
.lcae-search-dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ===========================
   Bouton Fermer (×)
   =========================== */
.lcae-dialog-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    color: #555;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lcae-dialog-close:hover {
    background-color: #e0e0e0;
    color: #222;
    transform: rotate(90deg);
}

.lcae-dialog-close:focus-visible {
    outline: 2px solid var(--lcae-primary);
    outline-offset: 2px;
}

.lcae-dialog-close svg {
    display: block;
}

/* ===========================
   Eyebrow (petit texte d'accroche)
   =========================== */
.lcae-eyebrow {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--lcae-primary);
    margin: 0 0 8px 0;
}

/* ===========================
   Titre du modal
   =========================== */
#lcae-search-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--lcae-text-color, #222);
    margin: 0 0 24px 0;
    line-height: 1.3;
}

/* ===========================
   Champ de recherche
   =========================== */
#lcae-spice-search {
    display: block;
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
    color: var(--lcae-text-color, #333);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

#lcae-spice-search::placeholder {
    color: #aaa;
}

#lcae-spice-search:focus {
    border-color: var(--lcae-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(212, 168, 67, 0.15);
}

/* ===========================
   Zone de résultats
   =========================== */
.lcae-search-results {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
}

/* Scrollbar personnalisée */
.lcae-search-results::-webkit-scrollbar {
    width: 6px;
}

.lcae-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.lcae-search-results::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.lcae-search-results::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* ===========================
   Résultat individuel (lien)
   =========================== */
.lcae-search-result {
    display: block;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--lcae-text-color, #333);
    text-decoration: none;
    background: #f8f8f8;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.lcae-search-result:hover {
    background-color: rgba(212, 168, 67, 0.08);
    border-color: var(--lcae-primary);
    color: var(--lcae-primary-dark);
    transform: translateX(4px);
}

.lcae-search-result:focus-visible {
    outline: 2px solid var(--lcae-primary);
    outline-offset: 1px;
}

/* ===========================
   États : chargement / aucun résultat / erreur
   =========================== */
.lcae-loading {
    text-align: center;
    color: var(--lcae-text-muted, #999);
    font-style: italic;
    padding: 20px 0;
    font-size: 14px;
}

.lcae-no-results {
    text-align: center;
    color: var(--lcae-text-muted, #999);
    padding: 20px 0;
    font-size: 14px;
}

.lcae-error {
    color: #e74c3c;
}

/* ===========================
   Responsive — Dialog
   =========================== */
@media (max-width: 480px) {
    .lcae-search-dialog {
        width: 95vw;
        padding: 32px 20px 24px;
        border-radius: 12px;
    }

    #lcae-search-title {
        font-size: 20px;
    }

    #lcae-spice-search {
        padding: 12px 14px;
        font-size: 15px;
    }

    .lcae-search-result {
        padding: 10px 14px;
        font-size: 14px;
    }
}

/* ===========================
   Filtre Taxonomie
   =========================== */
.lcae-filter-wrapper {
    margin: 40px 0;
}

.lcae-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.lcae-filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lcae-filter-group-all {
    margin-bottom: -8px; /* Rapproche le bouton Tout des autres filtres */
}

.lcae-filter-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--lcae-text-muted);
}

.lcae-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.lcae-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--lcae-text-color);
    background: var(--lcae-bg-light, #f0f0f0);
    border: 1px solid transparent;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lcae-filter-pill:hover {
    background: rgba(212, 168, 67, 0.1);
    color: var(--lcae-primary-dark);
}

.lcae-filter-pill.active {
    background: var(--lcae-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(212, 168, 67, 0.3);
}

.lcae-pill-count {
    font-size: 12px;
    opacity: 0.7;
}

