
/* 🖥️ Diseño PC - 4 columnas */
#productos-container {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr); 
    gap: 8px;
    padding: 2%;
    opacity: 1 !important;
    visibility: visible !important;
    max-width: 100%;  /* Limita el ancho total */
    margin-left: 1%;
    margin-right:1%;
    margin-bottom:3px;
    height: auto;
}

/* 🛍️ Estilos de los productos */
.producto {
    background: var(--color-primario);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgb(161, 185, 192);
    padding: 3%;
    text-align: center;
    transition: transform 0.3s ease-in-out;
    max-width: 100%;
    width: 90%; 
    margin: 0 auto;
    margin-bottom: 5px;
}

.producto h3 {
    color: var(--color-texto-principal);
    margin: 10px 0;
    height: 3em;
    line-height: 1.2em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    font-size: 0.875rem;
}

.producto p{
    font-size: 0.8rem;
}

.oferta{
    color:var(--color-price);
}
.contenedor-imagen {
    position: relative;
    display: inline-block;
}

.contenedor-imagen img {
    width: 100%;
    display: block;
}

.etiqueta-descuento {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: var(--color-fondo-botones-secundario);
    color: white;
    padding: 6px 8px;
    font-size: 0.875rem;
    font-weight: bold;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
} 

.etiqueta-stock {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color:var(--sombra-suave);
    color: white;
    padding: 6px 8px;
    font-size: 0.875rem;
    font-weight: bold;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  }

/* 🔥 Ajuste de imágenes */
.producto img {
    width: 100%;
    height: auto;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgb(161, 185, 192);
}

/* 🛒 Controles de cantidad y carrito */
.acciones-producto {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5%;
    margin-top: 1.5%;
}

.control-cantidad {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.875rem;
}

.cantidad-btn {
    width: 25px;
    height: 25px;
    font-size: 0.875rem;
    background-color: var(--color-fondo-botones);
    border: 1px solid var(--color-fondo-secundario);
    cursor: pointer;
    border-radius: 20%;
    color: var(--color-texto-secundario);
}

.control-cantidad input {
    width: 40px;
    text-align: center;
    font-size: 0.875rem;
    padding: 3px;
    border: 1px solid var(--color-fondo-secundario);
}

/* Botón de agregar al carrito */
.btn-carrito {
    background-color: var(--color-fondo-botones)!important;    
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 5px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size:16px;
}

.btn-carrito:hover {
    background-color: var(--color-secundario);
}


/* 📱 Diseño responsive */

/* 3 columnas en tablets */
@media (min-width: 1024px) and (max-width: 1399px) {
    #productos-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 2 columnas en pantallas medianas */
@media (min-width: 768px) and (max-width: 1023px) {
    #productos-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 1 columna en móviles */
@media (max-width: 767px) {
    #productos-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        margin-bottom:50%;
    }

    .producto {
        width: 90%;
        max-width: 90%;
        margin: auto;
    }

    /* 🔥 Corrección de imágenes en móviles */
    .producto img {
        max-height: 100%;
        /* Evita que las imágenes se recorten */
        object-fit: contain;
        /* Se ajusta sin recortar */
        max-width: 100%;
    }
    .producto h3{
        font-size: 0.6rem
    }

    .producto p{
        font-size: 0.6rem;
    }
    .etiqueta-descuento{
        font-size: 0.6rem;
    }

    .etiqueta-stock{
        font-size: 0.6rem;
    }

    .cantidad-btn{
        font-size: 0.6rem;
    }

    .control-cantidad input{
        font-size: 0.6rem;
    }
    .btn-carrito{
        font-size: 0.6rem;
    }
    
}
