/*=====================================================
   filters_search/style_filters.css
   Sidebar de filtros - categorias.php
   Glassmorphism reutilizado de .cookie-container
   Valores: background: rgba(148,195,246,0.76);
            border: 1px solid rgba(255,255,255,0.25);
            box-shadow: 0 8px 30px rgba(0,0,0,0.15);
            border-radius: 20px;
            backdrop-filter: blur(10px);
   ===================================================== */

/* --- SIDEBAR CONTAINER --- */
.fs-sidebar {
    margin-bottom: 25px;
}

/* --- SIDEBAR BLOCKS (4 contenedores independientes) --- */
.fs-sidebar-block {
    background: rgba(148, 195, 246, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-radius: 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 20px;
    margin-bottom: 20px;
    color: #1c2b39;
    position: relative;
}

/* --- TITULO DE FILTRO --- */
.fs-filter-title {
    font-weight: 700;
    font-size: 15px;
    color: #1c2b39;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: none;
}

.fs-filter-title--bordered {
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    margin-top: 18px;
    padding-top: 14px;
}

.fs-filter-title:first-child {
    margin-top: 0;
    padding-top: 0;
}

/* --- BOTON LIMPIAR FILTROS --- */
.fs-clear-btn {
    display: block;
    width: 100%;
    padding: 10px 0;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    color: #1c2b39;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.15s ease;
    text-align: center;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.fs-clear-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.fs-clear-btn:active {
    transform: translateY(0);
}

.fs-clear-btn::before {
    content: "\f021";
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome;
    font-weight: 900;
    margin-right: 8px;
    font-size: 12px;
}

/* --- CHECKBOX / RADIO FILTER ITEMS --- */
.fs-filter-item {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    margin-bottom: 3px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
    color: #1c2b39;
    user-select: none;
    -webkit-user-select: none;
}

.fs-filter-item:hover {
    background: rgba(255, 255, 255, 0.35);
}

.fs-filter-item input[type="checkbox"],
.fs-filter-item input[type="radio"] {
    display: none;
}

.fs-filter-item .fs-check-custom {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid rgba(28, 43, 57, 0.45);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease;
    background: rgba(255, 255, 255, 0.5);
}

.fs-filter-item input[type="checkbox"]:checked + .fs-check-custom,
.fs-filter-item input[type="radio"]:checked + .fs-check-custom {
    background: #007bff;
    border-color: #007bff;
}

.fs-filter-item input[type="checkbox"]:checked + .fs-check-custom::after,
.fs-filter-item input[type="radio"]:checked + .fs-check-custom::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.fs-filter-item input[type="radio"] + .fs-check-custom {
    border-radius: 50%;
}

.fs-filter-item input[type="radio"]:checked + .fs-check-custom::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    border: none;
    transform: none;
}

.fs-filter-item input:focus + .fs-check-custom {
    outline: 2px solid rgba(0, 123, 255, 0.5);
    outline-offset: 2px;
}

.fs-filter-item .fs-label {
    flex: 1;
    cursor: pointer;
    line-height: 1.3;
}

.fs-filter-item .fs-count {
    font-size: 12px;
    color: rgba(28, 43, 57, 0.6);
    margin-left: 6px;
    white-space: nowrap;
}

.fs-filter-item--active {
    background: rgba(255, 255, 255, 0.4);
}

/* --- SUBCATEGORIAS: GRUPO COLAPSABLE --- */
.fs-subcat-group {
    margin-bottom: 4px;
}

.fs-subcat-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #1c2b39;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.fs-subcat-toggle:hover {
    background: rgba(255, 255, 255, 0.35);
}

.fs-subcat-toggle .fs-arrow {
    font-size: 10px;
    transition: transform 0.25s ease;
    margin-left: 6px;
}

.fs-subcat-toggle.fs-open .fs-arrow {
    transform: rotate(90deg);
}

.fs-subcat-list {
    list-style: none;
    padding: 0 0 0 18px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.fs-subcat-list.fs-visible {
    max-height: 600px;
}

/* --- RANGO DE PRECIO --- */
.fs-price-range {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.fs-price-input-group {
    flex: 1;
    min-width: 80px;
}

.fs-price-input-group label {
    display: block;
    font-size: 12px;
    color: rgba(28, 43, 57, 0.7);
    margin-bottom: 4px;
}

.fs-price-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(28, 43, 57, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    color: #1c2b39;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fs-price-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.fs-price-separator {
    margin-top: 18px;
    font-weight: 600;
    color: rgba(28, 43, 57, 0.5);
}

.fs-price-apply {
    width: 100%;
    padding: 8px 0;
    margin-top: 10px;
    background: rgba(0, 123, 255, 0.85);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.fs-price-apply:hover {
    background: rgba(0, 123, 255, 1);
}

.fs-price-apply:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- BOTONES DE CATEGORIA (fallback si se usan links) --- */
.fs-cat-link {
    display: block;
    padding: 7px 10px;
    margin-bottom: 3px;
    border-radius: 10px;
    color: #1c2b39;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.fs-cat-link:hover {
    background: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    color: #1c2b39;
}

.fs-cat-link.fs-active {
    background: rgba(255, 255, 255, 0.45);
    font-weight: 600;
}

.fs-cat-link .fs-count {
    font-size: 12px;
    color: rgba(28, 43, 57, 0.6);
    float: right;
}

/* --- LOADING OVERLAY --- */
.fs-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(148, 195, 246, 0.3);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.fs-loading::after {
    content: "";
    width: 28px;
    height: 28px;
    border: 3px solid rgba(28, 43, 57, 0.2);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: fs-spin 0.7s linear infinite;
}

@keyframes fs-spin {
    to { transform: rotate(360deg); }
}

.fs-sidebar--loading {
    position: relative;
    pointer-events: none;
}

/* --- PRODUCTO CARD (grid) --- */
.fs-product-card {
    background: rgba(255, 255, 255, 0.01);
    transition: opacity 0.3s ease;
}

.fs-product-card.fs-hidden {
    display: none;
}

/* --- PRODUCTO VACIO MSG --- */
.fs-empty-msg {
    text-align: center;
    padding: 40px 20px;
    color: #1c2b39;
    font-size: 16px;
    width: 100%;
}

.fs-empty-msg i {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* --- RESPONSIVE --- */
@media (max-width: 991px) {
    .fs-sidebar {
        margin-bottom: 20px;
    }

    .fs-sidebar-block {
        padding: 16px;
    }
}

@media (max-width: 767px) {
    .fs-sidebar-block {
        border-radius: 16px;
        padding: 14px;
    }

    .fs-filter-item {
        padding: 9px 12px;
        font-size: 15px;
    }

    .fs-price-input {
        padding: 10px 12px;
        font-size: 15px;
    }

    .fs-clear-btn {
        padding: 12px 0;
        font-size: 15px;
    }
}
