/**
 * ESTILOS ACORDEÓN INTELIGENTE DE CATEGORÍAS
 */

/* Contenedor wrapper */
.acordeon-categorias-wrapper {
    margin-bottom: 20px;
}

.acordeon-titulo {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    padding: 0 12px;
}

/* Contenedor principal del acordeón */
.acordeon-contenedor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Elemento individual del acordeón */
.acordeon-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.acordeon-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Botón del acordeón */
.acordeon-button {
    width: 100%;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    font-family: inherit;
}

.acordeon-button:hover {
    background-color: #f0f1f3;
}

.acordeon-button:focus {
    outline: 2px solid #008CBA;
    outline-offset: -2px;
}

/* Icono del acordeón */
.acordeon-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 18px;
    font-weight: bold;
    color: #666;
    transition: transform 0.3s ease;
    margin-left: auto;
    flex-shrink: 0;
}

/* Contenedor del contenido (colapsable) */
.acordeon-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

/* Contenido activo/expandido */
.acordeon-item.active .acordeon-collapse {
    max-height: 800px;
    padding: 12px 16px;
}

/* Icono rotado cuando está activo */
.acordeon-item.active .acordeon-icon {
    transform: rotate(45deg);
    color: #008CBA;
}

/* Botón cuando está activo */
.acordeon-item.active .acordeon-button {
    background-color: #f0f1f3;
    color: #008CBA;
}

/* ════════════════════════════════════════════════════════════════ */
/* LISTA DE CATEGORÍAS */
/* ════════════════════════════════════════════════════════════════ */

.categoria-lista {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categoria-lista li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.categoria-lista li:last-child {
    border-bottom: none;
}

.categoria-lista a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    display: block;
    padding: 4px 0;
}

.categoria-lista a:hover {
    color: #008CBA;
    padding-left: 5px;
}

/* Categoría o subcategoría ACTIVA */
.categoria-lista li.active a {
    color: #008CBA;
    font-weight: 600;
    padding-left: 5px;
}

.categoria-lista li.active a::before {
    content: '✓ ';
    margin-right: 4px;
}

/* ════════════════════════════════════════════════════════════════ */
/* RESPONSIVE */
/* ════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .acordeon-button {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .acordeon-collapse {
        padding: 10px 12px !important;
    }
    
    .acordeon-item.active .acordeon-collapse {
        max-height: 1000px;
    }
    
    .acordeon-icon {
        width: 20px;
        height: 20px;
        font-size: 16px;
    }
    
    .categoria-lista a {
        font-size: 12px;
    }
}

/* ════════════════════════════════════════════════════════════════ */
/* ANIMACIONES */
/* ════════════════════════════════════════════════════════════════ */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.acordeon-item {
    animation: slideDown 0.3s ease;
}
