/* OfficePro — Panel de filtros del catálogo de productos */

.opde-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 0 18px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 20px;
}

/* ── Grupo de filtro ── */
.opde-filter-group {
    position: relative;
}

/* ── Botón base ── */
.opde-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    transition: border-color 0.15s, background 0.15s;
    white-space: nowrap;
}

.opde-filter-toggle:hover {
    border-color: #333;
    background: #f8f8f8;
    color: #000;
    text-decoration: none;
}

.opde-filter-toggle[aria-expanded="true"] {
    border-color: #333;
    background: #f8f8f8;
}

.opde-filter-toggle.is-active {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: #fff;
}

.opde-filter-toggle.is-active:hover {
    background: #333;
    color: #fff;
    text-decoration: none;
}

/* Chevron */
.opde-chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.opde-filter-toggle[aria-expanded="true"] .opde-chevron {
    transform: rotate(180deg);
}

/* Badge de cantidad activa */
.opde-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #5AC24F;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

/* ── Dropdown ── */
.opde-filter-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 9999;
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 4px 0;
}

/* Opción del dropdown */
.opde-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.875rem;
    color: #333;
    text-decoration: none;
    transition: background 0.1s;
}

.opde-filter-option:hover {
    background: #f5f5f5;
    color: #000;
    text-decoration: none;
}

.opde-filter-option.is-active {
    font-weight: 600;
    color: #000;
}

.opde-filter-option-count {
    margin-left: auto;
    color: #999;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ── Checkbox visual ── */
.opde-filter-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border: 1.5px solid #ccc;
    border-radius: 3px;
    flex-shrink: 0;
    transition: background 0.12s, border-color 0.12s;
    background: #fff;
}

.is-active .opde-filter-checkbox,
.opde-stock-toggle.is-active .opde-filter-checkbox {
    background: #1a1a1a;
    border-color: #1a1a1a;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='8' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4l3 3 5-6' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* ── Filtro solo en stock (toggle simple) ── */
.opde-filter-group--stock .opde-stock-toggle {
    cursor: pointer;
}

/* ── Botón limpiar ── */
.opde-filter-clear {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    padding: 7px 10px;
    font-size: 0.8rem;
    color: #888;
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.15s;
}

.opde-filter-clear:hover {
    color: #c00;
    text-decoration: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .opde-filter-bar {
        gap: 6px;
        padding: 10px 0 14px;
    }

    .opde-filter-toggle {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .opde-filter-dropdown {
        min-width: 180px;
    }
}
