/* --- Estilos Generales --- */
.subcategorias-contenedor {
    position: relative;
    max-width: 1200px;
    width: 100%;
    margin: 10px auto;
    padding: 0;
}

/* --- Botón Toggle (similar al de Filtros) --- */
.subcategorias-toggle-btn {
    display: none; /* Oculto por defecto (desktop) */
    width: 100%;
    padding: 5px 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-weight: normal;
    color: #333;
    text-align: center;
    cursor: pointer;
    margin-bottom: 0px;
    transition: background-color 0.2s ease;
}

.subcategorias-toggle-btn:hover {
    background-color: #f9f9f9;
}

.subcategorias-toggle-btn .toggle-text {
    display: inline-block;
}

/* --- Wrapper Colapsable --- */
.subcategorias-wrapper {
    /* En desktop siempre visible */
}

.subcategoria-item {
    text-align: center;
    margin-bottom: 10px;
    width: 120px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.subcategoria-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.subcategoria-item img {
    width: 104px;
    height: 104px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.3s ease;
    margin-bottom: 5px;
}

.subcategoria-item:hover img {
    opacity: 0.8;
}

.subcategoria-titulo {
    font-size: 14px;
    font-weight: normal;
    color: #333;
    display: block;
    padding: 0 5px;
    text-align: center;
}

/* --- Estilos del Carrusel --- */
.subcategorias-inner {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 10px;
    margin-bottom: 0px;
    justify-content: flex-start;
}

/* Centrar cuando no hay scroll */
.subcategorias-inner.centered {
    justify-content: center !important;
}

/* Botones de navegación (ocultos) */
.carrusel-btn {
    display: none;
}

/* Paginación (puntos) */
.carrusel-paginacion {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.carrusel-paginacion li {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
}

.carrusel-paginacion li.active {
    background-color: #333;
}

/* -------------------- RESPONSIVE -------------------- */

/* Escritorio */
@media (min-width: 992px) {
    .subcategorias-inner {
        overflow-x: auto;
        flex-wrap: nowrap;
		margin-bottom: 10px;
    }

    .subcategoria-item {
        width: 154px;
        border: 1px solid #d7d7d7;
        padding: 10px;
        background: #f7f7f7;
    }
}

/* Tablet y Móvil */
@media (max-width: 991px) {
    /* Mostrar botón toggle */
    .subcategorias-toggle-btn {
        display: block;
    }
    
    /* Wrapper oculto por defecto */
    .subcategorias-wrapper {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }
    
    /* Wrapper visible cuando está abierto */
    .subcategorias-wrapper.open {
        max-height: 1000px;
		padding-top: 14px;
    }
    
    .subcategorias-inner {
        overflow-x: auto;
		margin-bottom: 10px;
    }

    .subcategoria-item {
        width: 150px;
        flex-shrink: 0;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .subcategorias-inner {
        overflow-x: auto;
    }

    .subcategoria-item {
        width: 105px;
        flex-shrink: 0;
    }

    .subcategoria-item img {
        width: 72px;
        height: 72px;
    }

    .subcategoria-titulo {
        font-size: 12px;
    }
}