/**
 * WC Smart Filters - Premium Styles
 */

:root {
    --wcsf-primary: #283F80;
    --wcsf-text: #333333;
    --wcsf-text-light: #777777;
    --wcsf-bg-hover: #f5f7fa;
    --wcsf-border: #e1e4e8;
    --wcsf-spacing: 6px;
}

.wc-smart-filters {
    font-family: inherit;
    font-size: 15px;
}

.wc-smart-filters .filter-block {
    margin-bottom: 5px;
    /* Reducción adicional de 8px */
    border-bottom: 1px solid var(--wcsf-border);
    padding-bottom: 4px;
    /* Reducción adicional de 6px */
}

.wc-smart-filters .filter-block:last-child {
    border-bottom: none;
}

.wc-smart-filters .filter-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 5px;
}

.wc-smart-filters .filter-block h4 {
    font-size: 15px;
    /* Reducido de 16px */
    font-weight: 700;
    color: var(--wcsf-primary);
    margin: 0;
    letter-spacing: -0.01em;
    flex-grow: 1;
}

/* Toggle Icon */
.filter-toggle {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.toggle-icon {
    width: 10px;
    height: 10px;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-top: -4px;
}

.filter-block.is-expanded .toggle-icon {
    transform: rotate(-135deg);
    margin-top: 4px;
}

/* Collapsible Content */
.filter-block-content {
    max-height: 500px;
    /* Suficiente para el contenido */
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
    opacity: 1;
}

.filter-block:not(.is-expanded) .filter-block-content {
    max-height: 0;
    opacity: 0;
    margin: 0;
    pointer-events: none;
}

/* Scroll Container for Brands/Long lists */
.filter-scroll-container {
    max-height: 180px;
    /* Reducido para evitar desbordes largos */
    overflow-y: auto;
    padding-right: 5px;
    margin-top: 5px;
}

/* Custom Premium Scrollbar */
.filter-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.filter-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filter-scroll-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.filter-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--wcsf-primary);
}

/* Filter Items (Level 3 - Checkboxes) */
.wc-smart-filters .wcsf-label {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    /* Reducido de 4px */
    cursor: pointer;
    padding: 1px 0;
    /* Padding mínimo */
    /* Reducido de 3px */
    color: var(--wcsf-text);
    transition: all 0.2s ease;
    width: 100%;
    font-weight: 400;
    font-size: 14px;
}

.wc-smart-filters .wcsf-label:hover {
    color: var(--wcsf-primary);
}

.wc-smart-filters .wcsf-text {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
}

/* Badge New (Coincidiendo con el megamenú) */
.wc-smart-filters .badge-new {
    background: #e9e9e9;
    color: #333333;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}

/* Custom Checkbox Design */
.wc-smart-filters input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    margin: 0 10px 0 0;
    font: inherit;
    color: currentColor;
    width: 16px;
    /* Reducido de 18px */
    height: 16px;
    /* Reducido de 18px */
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: grid;
    place-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
}

/* ... resto del CSS se mantiene igual ... */

.wc-smart-filters input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em white;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.wc-smart-filters input[type="checkbox"]:checked {
    background-color: var(--wcsf-primary);
    border-color: var(--wcsf-primary);
}

.wc-smart-filters input[type="checkbox"]:checked::before {
    transform: scale(1);
    background-color: #fff;
    box-shadow: none;
}

/* Count Badge */
.wc-smart-filters .count {
    margin-left: auto;
    background: var(--wcsf-bg-hover);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    color: var(--wcsf-text-light);
    font-weight: 500;
}

.wc-smart-filters label:hover .count {
    color: var(--wcsf-primary);
    background: #eef2f7;
}

/* Empty State / Loading */
.wc-smart-filters-empty {
    color: var(--wcsf-text-light);
    font-style: italic;
    padding: 20px 0;
}