
/* =====================================================
   FILTER WRAPPER
   ===================================================== */

.filter-wrapper {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

/* =====================================================
   FILTER TRIGGER BUTTON
   ===================================================== */
.filter-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-trigger-btn:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.filter-trigger-btn__icon {
    flex-shrink: 0;
}

.filter-trigger-btn__text {
    white-space: nowrap;
}

/* =====================================================
   FILTER PANEL (DROPDOWN)
   ===================================================== */
.filter-panel {
    --filter-panel-bg: var(--surface-1);
    --filter-panel-border: var(--border-light);
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 1.5rem;
    width: 100%;
    background: var(--filter-panel-bg);
    border: 1px solid var(--filter-panel-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-panel__container {
    display: flex;
    gap: 0.75rem;
}

/* =====================================================
   SIDEBAR (список фильтров)
   ===================================================== */

.filter-panel__sidebar {
    width: 200px;
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: #f6f6f6;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.75rem;
}

.filter-item:last-child {
    border-bottom: none;
}

.filter-item:hover {
    background: #ffffff;
}

.filter-item.is-active {
    background: #ffffff;
}

.filter-item__icon {
    flex-shrink: 0;
    color: #666666;
}

.filter-item.is-active .filter-item__icon {
    color: #2196F3;
}

.filter-item__text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
}

.filter-item__badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #2196F3;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
}

.filter-item.has-value .filter-item__badge {
    display: flex;
}

.filter-item__chevron {
    flex-shrink: 0;
    color: var(--text-muted-300);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.filter-item.is-active .filter-item__chevron {
    opacity: 1;
    color: #2196F3;
}

/* =====================================================
   CONTENT (контент фильтров)
   ===================================================== */

.filter-panel__content {
    flex: 1;
    min-height: 200px;
}

.filter-content {
    display: none;
    animation: fadeIn 0.2s ease;
}

.filter-content.is-active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-content__title {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-content__group {
    margin-bottom: 16px;
}

.filter-content__input {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333333;
    transition: all 0.2s ease;
}

.filter-content__input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.filter-content__input::placeholder {
    color: var(--text-muted-300);
}

.filter-content__input--search {
    padding-left: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23999999' d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 20px;
}

.filter-content__hint {
    font-size: 13px;
    color: var(--text-muted-300);
    margin-top: 8px;
}

/* =====================================================
   FOOTER
   ===================================================== */
.filter-panel__footer {
    display: flex;
    gap: 10px;
}
/*
.filter-panel__btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-panel__btn--secondary {
    background: #f5f5f5;
    color: #666666;
}

.filter-panel__btn--secondary:hover {
    background: #e8e8e8;
    color: #333333;
}

.filter-panel__btn--primary {
    background: #2196F3;
    color: #ffffff;
}

.filter-panel__btn--primary:hover {
    background: #1976D2;
}
*/
/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .filter-panel {
        width: 500px;
    }

    .filter-panel__sidebar {
        width: 160px;
    }

    .filter-item {
        padding: 12px 14px;
    }

    .filter-item__text {
        font-size: 13px;
    }
}

@media (max-width: 560px) {
    .filter-panel {
        width: calc(100vw - 32px);
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
    }

    .filter-panel.is-open {
        transform: translateX(-50%) translateY(0);
    }

    .filter-panel__sidebar {
        width: 140px;
    }

    .filter-panel__content {
        padding: 16px;
    }
}