/* ===================================
   Products Filters & Sorting
   =================================== */

/* Filter Section */
.filter-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.filter-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--bg-light);
}

.filter-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.filter-header h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Filter Pills */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 10px 18px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-gray);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.filter-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 0;
}

.filter-pill span,
.filter-pill svg {
    position: relative;
    z-index: 1;
}

.filter-pill svg {
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.filter-pill:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-pill:hover svg {
    transform: scale(1.1);
}

.filter-pill.active {
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.filter-pill.active::before {
    opacity: 1;
}

.filter-pill.active svg {
    stroke: white;
}

/* Category Header Links - Make H3 Headers Clickable */
.category-header-link {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
}

.category-header-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* Only apply inherit to category-column, not mega-menu */
.category-column h3 a.category-header-link {
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
}

/* Catalog Toolbar - Modern Card Design */
.catalog-toolbar {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
}

.product-count {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-gray);
    background: var(--bg-light);
    border-radius: var(--radius-md);
    white-space: nowrap;
    line-height: 1.5;
    height: 40px; /* Match sort button container height */
}

.product-count span {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.125rem;
}

.catalog-toolbar .spacer {
    flex: 1;
}

/* Sort Buttons */
.sort-buttons {
    display: flex;
    gap: 8px;
    background: var(--bg-light);
    padding: 4px;
    border-radius: var(--radius-md);
}

.sort-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-gray);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.5;
}

.sort-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sort-btn:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.8);
}

.sort-btn.active {
    color: var(--primary-color);
    background: white;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .filter-section {
        padding: var(--spacing-md);
    }

    .filter-header h2 {
        font-size: 1.125rem;
    }

    .filter-pills {
        gap: var(--spacing-xs);
    }

    .filter-pill {
        font-size: 0.875rem;
        padding: 8px 14px;
    }

    .filter-pill svg {
        width: 16px;
        height: 16px;
    }

    .catalog-toolbar {
        flex-direction: column;
        gap: var(--spacing-sm);
        padding: var(--spacing-md);
    }

    .product-count {
        text-align: center;
    }

    .sort-buttons {
        width: 100%;
    }

    .sort-btn {
        flex: 1;
        padding: 10px 12px;
        font-size: 0.8125rem;
    }
}
