/* Advanced Search Styling */
.advanced-search-page {
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px
}

.search-header {
    text-align: center;
    margin-bottom: 50px
}

.search-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 700
}

.search-header p {
    font-size: 1.1rem;
    color: #666
}

.category-selector {
    margin-bottom: 50px
}

.category-selector h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 25px;
    font-weight: 600
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px
}

.category-card {
    background: #fff;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all .3s ease;
    position: relative
}

.category-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, .2)
}

.category-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(102, 126, 234, .3)
}

.category-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 12px
}

.category-label {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 5px
}

.category-desc {
    display: block;
    font-size: .85rem;
    opacity: .8;
    margin-top: 5px
}

.category-card.active .category-desc {
    opacity: .95
}

.select-category-prompt {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 15px;
    margin-top: 40px
}

.select-category-prompt p {
    font-size: 1.3rem;
    color: #666
}

.specification-filters {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, .08);
    margin-top: 40px
}

.specification-filters h3 {
    font-size: 1.6rem;
    color: #333;
    margin-bottom: 30px;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 30px 0
}

.filter-group {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05)
}

.filter-group label {
    display: block;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    font-size: .95rem
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 10px
}

.checkbox-group::-webkit-scrollbar {
    width: 6px
}

.checkbox-group::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px
}

.checkbox-group::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s
}

.checkbox-label:hover {
    background: #e3f2fd
}

.checkbox-label input[type=checkbox] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea
}

.checkbox-label span {
    font-size: .95rem;
    color: #333
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 26px;
    transition: background .3s
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: transform .3s
}

.toggle-container input[type=checkbox] {
    display: none
}

.toggle-container input[type=checkbox]:checked+.toggle-slider {
    background: #667eea
}

.toggle-container input[type=checkbox]:checked+.toggle-slider::before {
    transform: translateX(24px)
}

.toggle-label-text {
    font-size: .95rem;
    color: #333;
    font-weight: 600
}

.color-picker-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px
}

.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s
}

.color-option:hover {
    border-color: #667eea;
    transform: translateY(-2px)
}

.color-option input[type=checkbox] {
    display: none
}

.color-option input[type=checkbox]:checked+.color-swatch {
    box-shadow: 0 0 0 3px #667eea;
    transform: scale(1.1)
}

.color-swatch {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 3px solid #ddd;
    transition: all .2s
}

.color-name {
    font-size: .85rem;
    color: #555;
    font-weight: 600;
    text-align: center
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px
}

.price-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all .3s
}

.price-input:focus {
    outline: 0;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .1)
}

.price-inputs span {
    color: #999;
    font-weight: 600
}

.rating-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all .3s;
    background: #fff
}

.rating-select:focus {
    outline: 0;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .1)
}

.form-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0
}

.btn-primary,
.btn-secondary {
    padding: 16px 40px;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all .3s;
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 5px 20px rgba(102, 126, 234, .3)
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, .4)
}

.btn-secondary {
    background: #fff;
    color: #666;
    border: 2px solid #ddd
}

.btn-secondary:hover {
    border-color: #999;
    color: #333;
    transform: translateY(-2px)
}

.active-filters {
    margin-top: 25px;
    padding: 20px;
    background: #e3f2fd;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    font-size: .95rem;
    color: #333
}

.active-filters strong {
    color: #667eea;
    margin-right: 10px
}

@media (max-width:768px) {
    .advanced-search-page {
        padding: 15px;
        margin: 20px auto
    }

    .search-header h1 {
        font-size: 1.8rem
    }

    .search-header p {
        font-size: 1rem
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px
    }

    .category-card {
        padding: 20px 10px
    }

    .category-icon {
        font-size: 2.5rem
    }

    .category-label {
        font-size: .9rem
    }

    .category-desc {
        font-size: .75rem
    }

    .specification-filters {
        padding: 25px 20px
    }

    .specification-filters h3 {
        font-size: 1.3rem
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 20px
    }

    .form-actions {
        flex-direction: column
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center
    }

    .color-picker-group {
        grid-template-columns: repeat(3, 1fr)
    }
}

@media (max-width:480px) {
    .category-grid {
        grid-template-columns: 1fr
    }

    .checkbox-group {
        max-height: 200px
    }
}