/* ==================== DRAWER (ВЫДВИЖНАЯ ПАНЕЛЬ) ==================== */
.filter-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.filter-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.filter-drawer-content {
    position: absolute;
    top: 16px;
    bottom: 16px;
    right: -400px;
    height: calc(100% - 32px);
    width: 360px;
    border-radius: 24px;
    background: var(--white, #ffffff);
    box-shadow: -5px 5px 30px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-drawer-overlay.is-open .filter-drawer-content {
    right: 16px;
}

/* Шапка Drawer */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.drawer-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.btn-close-drawer {
    border: none;
    background: transparent;
    font-size: 1.4rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-close-drawer:hover {
    background: var(--bg-content, #f8fafc);
    color: #0f172a;
    transform: rotate(90deg);
}

/* Тело Drawer */
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.drawer-body::-webkit-scrollbar {
    width: 5px;
}
.drawer-body::-webkit-scrollbar-track {
    background: transparent;
}
.drawer-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Подвал Drawer */
.drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    gap: 12px;
    background: var(--white, #ffffff);
}

.btn-drawer-apply,
.btn-drawer-reset {
    height: 38px;
    padding: 0 16px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-drawer-apply {
    flex: 1.5;
    background: var(--white, #ffffff);
    color: var(--primary-light, #2563eb);
    box-shadow: 0 0 3px 1px var(--primary, #2563eb);
}

.btn-drawer-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.15), 0 0 3px 1px var(--primary, #2563eb);
}

.btn-drawer-apply:active {
    transform: translateY(0);
}

.btn-drawer-reset {
    flex: 1;
    color: #64748b;
}

.btn-drawer-reset:hover {
    color: #334155;
    background: var(--bg-content, #f8fafc);
}

/* Кнопка открытия Drawer */
.btn-filter-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 37px;
    background: var(--white);
    color: var(--primary-light);
    border: 1px solid rgba(37, 99, 235, 0.08);
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 0 3px 1px var(--primary, #2563eb);
}

.btn-filter-trigger:hover {
    background: var(--bg-content, #f8fafc);
    transform: translateY(-2px);
}

.btn-filter-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group-title {
    font-size: 0.9rem;
    font-weight: 550;
    color: #0f172a;
    margin-bottom: 12px;
}

/* ==================== ПОЛЯ ФИЛЬТРОВ ==================== */

.filter-drawer-content .form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    border-radius: 12px;
    font-family: inherit;
    color: #1e293b;
    background-color: #ffffff;
    outline: none;
    cursor: text;
    box-sizing: border-box;

    box-shadow:
            0 0 8px 3px rgba(59, 130, 246, 0),
            0 4px 20px rgba(59, 130, 246, 0);

    transition:
            border-color 0.45s cubic-bezier(0.25, 0.8, 0.25, 1),
            box-shadow 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.filter-drawer-content .form-input::placeholder {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 400;
    opacity: 0.8;
}

.filter-drawer-content .form-input:focus {
    border-color: rgba(59, 130, 246, 0.5);
    background-color: #ffffff;

    box-shadow:
            0 0 8px 2px rgba(59, 130, 246, 0.3),
            0 4px 15px rgba(59, 130, 246, 0.1);
}


/* ==================== ЗАРПЛАТА ==================== */

.salary-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.salary-input-group .form-input {
    flex: 1;
    min-width: 0;
}

.currency-select-inline {
    width: 100px;
    flex-shrink: 0;
    padding: 14px 28px 14px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background-color: #f8fafc;
    font-family: inherit;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    text-align: left;
    font-size: 0.85rem;
    outline: none;

    box-sizing: border-box;

    transition:
            background-color 0.2s ease,
            border-color 0.2s ease;

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 12px;
}

.currency-select-inline:hover {
    background-color: #f1f5f9;
}

.currency-select-inline:focus {
    border-color: rgba(59, 130, 246, 0.5);
    background-color: #ffffff;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 400;
    font-size: 0.84rem;
    user-select: none;
    max-width: 100%;
}

.filter-checkbox-label span {
    color: var(--text-gray);
    transition: color 0.30s ease;
}

.filter-checkbox-label:hover span {
    color: #0f172a;
}

.filter-checkbox-label input[type="checkbox"]:checked + span {
    color: var(--primary-light);
    font-weight: 550;
}

.filter-checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary-light);
}

.truncate-text {
    white-space: nowrap; /* Запрещаем перенос строки */
    overflow: hidden; /* Прячем всё, что не поместилось */
    text-overflow: ellipsis; /* Добавляем три точки в конец */
    flex: 1; /* Занимает всё доступное пространство */
}

@media (max-width: 576px) {
    .filter-drawer-content {
        height: calc(100dvh - 80px);
        max-height: calc(100dvh - 80px);
        width: calc(100% - 32px);
        top: auto;
        left: 16px;
        right: 16px;
        bottom: -100%;
        border-radius: 24px;
        transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .filter-drawer-overlay.is-open .filter-drawer-content {
        bottom: 40px;
    }

    .drawer-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }


    /* =========================
       Кнопка фильтров
       ========================= */

    .btn-filter-trigger {
        position: fixed;
        right: 16px;
        bottom: 24px;

        width: 48px;
        height: 48px;

        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-radius: 12px;
        background: var(--white);
        color: var(--primary-light);
        border: 1px solid rgba(37, 99, 235, 0.08);
        box-shadow: 0 0 3px 1px var(--primary, #2563eb);
        z-index: 900;
        transform: none;
    }

    .btn-filter-trigger span {
        display: none;
    }

    .btn-filter-trigger .btn-filter-icon {
        width: 22px;
        height: 22px;
        filter: none;
    }

    .btn-filter-trigger:hover {
        transform: none;
        background: var(--primary-light);
    }
}