/* ================================================================
   LBI Smart Filters — Stylesheet v1.5.0
   Style V1 LDLC : dropdown overlay · prix badges LDLC · actions colonne
   ================================================================ */

:root {
    --lbi-navy:   #141f35;
    --lbi-cyan:   #00aed7;
    --lbi-cyan-d: #009bbf;
    --lbi-bg:     #f4f6f9;
    --lbi-card:   #ffffff;
    --lbi-border: #e2e6ed;
    --lbi-text:   #2c3545;
    --lbi-muted:  #6b7280;
}

/* ── XStore widget-has-toggle : désactive le collapse ────────── */
/* XStore injecte widget-has-toggle sur le widget et rend h4.widget-title
   cliquable via ::after (icône +/−). On neutralise ça sur notre widget. */

.lbi-smart-filters-widget.widget-has-toggle > .widget-title {
    cursor: default !important;
    pointer-events: none !important;
    padding-inline-end: 0 !important;
}
.lbi-smart-filters-widget.widget-has-toggle > .widget-title::after {
    display: none !important;
}
/* Empêche le widget-toggled de masquer le contenu */
.lbi-smart-filters-widget.widget-toggled > .lbi-sf-wrapper,
.lbi-smart-filters-widget.widget-has-toggle.widget-toggled > div:not(.widget-title) {
    opacity: 1 !important;
    max-height: none !important;
    overflow: visible !important;
}

/* ── Wrapper ──────────────────────────────────────────────────── */

.lbi-smart-filters-widget {
    font-family: var(--e-global-typography-secondary-font-family, 'Inter', sans-serif);
    font-size: var(--e-global-typography-secondary-font-size, 0.875rem);
    font-weight: var(--e-global-typography-secondary-font-weight, 400);
    color: var(--lbi-text);
}

.lbi-sf-wrapper {
    background: var(--lbi-card);
    border: 1px solid var(--lbi-border);
    border-radius: 8px;
    padding: 8px 0;
}

/* ── Form ─────────────────────────────────────────────────────── */

.lbi-sf-form {
    margin: 0;
    padding: 0;
}

/* ── Barre de recherche ───────────────────────────────────────── */

.lbi-sf-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--lbi-border);
}

.lbi-sf-search-input {
    flex: 1;
    border: 1px solid var(--lbi-border);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--lbi-text);
    background: var(--lbi-card);
    outline: none;
    transition-property: border-color;
    transition-duration: .2s;
    transition-timing-function: ease;
    -webkit-appearance: none;
    appearance: none;
}

.lbi-sf-search-input:focus { border-color: var(--lbi-cyan); }
.lbi-sf-search-input::placeholder { color: var(--lbi-muted); }

.lbi-sf-search-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lbi-navy);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    transition-property: background-color;
    transition-duration: .2s;
    transition-timing-function: ease;
}

.lbi-sf-search-btn:hover { background: var(--lbi-cyan); }

/* ── Section ──────────────────────────────────────────────────── */

.lbi-sf-section { padding: 12px 16px; }
.lbi-sf-section + .lbi-sf-section { border-top: 1px solid var(--lbi-border); }

/* ── Filter header : label + badge ───────────────────────────── */

.lbi-sf-filter-hd {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.lbi-sf-filter-lbl {
    flex: 1;
    font-family: var(--e-global-typography-secondary-font-family, inherit);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--lbi-navy);
}

/* ── Badge filtre actif ───────────────────────────────────────── */

.lbi-sf-active-badge {
    background: var(--lbi-cyan);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* ── Wrapper trigger + panel overlay ─────────────────────────── */

.lbi-sf-drop-wrap {
    position: relative;
}

/* ── Trigger (section-head) ───────────────────────────────────── */

.lbi-sf-section-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--lbi-border);
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    background: var(--lbi-card);
    transition-property: border-color;
    transition-duration: .2s;
    transition-timing-function: ease;
}

.lbi-sf-section-head:hover { border-color: var(--lbi-cyan-d); }

/* Ouvert : fusionne avec le panel (bordure basse transparente) */
.lbi-sf-section.lbi-sf-open .lbi-sf-section-head {
    border-bottom-color: transparent;
    border-radius: 4px 4px 0 0;
}

/* ── Texte du trigger ─────────────────────────────────────────── */

.lbi-sf-drop-text {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--lbi-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lbi-sf-drop-text.lbi-sf-selected {
    color: var(--lbi-navy);
    font-weight: 600;
}

/* ── Chevron ──────────────────────────────────────────────────── */

.lbi-sf-chevron {
    display: inline-block !important;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--lbi-muted);
    border-bottom: 2px solid var(--lbi-muted);
    transform: rotate(45deg);
    transition-property: transform;
    transition-duration: .25s;
    transition-timing-function: ease;
    flex-shrink: 0;
    margin-top: -3px;
}

.lbi-sf-section.lbi-sf-open .lbi-sf-chevron {
    transform: rotate(-135deg);
    margin-top: 3px;
}

/* ── Panel dropdown — position:fixed via JS (portal) ─────────── */
/* position + top + left + width + z-index injectés par openDropdown() */

.lbi-sf-drop-wrap .lbi-sf-section-body {
    display: none;
    background: var(--lbi-card);
    border: 1px solid var(--lbi-border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 6px 16px rgba(20,31,53,.14);
    overflow: hidden;
}

.lbi-sf-section.lbi-sf-open .lbi-sf-drop-wrap .lbi-sf-section-body {
    display: block;
}

/* ── Terms list ───────────────────────────────────────────────── */

.lbi-sf-terms {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lbi-sf-term {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    cursor: pointer;
    transition-property: background-color;
    transition-duration: .15s;
    transition-timing-function: ease;
}

.lbi-sf-term:hover { background: var(--lbi-bg); }

.lbi-sf-checkbox {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    border: 2px solid var(--lbi-border);
    border-radius: 3px;
    flex-shrink: 0;
    background: #fff;
    position: relative;
    box-sizing: border-box;
    transition-property: border-color, background-color;
    transition-duration: .15s;
    transition-timing-function: ease;
}

.lbi-sf-term.lbi-sf-checked .lbi-sf-checkbox {
    background: var(--lbi-cyan);
    border-color: var(--lbi-cyan);
}

.lbi-sf-term.lbi-sf-checked .lbi-sf-checkbox::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.lbi-sf-term-name {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--lbi-text);
    line-height: 1.3;
}

.lbi-sf-term.lbi-sf-checked .lbi-sf-term-name {
    color: var(--lbi-navy);
    font-weight: 600;
}

.lbi-sf-count {
    font-size: 0.75rem;
    color: var(--lbi-muted);
    flex-shrink: 0;
}

/* ── Drop scroll + footer ─────────────────────────────────────── */

.lbi-sf-drop-scroll {
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--lbi-border) transparent;
}

.lbi-sf-drop-scroll::-webkit-scrollbar { width: 5px; }
.lbi-sf-drop-scroll::-webkit-scrollbar-track { background: transparent; }
.lbi-sf-drop-scroll::-webkit-scrollbar-thumb { background: var(--lbi-border); border-radius: 3px; }

.lbi-sf-drop-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 8px;
    border-top: 1px solid var(--lbi-border);
    background: var(--lbi-bg);
}

.lbi-sf-drop-footer .lbi-sf-term-all { flex: 1; padding: 6px 4px; }

.lbi-sf-drop-submit {
    flex-shrink: 0;
    background: var(--lbi-navy);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 7px 14px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: .06em;
    cursor: pointer;
    transition-property: background-color;
    transition-duration: .2s;
    transition-timing-function: ease;
}

.lbi-sf-drop-submit:hover { background: var(--lbi-cyan); }

/* ── Prix — toujours visible, style LDLC ─────────────────────── */

.lbi-sf-section-prix { background: var(--lbi-bg); }

.lbi-sf-price-currency {
    font-size: 0.75rem;
    color: var(--lbi-muted);
    font-weight: 500;
    margin-left: auto;
}

.lbi-sf-price-body { padding: 4px 0 4px; }

.lbi-sf-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lbi-sf-price-badge {
    background: var(--lbi-navy);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    min-width: 52px;
    text-align: center;
    flex-shrink: 0;
    user-select: none;
}

/* Slider dans la price-row : prend tout l'espace restant */
.lbi-sf-price-row .lbi-sf-slider-wrap {
    flex: 1;
    margin: 0;
    cursor: pointer;
}

/* ── Slider (commun) ──────────────────────────────────────────── */

.lbi-sf-slider-wrap {
    position: relative;
    height: 20px;
    margin: 0 4px;
}

.lbi-sf-slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--lbi-border);
    border-radius: 2px;
    transform: translateY(-50%);
}

.lbi-sf-slider-range {
    position: absolute;
    top: 50%;
    height: 4px;
    background: var(--lbi-cyan);
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
}

.lbi-sf-range {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 4px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    margin: 0;
}

.lbi-sf-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--lbi-navy);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    cursor: pointer;
    pointer-events: all;
    transition-property: background-color, transform;
    transition-duration: .15s;
    transition-timing-function: ease;
}

.lbi-sf-range::-webkit-slider-thumb:hover {
    background: var(--lbi-cyan);
    transform: scale(1.15);
}

.lbi-sf-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--lbi-navy);
    border: 2px solid #fff;
    cursor: pointer;
    pointer-events: all;
}

/* ── Filtres avancés ──────────────────────────────────────────── */

.lbi-sf-advanced { display: none; }
.lbi-sf-advanced.lbi-sf-adv-open { display: block; }

@keyframes lbi-adv-glow {
    0%,  100% { box-shadow: 0 0 0 0 rgba(0,174,215,0);    border-color: var(--lbi-cyan); }
    50%        { box-shadow: 0 0 0 5px rgba(0,174,215,.18); border-color: var(--lbi-cyan); }
}

@keyframes lbi-plus-bounce {
    0%, 80%, 100% { transform: rotate(0deg) scale(1); }
    40%            { transform: rotate(20deg) scale(1.2); }
}

.lbi-sf-toggle-adv {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: calc(100% - 32px);
    margin: 10px 16px;
    padding: 9px 16px;
    background: transparent;
    border: 1.5px solid var(--lbi-cyan);
    border-radius: 20px;
    color: var(--lbi-cyan);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer;
    animation: lbi-adv-glow 2.5s ease-in-out infinite;
}

.lbi-sf-adv-icon {
    display: inline-block;
    animation: lbi-plus-bounce 3s ease-in-out 0.5s infinite;
    font-style: normal;
}

.lbi-sf-toggle-adv:hover,
.lbi-sf-toggle-adv.lbi-sf-adv-open {
    background: var(--lbi-cyan);
    color: #fff;
    animation: none;
}

.lbi-sf-toggle-adv:hover .lbi-sf-adv-icon,
.lbi-sf-toggle-adv.lbi-sf-adv-open .lbi-sf-adv-icon {
    animation: none;
}

/* ── Actions — empilées verticalement ────────────────────────── */

.lbi-sf-actions {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--lbi-border);
    background: var(--lbi-bg);
}

.lbi-sf-submit {
    width: 100%;
    background: var(--lbi-navy);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 11px 16px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-align: center;
    cursor: pointer;
    transition-property: background-color;
    transition-duration: .2s;
    transition-timing-function: ease;
}

.lbi-sf-submit:hover { background: var(--lbi-cyan); }

.lbi-sf-reset {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--lbi-muted);
    text-decoration: none;
    transition-property: color;
    transition-duration: .15s;
    transition-timing-function: ease;
}

.lbi-sf-reset:hover { color: var(--lbi-cyan); }

/* ── Barre filtres actifs ─────────────────────────────────────── */

.lbi-sf-active-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--lbi-border);
}

.lbi-sf-active-count {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--lbi-navy);
    white-space: nowrap;
}

.lbi-sf-active-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.lbi-sf-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 12px;
    background: #e8f6fb;
    border: 1px solid var(--lbi-cyan);
    border-radius: 20px;
    font-size: 0.8125rem;
    color: var(--lbi-navy);
    text-decoration: none;
    transition-property: background-color, border-color, color;
    transition-duration: .15s;
    transition-timing-function: ease;
}

.lbi-sf-active-chip:hover { background: var(--lbi-cyan); color: #fff; }

.lbi-sf-chip-label { font-weight: 500; }

.lbi-sf-chip-x {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    opacity: .7;
}

.lbi-sf-active-chip:hover .lbi-sf-chip-x { opacity: 1; }

.lbi-sf-chip-reset {
    background: transparent;
    border-color: var(--lbi-border);
    color: var(--lbi-muted);
    font-size: 0.75rem;
}

.lbi-sf-chip-reset:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #dc2626;
}

@media (max-width: 640px) {
    .lbi-sf-active-bar { flex-direction: column; align-items: flex-start; }
}

/* ── Masque le "Voir plus" injecté par XStore ─────────────────── */

.lbi-smart-filters-widget .etheme_sidebar-widget-list-expand {
    display: none !important;
}

/* ── Titre widget ─────────────────────────────────────────────── */

.lbi-smart-filters-widget .widget-title,
.lbi-smart-filters-widget h2,
.lbi-smart-filters-widget h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--lbi-navy);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--lbi-cyan);
}
