#producto {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 100px 250px;
    overflow: hidden;
    /* Transición para el efecto de fundido */
    transition: opacity 0.3s ease-in-out;
}

/* Clase para ocultar el contenido durante la carga */
#producto.loading {
    opacity: 0;
}

#producto::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-url);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    filter: brightness(0.5);
    filter: brightness(0.3) contrast(1.1);
    z-index: -1;
}

.infoProducto p, .infoProducto h1, .infoProducto table,.infoProducto li{
    color: #fff;
}

.portadaProducto {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 600px; 
    height: 600px;
    background-color: white;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

.portadaProducto img {
    max-width: 80%; 
    max-height: 80%;
    object-fit: contain;
    z-index: 3;
}

.infoProducto{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 40%;
}

.infoProducto h1{
    font-size: 40px;
    text-align: center;
}

.infoProducto p{
    font-size: 20px;
    font-weight: 300;
}

.contenedorTablas{
    background-color: white;
    padding: 20px;
    border-radius: 7px;  
}

#bordeDorado{
    padding: 20px;
    border: 2px solid #D39F42;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.contenedorTablas p, .contenedorTablas table{
    color: black;
}

.contenedorTablas .titulo{
    font-weight: 600;
    letter-spacing: 2px;
    text-align:  center;
}

.contenedorTablas .subtitulo{
    font-size: 15px;
    font-weight: 400;
}

.contenedortabla-info{
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.table-container {
    overflow-x: auto;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-container table {
    min-width: max-content;
    width: auto;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 25px;
}

table, td, th {
    border: 2px solid #D39F42;
    font-weight: 450;
    white-space: nowrap;
    padding: 5px 10px;
    text-align: start;
}

table, td{
    padding-left: 10px;
}

.infoProducto .comentario{
    color: rgb(99, 99, 99);
    font-size: 13px;
    font-weight: 450;
    margin: 10px ;
}

.infoProducto .descripcion{
    font-weight: 600;
}

.presentacion{
    width: 50%;
}

.presentacion td{
    width: 10px;
}

/*--------- NAVEGACIÓN DE PRODUCTOS ---------*/
.producto-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 5; /* Asegura que las flechas estén sobre la imagen */
    pointer-events: none; /* Permite hacer clic a través del contenedor */
}

.nav-arrow {
    pointer-events: all; /* Habilita clics en las flechas */
    color: white;
    font-size: 2.5rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.nav-arrow:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

/* --- FIX PARA FLECHA ÚNICA --- */
/* Cuando solo existe la flecha "siguiente" (primer producto), la empuja a la derecha */
.producto-navigation:has(.next):not(:has(.prev)) {
    justify-content: flex-end;
}

/* Cuando solo existe la flecha "anterior" (último producto), la mantiene a la izquierda (comportamiento por defecto, pero lo explicitamos) */
.producto-navigation:has(.prev):not(:has(.next)) {
    justify-content: flex-start;
}

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

@media(max-width:1700px){
    #producto{
        padding: 100px 150px;
    }
}

@media(max-width:1450px){
    #producto{
        padding: 100px;
    }
    .portadaProducto {
        width: 500px; 
        height: 500px;
    }
    .infoProducto{
        gap: 10px;
        width: 40%;
    }
    .infoProducto h1{
        font-size: 30px;
    }
    .infoProducto p{
        font-size: 17px;
    }
}

@media(max-width:1200px){
    #producto{
        padding: 100px 50px;
    }
    .portadaProducto {
        width: 400px; 
        height: 400px;
    }
    .infoProducto{
        width: 50%;
    }
}

@media(max-width:960px){
    #producto{
        padding: 50px 0;
        flex-direction: column;
        gap: 10px;
    }
    .infoProducto{
        width: 60%;
    }
    .infoProducto h1{
        text-align: center;
    }
    .infoProducto p{
        text-align: center;
    }
    .infoNutricional .comentario{
        text-align: start;
    }
}

@media(max-width:760px){
    #producto{
        margin-top: 207px;
    }
    .presentacion{
        width: 100%;
    }
}

@media(max-width:690px){
    .infoProducto{
        width: 80%;
    }
}

@media(max-width:610px){
    .portadaProducto {
        width: 300px; 
        height: 300px;
    }
}

@media(max-width:460px){
    .infoProducto h1{
        font-size: 25px;
    }
    .infoProducto p{
        font-size: 15px;
    }
}

@media(max-width:390px){
    .portadaProducto {
        width: 200px; 
        height: 200px;
    }
    .infoProducto h1{
        font-size: 20px;
    }
}

@media(max-width:960px){
    .producto-navigation {
        padding: 0 10px;
    }
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.8rem;
    }
}