/* Filter INDEX */
.filter-index-wrap {
    position: relative;
}

.filter-index-mobile-trigger {
    display: none;
    width: 100%;
    margin-bottom: 16px;
    padding: 16px 24px;
    font-family: Mulish, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    background: #26b6ea;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.filter-index-mobile-trigger:hover {
    background: #1c83a9;
    box-shadow: 0 4px 12px rgba(235, 28, 36, 0.3);
}

.filter-index-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.filter-index-wrap.filter-index-panel-open .filter-index-backdrop {
    display: block;
    opacity: 1;
}

.filter-gift-selection {
    background: linear-gradient(91.01deg, #c7edfd 3.02%, #c7edfd 43.75%, #ebf9ff);
    border-radius: 10px;
    box-shadow: 0 0 20px #42424233;
    margin-top: -15px;
    margin-bottom: 40px;
    padding: 30px;
    position: relative;
    z-index: 100;
}

.filter-gift-selection .filter-caption {
    margin-bottom: 30px;
    font-weight: 500;
    font-family: Mulish, sans-serif;
    font-size: 25px;
    color: #1a1a1a;
}

.filter-gift-selection .filter-mobile-title {
    display: none;
}

.filter-close-filter {
    height: 20px;
    position: absolute;
    right: 20px;
    top: 20px;
    width: 20px;
}

/* Form Layout */
.filter-gift-selection-form {
    display: flex;
    align-items: stretch;
    gap: 15px;
}

/* Collapse / Select Groups */
.filter-form-group {
    flex: 1;
    min-width: 0;
    position: relative;
}

.filter-collapse-toggle {
    width: 100%;
    height: 56px;
    padding: 0 45px 0 20px;
    background: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-family: Mulish, sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #1a1a1a;
    text-align: left;
    transition: box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.filter-collapse-toggle:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-collapse-toggle span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dropdown Arrow */
.filter-collapse-toggle .filter-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    pointer-events: none;
}

.filter-collapse-toggle .filter-toggle::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: rotate(45deg);
    top: 0;
    left: 2px;
    transition: transform 0.2s ease;
}

.filter-collapse:not(.filter-collapsed) .filter-collapse-toggle .filter-toggle::before {
    transform: rotate(-135deg);
    top: 4px;
}

/* Dropdown Content */
.filter-collapse-content {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.filter-collapse:not(.filter-collapsed) .filter-collapse-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    max-height: none !important;
}

.filter-collapse-inner {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

/* Form Select Options */
.filter-form-select {
    width: 100%;
}

.filter-form-select-toggle {
    display: none;
}

.filter-form-select-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-form-select-options.filter-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.filter-form-select-option {
    padding: 0;
}

/* Checkboxes and Radio Buttons */
.filter-form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.filter-form-check:hover {
    background-color: #f5f5f5;
}

.filter-form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #26b6ea;
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid #ccc;
    border-radius: 3px;
    background: #fff;
    flex-shrink: 0;
}

/* checkbox: белая галочка при выборе */
.filter-form-check-input[type="checkbox"]:checked {
    background: #26b6ea url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 5l3 3 7-7'/%3E%3C/svg%3E") center/10px 10px no-repeat;
    border-color: #26b6ea;
}

/* radio: белая точка при выборе */
.filter-form-check-input[type="radio"] {
    border-radius: 50%;
}

.filter-form-check-input[type="radio"]:checked {
    background: radial-gradient(circle at center, #fff 0, #fff 4px, #26b6ea 5px);
    border-color: #26b6ea;
}

.filter-form-check-label {
    font-family: Mulish, sans-serif;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

/* Price Range Slider */
.filter-form-range {
    padding: 10px 0;
}

.filter-form-range-inputs {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.filter-form-range-input {
    flex: 1;
}

.filter-form-range-input input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: Mulish, sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.filter-form-range-input input:focus {
    border-color: #26b6ea;
}

/* jQuery UI Slider (price-range) внутри фильтра */
.filter-form-range #price-range.filter-price-range-slider,
.filter-form-range .ui-slider {
    height: 6px;
    background: #e0e0e0;
    border: none;
    border-radius: 3px;
    margin: 20px 10px;
}

.filter-form-range .ui-slider-range {
    background: #26b6ea;
    border-radius: 3px;
}

.filter-form-range .ui-slider-handle {
    width: 20px;
    height: 20px;
    background: #fff;
    border: 3px solid #26b6ea;
    border-radius: 50%;
    cursor: grab;
    top: -7px;
    margin-left: -10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.filter-form-range .ui-slider-handle:focus {
    outline: none;
}

/* Submit Button */
.filter-form-btn {
    flex-shrink: 0;
}

.filter-btn {
    font-family: Mulish, sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0 40px;
    height: 56px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.filter-btn-primary {
    background: #EB1C24;
    color: #fff;
}

.filter-btn-primary:hover {
    background: #d41920;
}

.filter-btn-primary:active {
    transform: translateY(0);
}

.filter-w-100 {
    width: auto;
}

/* Responsive */
@media (max-width: 1100px) {
    .filter-gift-selection-form {
        flex-wrap: wrap;
    }
    
    .filter-form-group {
        flex: 1 1 calc(50% - 10px);
        min-width: 200px;
    }
    
    .filter-form-btn {
        flex: 1 1 100%;
        margin-top: 10px;
    }
    
    .filter-form-btn .filter-btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .filter-gift-selection {
        padding: 20px;
    }
    
    .filter-gift-selection .filter-caption {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    
    .filter-collapse-toggle {
        height: 50px;
    }
    
    .filter-btn {
        height: 50px;
    }
}

/* Filter INDEX: мобильная адаптация ≤430px — кнопка «ПОДОБРАТЬ ПОДАРОК», полноэкранная панель, аккордеон */
@media (max-width: 431px) {
    .filter-index-mobile-trigger {
        display: block;
    }

    .filter-index-wrap .filter-gift-selection {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        max-width: none;
        height: 100%;
        margin: 0;
        z-index: 201;
        border-radius: 0;
        box-shadow: none;
        background: #fff;
        transform: translate3d(-100%, 0, 0);
        transition: transform 0.3s ease;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .filter-index-wrap.filter-index-panel-open .filter-gift-selection {
        transform: translate3d(0, 0, 0);
    }

    .filter-index-wrap .filter-gift-selection .filter-caption {
        display: none;
    }

    .filter-index-wrap .filter-gift-selection .filter-mobile-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        padding: 16px 20px;
        margin: 0;
        font-size: 22px;
        background: #fff;
        border-radius: 0;
        border-bottom: 1px solid #eee;
    }

    .filter-index-wrap .filter-gift-selection .filter-gift-selection-form {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        flex: 1;
        min-height: 0;
        gap: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .filter-index-wrap .filter-gift-selection .filter-form-group {
        flex: none;
        min-width: 0;
        position: relative;
        border-bottom: 1px solid #eee;
    }

    /* Аккордеон: контент под кнопкой, раскрывается по клику */
    .filter-index-wrap .filter-gift-selection .filter-collapse-toggle {
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        border: none;
        border-bottom: none;
        justify-content: space-between;
        padding-right: 40px;
        font-size: 18px;
    }

    .filter-index-wrap .filter-gift-selection .filter-collapse-content {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        background: #fff;
        border-radius: 0;
        box-shadow: none;
        overflow: hidden;
        max-height: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height 0.25s ease;
        border: none;
    }

    .filter-index-wrap .filter-gift-selection .filter-collapse:not(.filter-collapsed) .filter-collapse-content {
        max-height: none;
    }

    .filter-index-wrap .filter-gift-selection .filter-collapse-inner {
        padding: 12px 0 16px;
        max-height: none;
    }

    .filter-index-wrap .filter-gift-selection .filter-form-select-options.filter-cols-2 {
        grid-template-columns: 1fr;
    }

    .filter-index-wrap .filter-gift-selection .filter-form-btn {
        flex: none;
        width: 100%;
        margin-top: 20px;
        padding-top: 16px;
        border-bottom: none;
    }

    .filter-index-wrap .filter-gift-selection .filter-form-btn .filter-btn {
        width: 100%;
    }
}