/**
 * Modern Brand Filter - Collapsible sidebar filter with checkboxes
 * Uses unified filter design system
 */

.modern-brand-filter {
    background: var(--filter-bg);
    border-radius: var(--filter-border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

/* Filter Header - Using unified gradient and animations */
.brand-filter-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: var(--filter-header-padding);
    background: var(--gradient-brands);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

/* Dot pattern overlay */
.brand-filter-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 12px 12px;
    pointer-events: none;
}

.brand-filter-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.5s ease;
    z-index: 1;
}

.brand-filter-header:hover::before {
    left: 100%;
}

.brand-filter-header:hover {
    filter: brightness(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Ensure content is above overlays */
.brand-filter-header > * {
    position: relative;
    z-index: 2;
}

.brand-filter-icon {
    font-size: 17px;
    flex-shrink: 0;
    opacity: 0.95;
}

.brand-filter-title {
    flex: 1;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.8px;
}

.brand-filter-count {
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.3);
    padding: 3px 7px;
    border-radius: 12px;
    line-height: 1;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-chevron {
    font-size: 13px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    opacity: 0.9;
}

.brand-list:not(.expanded) + .brand-filter-header .brand-chevron {
    transform: rotate(-90deg);
}

/* Brand List (Card-style buttons) - Uses unified design */
.brand-list {
    display: none;
    background: #fafbfc;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.brand-list.expanded {
    display: block;
}

.brand-list .brand-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: #fff;
    border: 1.5px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--filter-text-primary);
    font-size: 13px;
    font-weight: 500;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.brand-list .brand-item:last-child {
    margin-bottom: 0;
}

.brand-list .brand-item:hover {
    border-color: #b8c5d6;
    background: #f8fafb;
    transform: translateX(3px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.08);
}

.brand-list .brand-item.active {
    border-color: #667eea;
    background: #f0f3ff;
    color: #5568d3;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.15);
}

.brand-list .brand-item.active:hover {
    background: #e8edff;
    border-color: #5568d3;
}

/* Brand Logo */
.brand-logo {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 3px;
}

.brand-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Brand Item with Full Logo (when logo exists) */
.brand-list .brand-item-logo {
    padding: 6px 8px;
    justify-content: center;
    position: relative;
    min-height: 48px;
}

.brand-list .brand-logo-full {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4px;
}

.brand-list .brand-logo-full img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(20%);
    opacity: 0.85;
    transition: all 0.25s ease;
}

.brand-list .brand-item-logo:hover .brand-logo-full img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

.brand-list .brand-item-logo.active .brand-logo-full img {
    filter: grayscale(0%) drop-shadow(0 2px 4px rgba(102, 126, 234, 0.25));
    opacity: 1;
}

/* Check icon for logo mode (positioned absolutely in top-right) */
.brand-list .brand-check-logo {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    background: #667eea;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.3);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.brand-list .brand-item-logo.active .brand-check-logo {
    opacity: 1;
    transform: scale(1);
}

.brand-list .brand-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    color: #8d99ae;
    background: #f8f9fa;
    border-radius: 4px;
    transition: all 0.25s ease;
}

.brand-list .brand-item:hover .brand-icon {
    color: #667eea;
    background: #f0f3ff;
}

.brand-list .brand-item.active .brand-icon {
    color: #667eea;
    background: #e8edff;
}

.brand-list .brand-name {
    flex: 1;
    color: inherit;
    transition: all 0.25s ease;
}

/* Check Icon (shown only when active) */
.brand-list .brand-check {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    color: #667eea;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.25s ease;
}

.brand-list .brand-item.active .brand-check {
    opacity: 1;
    transform: scale(1);
}

/* Loading State - Uses unified design */
.brand-loading {
    padding: 20px;
    text-align: center;
    color: var(--filter-text-muted);
    font-size: 14px;
}

.brand-loading i {
    margin-right: 8px;
}

/* Scrollbar styling - Uses unified design */
.brand-list::-webkit-scrollbar {
    width: 6px;
}

.brand-list::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 3px;
}

.brand-list::-webkit-scrollbar-thumb {
    background: #cbd0dd;
    border-radius: 3px;
}

.brand-list::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

/* Responsive Adjustments - Uses unified design */
@media only screen and (max-width: 991px) {
    .brand-filter-title {
        font-size: 13px;
    }
    
    .brand-list .brand-item {
        font-size: 13px;
    }
}

@media only screen and (max-width: 767px) {
    .brand-filter-title {
        font-size: 12px;
    }

    .brand-filter-count {
        font-size: 10px;
        padding: 2px 6px;
    }

    .brand-list .brand-item {
        font-size: 12px;
    }
}

/* Animation for sliding list */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 400px;
    }
}

.brand-list.expanded {
    animation: slideDown 0.3s ease-out;
}
