/* Estilo general */
body {
    margin-top: 60px;
    padding-top: 120px;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* Contenedor principal */
.contenedor {
    top: 10px;
    display: flex;
    flex-direction: row;
    width: 80%;
    height: 80vh;
    background: #fff;
    box-shadow: 0 9px 50px rgba(0, 0, 0, 0.5);
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 30px;
}

/* Categorías */
.categorias {
    width: 30%;
    background: #f8f8f8;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    border-right: 1px solid #ddd;
    position: sticky;
    top: 0;
    height: 100%;
    overflow-y: auto;
}

/* Título "Categorías" */
.categorias h2 {
    background-color: #d32f2f;
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 25px;
    margin: 0;
}

/* Botones de categorías */
.categorias button {
    background: none;
    color: black;
    padding: 12px 0;
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    text-align: center;
    transition: color 0.3s ease, font-size 0.3s ease, font-weight 0.3s ease;
    font-weight: 500;
}

/* Hover y botón activo */
.categorias button:hover,
.categorias button.activo {
    color: #000000;
    font-size: 1.3rem;
    font-weight: 700;
}

/* Productos */
.productos {
    width: 70%;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    overflow-y: auto;
    height: 100%;
    /* Hacer que los productos tomen el 100% del espacio disponible */
    max-height: 100%;
    /* Asegura que no exceda la pantalla */
    overflow-y: scroll;
    /* Activa el scroll */
}

/* Producto individual */
.producto {
    background: #fff;
    padding: 15px;
    border-radius: 0px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 250px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover en los productos */
.producto:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.producto h3 {
    font-size: 20px;
    /* Ajusta el tamaño según lo que necesites */
}

/* Subproductos y flecha */
.flecha {
    display: none;
    font-size: 20px;
    color: #d32f2f;
    transition: transform 0.3s ease;
}

.producto .flecha {
    display: inline-block;
}

/* Rotación de la flecha */
.producto .flecha.rotada {
    transform: rotate(90deg);
}

/* Subproductos desplegables */
.subproductos {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 10px;
    margin-top: 10px;
    border-radius: 0px;
    display: none;
    position: relative;
    width: 100%;
}

.subproducto-item {
    padding: 5px 0;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.subproducto-item:last-child {
    border-bottom: none;
}

.subproducto-item span:first-child {
    font-weight: bold;
    margin-right: 10px;
    color: #d32f2f;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-top: 40px !important;
        /* Ajuste del padding-top en móviles para reducir el espacio */
    }

    .contenedor {
        flex-direction: column;
        height: auto;
        width: 100%;
        position: relative;
        margin: 10px;
        margin-bottom: 50px;
        box-sizing: border-box;
    }

    .categorias {
        width: 100%;
        height: auto;
        position: relative;
        background-color: #fff;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        text-align: center;
        overflow: visible;
    }

    .categorias button {
        font-size: 1.0rem;
        padding: 7px 0;
    }

    .productos {
        width: 100%;
        flex-direction: column;
        align-items: center;
        overflow-y: auto;
        height: calc(100vh - 90px);
        padding-top: 60px;
        display: block;
        /* De vuelta a block para mantener el comportamiento de scroll vertical */
        text-align: center;
        /* Asegura que los productos estén alineados correctamente */
    }

    .producto {
        width: 90%;
        margin-bottom: 15px;
        display: block;
        /* Cambiado a block para evitar problemas de alineación */
        margin-left: auto;
        /* Alinea el producto hacia el centro */
        margin-right: auto;
        /* Alinea el producto hacia el centro */
    }
}