/* Filtros Apilables - Stackable Filters */

/* Estilos para el botón de filtros mejorado */
.btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-filter i {
    font-size: 16px;
}

.btn-filter-text {
    font-weight: 600;
}

.btn-filter:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

/* Contador de filtros en botón móvil */
#filter-count-badge {
    background: linear-gradient(135deg, #DE208B 0%, #ff2da0 100%) !important;
    color: white !important;
    font-size: 7px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 6px;
    margin-left: 2px;
    min-width: 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(222, 32, 139, 0.4);
    border: 1px solid #ffffff;
}

/* Contenedor principal de filtros activos */
.active-filters-container {
    margin: 0 0 8px 0;
    padding: 4px 6px;
    background: linear-gradient(135deg, #ffffff 0%, #fef7fc 100%);
    border-radius: 3px;
    border: 1px solid #DE208B;
    box-shadow: 0 1px 2px rgba(222, 32, 139, 0.15);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s ease;
}

/* Versión móvil dentro del modal */
.active-filters-container.mobile-only {
    margin: 0 0 4px 0;
    padding: 2px 4px;
    background: linear-gradient(135deg, #ffffff 0%, #fef7fc 100%);
    border: 1px solid #DE208B;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(222, 32, 139, 0.15);
}

.active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(222, 32, 139, 0.2);
}

.active-filters-title {
    font-size: 10px;
    font-weight: 700;
    color: #DE208B;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.active-filters-title::before {
    content: "";
    display: inline-block;
    width: 1.5px;
    height: 6px;
    border-radius: 1px;
}

.clear-all-filters,
.clear-all-filters-mobile {
    color: #DE208B;
    text-decoration: none;
    font-size: 6px;
    font-weight: 600;
    padding: 1px 3px;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 1px;
    border: none;
    box-shadow: 0 1px 2px rgba(222, 32, 139, 0.3);
    cursor: pointer;
}

.clear-all-filters::before,
.clear-all-filters-mobile::before {
    content: "✕";
    font-weight: bold;
    font-size: 7px;
}

.clear-all-filters:hover,
.clear-all-filters-mobile:hover {
    background: linear-gradient(135deg, #ff2da0 0%, #DE208B 100%);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(222, 32, 139, 0.4);
}

/* Contenedor de chips de filtros */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    padding: 0;
}

/* Chip individual de filtro */
.filter-chip {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    color: #333;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    cursor: default;
    gap: 3px;
}

/* Chip removible */
.filter-chip.removable {
    padding-right: 2px;
    cursor: pointer;
    border-color: #DE208B;
    background: linear-gradient(135deg, #ffffff 0%, #fff5fb 100%);
}

.filter-chip.removable:hover {
    background: linear-gradient(135deg, #DE208B 0%, #ff2da0 100%);
    color: #ffffff;
    border-color: #DE208B;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(222, 32, 139, 0.3);
}

/* Botón de remover filtro */
.filter-chip-remove {
    margin-left: 0.5px;
    color: #DE208B;
    font-size: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(222, 32, 139, 0.1);
}

.filter-chip.removable:hover .filter-chip-remove {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Diferentes tipos de filtros con colores basados en el color principal */
.filter-chip.search {
    background: linear-gradient(135deg, #DE208B 0%, #c01a75 100%);
    color: white;
    border-color: #DE208B;
}

.filter-chip.category {
    background: linear-gradient(135deg, #ff2da0 0%, #DE208B 100%);
    color: white;
    border-color: #ff2da0;
}

.filter-chip.color {
    background: linear-gradient(135deg, #DE208B 0%, #a01667 100%);
    color: white;
    border-color: #DE208B;
}

.filter-chip.size {
    background: linear-gradient(135deg, #ff4db8 0%, #DE208B 100%);
    color: white;
    border-color: #ff4db8;
}

.filter-chip.price {
    background: linear-gradient(135deg, #DE208B 0%, #ff2da0 100%);
    color: white;
    border-color: #DE208B;
}

.filter-chip.tag {
    background: linear-gradient(135deg, #ff6bc7 0%, #DE208B 100%);
    color: white;
    border-color: #ff6bc7;
}

.filter-chip.sort {
    background: linear-gradient(135deg, #c01a75 0%, #8e1458 100%);
    color: white;
    border-color: #c01a75;
}

/* Estado cuando no hay filtros activos */
.no-active-filters {
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 7px;
    padding: 2px;
    background: rgba(222, 32, 139, 0.05);
    border-radius: 3px;
    margin: 1px 0;
}

/* Estilos específicos para filtros activos en móvil */
.active-filters-container.mobile-only .filter-chip {
    font-size: 6px;
    padding: 1px 3px;
}

.active-filters-container.mobile-only .active-filters-title {
    font-size: 6px;
}

.active-filters-container.mobile-only .clear-all-filters-mobile {
    font-size: 5px;
    padding: 1px 3px;
}

/* Responsive design */
@media (max-width: 991px) {
    /* Ocultar el contenedor de la barra lateral en móvil */
    .sidebar .active-filters-container {
        display: none !important;
    }
    
    /* Mostrar el contenedor dentro del modal */
    .active-filters-container.mobile-only {
        display: flex !important;
    }
}

@media (min-width: 992px) {
    /* Mostrar el contenedor en la barra lateral */
    .sidebar .active-filters-container {
        display: flex !important;
    }
    
    /* Ocultar el contenedor del modal en desktop */
    .active-filters-container.mobile-only {
        display: none !important;
    }
}

/* Estilos para mensajes de carga */
.loading {
    text-align: center;
    padding: 20px 10px;
    color: #6c757d;
    font-size: 13px;
}

.loading i {
    margin-right: 5px;
    color: #007bff;
}

/* Estilos para el modal de filtros con diseño de barra lateral */

/* Modal de filtros hereda estilos de la barra lateral */
#filtersModal .modal-body .widget {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

#filtersModal .modal-body .widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

#filtersModal .widget-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Listas de filtros en el modal */
#filtersModal .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#filtersModal .widget ul li {
    margin-bottom: 5px;
    padding: 3px 0;
}

#filtersModal .widget ul li a {
    display: block;
    color: #666;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s ease;
    padding: 3px 6px;
    border-radius: 3px;
}

#filtersModal .widget ul li a:hover {
    color: #E8B912 !important;
    text-decoration: none;
}

#filtersModal .widget ul li a.active {
    color: #E8B912 !important;
    background-color: rgba(232, 185, 18, 0.1);
    font-weight: 600;
}

#filtersModal .widget ul li a.disabled {
    color: #ccc !important;
    cursor: not-allowed;
    opacity: 0.5;
}

#filtersModal .widget ul li a.disabled:hover {
    color: #ccc !important;
    background-color: transparent;
}

/* Contadores en el modal */
#filtersModal .widget li a .count,
#filtersModal .widget .count {
    font-size: 10px;
    color: #666;
    font-weight: normal;
    margin-left: 3px;
}

/* Colores en el modal */
#filtersModal .widget-color ul li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 14px;
}

#filtersModal .widget-color ul li a {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    padding: 0;
    pointer-events: none; /* Evitar clicks directos en el link */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#filtersModal .widget-color ul li.selected a {
    border: 3px solid #E8B912 !important;
    box-shadow: 0 0 8px rgba(232, 185, 18, 0.5);
    transform: scale(1.15);
}

#filtersModal .widget-color ul li.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#filtersModal .widget-color ul li.disabled a {
    opacity: 0.3;
}

#filtersModal .widget-color ul li:not(.disabled):not(.selected):hover a {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    border-color: #999;
}

/* Tallas en el modal */
#filtersModal .widget-size ul li.checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
}

#filtersModal .widget-size ul li.checkbox input[type="checkbox"] {
    margin: 0;
}

#filtersModal .widget-size ul li.checkbox label {
    margin: 0;
    cursor: pointer;
    flex: 1;
}

#filtersModal .widget-size ul li.disabled {
    opacity: 0.5;
}

#filtersModal .widget-size ul li.disabled label {
    cursor: not-allowed;
}

#filtersModal .widget-size ul li.disabled input[type="checkbox"] {
    cursor: not-allowed;
}

/* Etiquetas en el modal */
#filtersModal .widget_tag .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

#filtersModal .widget_tag .tag-list a {
    display: inline-block;
    padding: 3px 8px;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

#filtersModal .widget_tag .tag-list a:hover {
    background: #E8B912;
    color: white !important;
    text-decoration: none;
}

#filtersModal .widget_tag .tag-list a.active {
    background: #E8B912;
    color: white !important;
}

#filtersModal .widget_tag .tag-list a.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Precio en el modal */
#filtersModal .widget-price .price-inputs {
    display: flex;
    gap: 6px;
    align-items: center;
}

#filtersModal .widget-price .price-inputs input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

#filtersModal .widget-price .amount {
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}
/* Precio en la barra lateral */
.sidebar .widget-price .price-inputs {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-bottom: 6px;
}

.sidebar .widget-price .price-inputs input {
    flex: 1;
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-size: 9px;
    min-width: 0;
    height: 20px;
}

.sidebar .widget-price .price-inputs input:focus {
    outline: none;
    border-color: #ff6347;
}

.sidebar .widget-price #apply-price-filter {
    width: 100%;
    padding: 3px 6px;
    font-size: 9px;
    border-radius: 2px;
}

/* Estilos para colores en la barra lateral */
.sidebar .widget-color ul li {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    transition: all 0.2s ease;
    font-size: 9px;
}

.sidebar .widget-color ul li a {
    pointer-events: none; /* Evitar clicks directos en el link */
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    padding: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.sidebar .widget-color ul li.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sidebar .widget-color ul li:not(.disabled):hover {
    opacity: 0.8;
}

.sidebar .widget-color ul li:not(.disabled):hover a {
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    border-color: #999;
}

.sidebar .widget-color ul li.selected a {
    border: 1px solid #E8B912 !important;
    box-shadow: 0 0 3px rgba(232, 185, 18, 0.4);
    transform: scale(1.05);
}

/* Contador de productos para colores */
.sidebar .widget-color ul li .count {
    font-size: 8px;
    color: #666;
    font-weight: 500;
}
