/* Reset básico */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body y fuente */
body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.5;
    color: #333;
}

/* Navegación */
nav {
    background-color: #3a6342;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #b7d09c;
}

/* Header con fondo dinámico */
.header-con-fondo {
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 0 1rem;
    position: relative;
    overflow: hidden;
}

/* Fondos dinámicos superpuestos */
.fondo-dinamico {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: -2;
    opacity: 0;
    transition: opacity 0.8s ease-in-out; /* Cambiado de 1.5s a 0.8s */
}

/* Fondo activo visible */
.fondo-activo {
    opacity: 1;
}

/* Fondo oscuro semi-transparente para mejor lectura */
.header-con-fondo::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: -1;
}

.header-container {
    position: relative;
    z-index: 1;
    max-width: 900px;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3a6342;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

.btn:hover {
    background-color: #b7d09c;
}

/* Galería productos */
.galeria {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.galeria h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: #3a6342;
}

.productos {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.producto {
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    padding: 1rem;
    max-width: 250px;
    text-align: center;
    transition: transform 0.3s ease;
}

.producto:hover {
    transform: translateY(-5px);
}

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

.producto h3 {
    margin: 0.8rem 0 0.4rem;
    color: #3a6342;
}

.producto p {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Sección Ilvem */
.ilvem-section {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1rem;
    text-align: center;
}

.ilvem-container img {
    max-width: 250px;
    width: 100%;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.ilvem-container h3 {
    color: #3a6342;
    font-size: 1.8rem;
}

/* Contacto */
.contacto {
    max-width: 1200px;
    margin: 3rem auto 5rem auto;
    padding: 0 1rem;
    text-align: center;
    color: #3a6342;
}

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

/* Footer */
footer {
    background-color: #3a6342;
    color: white;
    padding: 1rem 0;
    text-align: center;
}

/* Carrito flotante */
.carrito {
    position: fixed;
    top: 20%;
    right: 20px;
    width: 300px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    padding: 15px;
    z-index: 150;
    font-family: Arial, sans-serif;
}

.carrito h3 {
    text-align: center;
    color: #3a6342;
    margin-bottom: 10px;
}

/* Lista productos en carrito */
#lista-carrito {
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
    padding: 0;
    margin-bottom: 10px;
}

/* Items del carrito */
#lista-carrito li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 6px;
}

/* Miniatura imagen carrito */
#lista-carrito li img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 5px;
}

/* Texto del producto dentro del li */
#lista-carrito li span {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
}

/* Botón eliminar */
#lista-carrito li button {
    background: transparent;
    border: none;
    color: #cc3333;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.3s ease;
}

#lista-carrito li button:hover {
    color: #ff6666;
}

/* Total carrito */
.carrito p {
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 12px;
}

/* Animación de vuelo */
.clon-animado {
    position: fixed;
    pointer-events: none;
    transition: all 0.8s ease-in-out;
    border-radius: 6px;
    z-index: 9999;
}

/* Animaciones de entrada para elementos con clase .animado */
.animado {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.animado:nth-child(1) {
    animation-delay: 0.2s;
}
.animado:nth-child(2) {
    animation-delay: 0.4s;
}
.animado:nth-child(3) {
    animation-delay: 0.6s;
}
.animado:nth-child(4) {
    animation-delay: 0.8s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .productos {
        flex-direction: column;
        align-items: center;
    }

    .carrito {
        width: 90%;
        right: 5%;
        top: auto;
        bottom: 20px;
    }
}


