.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.producto-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 160px;
    height: 300px; /* Aumentamos un poco la altura */
    padding: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.producto-card .imagen-contenedor {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto;
    overflow: hidden;
}

.producto-card img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 4px;
}

.producto-card h3 {
    font-size: 13px;
    margin: 5px 0;
    color: #333;
    line-height: 1.2;
    max-height: 32px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.producto-card .contenido {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 5px;
}

.producto-card .precio {
    font-size: 16px;
    color: #2c3e50;
    font-weight: bold;
    margin: 5px 0;
}

.producto-card .agregar-carrito {
    background-color: #45a049;
    color: white;
    border: none;
    padding: 8px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: calc(100% - 10px);
    font-size: 12px;
    font-weight: bold;
    margin: 5px auto 10px auto;
    display: block;
}

.producto-card .agregar-carrito:hover {
    background-color: #45a049;
}

.carousel-container {
    position: relative;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 40px;
}

.productos-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 20px 0;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.3s ease;
}

.left-arrow {
    left: 0;
}

.right-arrow {
    right: 0;
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

.header-separator {
    height: 60px;
    width: 100%;
    clear: both;
    margin-bottom: 20px;
    background-color: #f9f9f9;
}

@media (max-width: 768px) {
    .productos-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en móvil */
        gap: 10px;
        padding: 10px;
    }
    
    .producto-card {
        width: 100%; /* Ocupa todo el ancho de su columna */
        height: 280px;
        margin: 0;
    }

    .producto-card .imagen-contenedor {
        width: 100px;
        height: 100px;
    }

    .producto-card img {
        width: 100px;
        height: 100px;
    }

    .producto-card h3 {
        font-size: 12px;
        margin: 3px 0;
    }

    .producto-card .precio {
        font-size: 14px;
    }

    .producto-card .agregar-carrito {
        font-size: 11px;
        padding: 6px 0;
    }

    .productos-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .producto-card h3 {
        font-size: 1em;
    }
    
    .carousel-container {
        padding: 0 30px;
    }
}

@media (max-width: 480px) {
    .productos-grid {
        padding: 5px;
    }
}
