/* ============================================================
   Catalogue : sidebar filtres + barre mobile + chips actifs
   (partagé — all-gins, all-tonics, perfect-serves)
   ============================================================ */

.gins-layout {
    display: grid;
    grid-template-columns: 272px 1fr;
    gap: 1.5rem;
    align-items: start;
    position: relative;
}

.gins-results-area {
    min-width: 0;
}

@media (max-width: 991.98px) {
    .gins-layout {
        grid-template-columns: 1fr;
    }
}

.gins-filter-sidebar {
    --gfs-surface: #fff;
    /* Bandeau titre sans dégradé (lisible, cohérent avec le corps de la carte) */
    --gfs-header-bg: #f4eef2;
    --gfs-footer-bg: #fff;
    --gfs-border: rgba(188, 112, 164, 0.18);
    --gfs-border-soft: rgba(188, 112, 164, 0.12);
    --gfs-text: var(--gin-text, #222);
    --gfs-text-muted: #6b4d5c;
    --gfs-text-soft: #8a5f72;
    --gfs-icon: var(--gin-grad-start, #bc70a4);
    --gfs-hover: rgba(188, 112, 164, 0.08);
    --gfs-shadow: 0 2px 16px rgba(188, 112, 164, 0.1), 0 1.5px 6px rgba(60, 0, 40, 0.06);

    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--gfs-surface);
    border: none;
    border-radius: 18px;
    box-shadow: var(--gfs-shadow);
    color: var(--gfs-text);
}

.gins-filter-sidebar .form-control,
.gins-filter-sidebar .form-select {
    background: #fff;
    border: 1.5px solid rgba(188, 112, 164, 0.32);
    color: var(--gfs-text);
    border-radius: 10px;
}

.gins-filter-sidebar .form-control::placeholder {
    color: #9a7a88;
    opacity: 1;
}

.gins-filter-sidebar .form-control:focus,
.gins-filter-sidebar .form-select:focus {
    border-color: var(--gin-grad-start, #bc70a4);
    box-shadow: 0 0 0 3px rgba(188, 112, 164, 0.16);
}

.gins-filter-sidebar .input-with-icon > i,
.gins-filter-sidebar .select-with-icon > i {
    color: var(--gfs-text-soft);
}

@media (max-width: 991.98px) {
    .gins-filter-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(360px, 92vw);
        max-height: 100dvh;
        border-radius: 0 18px 18px 0;
        border-left: none;
        border-top: none;
        border-bottom: none;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 6px 0 28px rgba(60, 0, 40, 0.18);
    }

    .gins-filter-sidebar--open {
        transform: translateX(0);
    }
}

.gins-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(48, 28, 40, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1040;
    animation: catalogOverlayIn 0.22s ease;
}

@keyframes catalogOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.gfs__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--gfs-border-soft);
    flex-shrink: 0;
    background: var(--gfs-header-bg);
    border-radius: 18px 18px 0 0;
}

.gfs__title {
    font-size: 0.93rem;
    font-weight: 700;
    color: #3a2633;
    text-shadow: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.02em;
}

.gfs__title > i {
    color: var(--gin-grad-start, #bc70a4);
}

.gfs__header .filters-badge {
    box-shadow: 0 0 0 1px rgba(191, 214, 65, 0.55);
}

.gfs__mobile-close {
    display: none;
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.92);
    color: var(--gin-primary, #bc70a4);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.09);
}

.gfs__mobile-close:hover {
    background: #fff;
    color: #8a3d6a;
    border-color: #fff;
    transform: scale(1.05);
}

@media (max-width: 991.98px) {
    .gfs__mobile-close {
        display: flex;
    }
}

.gfs__body {
    flex: 1 1 auto;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(188, 112, 164, 0.35) transparent;
}

.gfs__body::-webkit-scrollbar { width: 3px; }
.gfs__body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(188, 112, 164, 0.45), rgba(191, 214, 65, 0.5));
    border-radius: 2px;
}

.gfs__section {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gfs-border-soft);
}

.gfs__section-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gfs-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.45rem;
}

.gfs__accordion {
    border-bottom: 1px solid var(--gfs-border-soft);
}

.gfs__accordion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gfs-text);
    transition: background 0.15s;
    text-align: left;
    gap: 0.5rem;
}

.gfs__accordion-btn:hover {
    background: var(--gfs-hover);
}

.gfs__accordion-title {
    font-size: 0.86rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--gfs-text);
}

.gfs__accordion-title > i {
    color: var(--gfs-icon);
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.gfs__accordion-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--gfs-text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.gfs__accordion-body {
    padding: 0.25rem 1rem 0.85rem;
}

.gfs__accordion-body--ingredients {
    padding: 0.25rem 0.5rem 0.85rem;
}

.gfs__footer {
    flex-shrink: 0;
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--gfs-border-soft);
    background: var(--gfs-footer-bg);
    border-radius: 0 0 18px 18px;
}

.gfs__pending {
    font-size: 0.75rem;
    color: #8a3d6a;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.gfs__footer-actions {
    display: flex;
    gap: 0.5rem;
}

.gfs__footer-actions .btn {
    flex: 1;
    font-size: 0.82rem;
}

/* Appliquer : texte lisible sur fond sombre (footer sidebar dark) */
[data-theme="dark"] .gins-filter-sidebar .gfs__footer-actions .btn-gin-primary,
[data-theme="dark"] .gins-filter-sidebar .gfs__footer-actions .btn-gin-primary.apply-btn {
    color: #fff !important;
    --bs-btn-color: #fff;
}

[data-theme="dark"] .gins-filter-sidebar .gfs__footer-actions .btn-gin-primary:disabled,
[data-theme="dark"] .gins-filter-sidebar .gfs__footer-actions .btn-gin-primary.apply-btn:disabled {
    color: rgba(255, 255, 255, 0.88) !important;
    opacity: 0.55;
}

[data-theme="dark"] .gins-mobile-sort .btn-gin-primary,
[data-theme="dark"] .gins-mobile-sort .btn-gin-primary.apply-btn {
    color: #fff !important;
    --bs-btn-color: #fff;
}

[data-theme="dark"] .gins-filter-sidebar {
    --gfs-surface: linear-gradient(180deg, #1c1d29 0%, #181a24 100%);
    --gfs-header-bg: #16141f;
    --gfs-footer-bg: transparent;
    --gfs-border: rgba(255, 255, 255, 0.1);
    --gfs-border-soft: rgba(255, 255, 255, 0.06);
    --gfs-text: #f1ebfb;
    --gfs-text-muted: #b8a8c4;
    --gfs-text-soft: #c8b8d8;
    --gfs-icon: #e895c0;
    --gfs-hover: rgba(188, 112, 164, 0.14);
    --gfs-shadow: 0 2px 16px rgba(0, 0, 0, 0.35), 0 1.5px 6px rgba(0, 0, 0, 0.25);

    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--gfs-shadow);
}

[data-theme="dark"] .gfs__title {
    color: #f1ebfb;
    text-shadow: none;
}

[data-theme="dark"] .gfs__title > i {
    color: #e895c0;
}

[data-theme="dark"] .gfs__body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(188, 112, 164, 0.55), rgba(191, 214, 65, 0.35));
}

[data-theme="dark"] .gins-filter-sidebar .form-control,
[data-theme="dark"] .gins-filter-sidebar .form-select {
    background: #16141f;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f2edfc;
}

[data-theme="dark"] .gins-filter-sidebar .form-control::placeholder {
    color: #a59db9;
}

[data-theme="dark"] .gins-filter-sidebar .form-control:focus,
[data-theme="dark"] .gins-filter-sidebar .form-select:focus {
    border-color: rgba(188, 112, 164, 0.55);
    box-shadow: 0 0 0 3px rgba(188, 112, 164, 0.22);
}

[data-theme="dark"] .gins-filter-sidebar .input-with-icon > i,
[data-theme="dark"] .gins-filter-sidebar .select-with-icon > i {
    color: #c7bedc;
}

[data-theme="dark"] .gfs__mobile-close {
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid rgba(255, 255, 255, 0.85);
    color: var(--gin-primary, #bc70a4);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .gfs__mobile-close:hover {
    background: #fff;
    color: #8a3d6a;
    border-color: #fff;
}

[data-theme="dark"] .gfs__pending {
    color: #f0a8cc;
}

[data-theme="dark"] .gins-filter-overlay {
    background: rgba(0, 0, 0, 0.58);
}

@media (max-width: 991.98px) {
    [data-theme="dark"] .gins-filter-sidebar {
        box-shadow: 6px 0 32px rgba(0, 0, 0, 0.55);
    }
}

.gins-mobile-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.gins-mobile-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[data-theme="dark"] .gins-mobile-bar .form-control,
[data-theme="dark"] .gins-mobile-sort .form-select {
    background: #16141f;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f2edfc;
}

[data-theme="dark"] .gins-mobile-bar .input-with-icon > i,
[data-theme="dark"] .gins-mobile-sort .select-with-icon > i {
    color: #b8a8c4;
}

.filters-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: var(--gin-grad-start, #bc70a4);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(191, 214, 65, 0.55);
}

[data-theme="dark"] .filters-badge {
    box-shadow: 0 0 0 1px rgba(191, 214, 65, 0.35);
}

.gins-active-filters {
    padding: 0.65rem 0.85rem;
    background: #fff;
    border: none;
    border-radius: 18px;
    box-shadow: 0 2px 16px rgba(188, 112, 164, 0.1), 0 1.5px 6px rgba(60, 0, 40, 0.06);
}

.gins-active-filters__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.6rem;
}

.gins-active-filters__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    flex: 1 1 0;
    min-width: 0;
}

.gins-active-filters__clear-all {
    flex-shrink: 0;
    margin-left: auto;
}

.gins-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.28rem 0.35rem 0.28rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(188, 112, 164, 0.28);
    background: #fff;
    color: #2a1f26;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    box-shadow: 0 1px 2px rgba(60, 0, 40, 0.06);
}

.gins-filter-chip__icon {
    color: #bc70a4;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.gins-filter-chip__flag {
    flex-shrink: 0;
    font-size: 0.95rem;
    line-height: 1;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.gins-filter-chip__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 11rem;
}

.gins-filter-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    margin: 0 0.1rem 0 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(188, 112, 164, 0.12);
    color: #7a3d5f;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
}

.gins-filter-chip__remove:hover:not(:disabled) {
    background: rgba(188, 112, 164, 0.28);
    color: #4a1528;
}

.gins-filter-chip__remove:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.gins-filter-chip--sort .gins-filter-chip__icon {
    color: #6d7a2a;
}

[data-theme="dark"] .gins-active-filters {
    background: linear-gradient(180deg, #1c1d29 0%, #181a24 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35), 0 1.5px 6px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .gins-filter-chip {
    background: #16141f;
    border-color: rgba(255, 255, 255, 0.1);
    color: #eee8f4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .gins-filter-chip__icon {
    color: #e895c0;
}

[data-theme="dark"] .gins-filter-chip--sort .gins-filter-chip__icon {
    color: #c8d86a;
}

[data-theme="dark"] .gins-filter-chip__remove {
    background: rgba(255, 255, 255, 0.08);
    color: #e8dff5;
}

[data-theme="dark"] .gins-filter-chip__remove:hover:not(:disabled) {
    background: rgba(188, 112, 164, 0.35);
    color: #fff;
}
