/* Estilos generales */
html, body {
    height: 100%; /* Asegura que el body ocupe toda la altura de la ventana */
    margin: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column; /* Hace que los elementos se apilen verticalmente */
    justify-content: flex-start;
}

/* Asegura que el contenido principal ocupe el espacio restante */
main {
    flex: 1;
    padding: 2rem;
    background-color: #fff;
}

/* Header */
header {
    background-color: #ff6347; /* Rojo tomate */
    color: white;
    text-align: center;
    padding: 2rem;
}

h1 {
    font-size: 2.5rem;
}

header p {
    font-size: 1.2rem;
}

/* Página de productos */
section {
    padding: 3rem 1rem;
}

h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.producto {
    background-color: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.producto img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.producto h3 {
    font-size: 1.5rem;
    margin: 1rem 0;
}

.producto p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.producto a {
    text-decoration: none;
    color: #ff6347;
    font-weight: bold;
}

/* Página de Detalle de Producto */
.producto-detalle {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 2rem;
    background-color: #fff;
}

.producto-imagenes {
    width: 48%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.main-img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.imagenes-secundarias {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.imagenes-secundarias img {
    width: 30%;
    border-radius: 8px;
    cursor: pointer;
}

.producto-info {
    width: 48%;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.producto-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.producto-info ul {
    list-style-type: disc;
    margin-left: 20px;
}

.producto-info a.boton-volver {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #ff6347;
    color: white;
    text-decoration: none;
    font-weight: bold;
    margin-top: 2rem;
    border-radius: 8px;
    text-align: center;
}

.producto-info a.boton-volver:hover {
    background-color: #ff4500;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto; /* Empuja el footer al final */
    width: 100%;
}

/* Responsivo */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .grid {
        grid-template-columns: 1fr 1fr;
    }

    .producto h3 {
        font-size: 1.3rem;
    }

    .producto p {
        font-size: 0.9rem;
    }

    .producto-detalle {
        flex-direction: column;
    }

    .producto-imagenes, .producto-info {
        width: 100%;
    }

    .imagenes-secundarias {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .imagenes-secundarias img {
        flex: 1 1 calc(33.33% - 0.5rem); /* Cada imagen ocupará un 33.33% del ancho, ajustado por el gap */
        object-fit: cover; /* Asegura que las imágenes no se deformen */
    }
}
