:root {
    --dido-orange: #f3a81d;
    --dido-blue: #2cb3e3;
    --dido-dark-green: #006a4e;
    --dido-medium-green: #37a96d;
    --dark-bg: #212121; 
    --light-bg: #ffffff;
    --light-section-bg: #f9f9f9;
    --dark-text: #333333;
    --light-text: #ffffff;
    --readable-grey: #555555;
}

/* --- Reseteo y Scroll Suave --- */
html {
    scroll-behavior: smooth;
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}

/* --- Animación Preloader --- */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background-color: var(--light-bg); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s 0.2s ease-out, visibility 0.7s ease-out;
    padding: 20px;
}
#preloader img { 
    width: 60%;
    max-width: 220px;
    height: auto;
    animation: fadeIn 1.8s ease-in-out; 
}
#preloader.hide-preloader { opacity: 0; visibility: hidden; }

/* --- Estilos Generales y Tipografía --- */
body { font-family: 'Nunito Sans', sans-serif; margin: 0; background-color: var(--light-bg); color: var(--dark-text); overflow-x: hidden; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3, h4 { font-weight: 700; text-transform: uppercase; }
.section-title { font-size: 2.3rem; color: var(--dido-dark-green); text-align: center; margin-bottom: 100px; }
p { line-height: 1.6; color: var(--readable-grey); }

.section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: -80px auto 60px auto;
    color: var(--readable-grey);
    font-size: 1.1rem;
    font-weight: 400;
}

/* --- Animaciones al Scroll --- */
.hidden { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.visible { opacity: 1; transform: translateY(0); }

/* --- BARRA DE NAVEGACIÓN (BLANCA Y FIJA) --- */
.navbar {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    z-index: 1000;
    background-color: var(--light-bg); 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.navbar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
    padding: 10px 20px;
    gap: 50px;
    position: relative;
}
.navbar-links-left, .navbar-links-right { display: flex; align-items: center; gap: 25px; }
.navbar-links-left a, .navbar-links-right a { 
    color: var(--dark-text); 
    text-decoration: none; 
    font-weight: 700; 
    font-size: 0.95rem; 
    transition: color 0.3s ease; 
    text-shadow: none;
}
.navbar-links-left a:hover, .navbar-links-right a:hover { color: var(--dido-orange); }
.contact-btn { background-color: var(--dido-medium-green); color: var(--light-text); padding: 10px 25px; border-radius: 50px; transition: all 0.3s ease; }
.contact-btn:hover { background-color: var(--dido-dark-green); color: var(--light-text); transform: scale(1.05); }

.navbar-logo { position: relative; height: 70px; width: 180px; z-index: 1002; }
.navbar-logo img { 
    position: absolute; 
    height: 85px; 
    width: auto; 
    display: block; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    transition: height 0.3s ease; 
}

/* --- ESTILOS PARA EL DROPDOWN DE NAVEGACIÓN --- */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropbtn {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.nav-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--light-bg);
    min-width: 220px;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    margin-top: 15px;
    overflow: hidden; 
}
.dropdown-content a {
    color: var(--dark-text) !important;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 0.9rem;
    text-shadow: none !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.dropdown-content a:hover {
    background-color: var(--light-section-bg);
    color: var(--dido-dark-green) !important;
}
.dropdown.active .dropdown-content {
    display: block;
}
.dropdown.active .nav-arrow {
    transform: rotate(180deg);
}

/* Menú móvil y botón de hamburguesa */
.nav-toggle-btn { display: none; }
.mobile-nav-panel {
    position: fixed; top: 0; right: 0; width: 85%; max-width: 320px; height: 100vh;
    background-color: var(--dark-bg); z-index: 1001;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 25px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.mobile-nav-panel.nav-open { transform: translateX(0); }
.mobile-nav-panel a { color: var(--light-text); text-decoration: none; font-size: 1.5rem; font-weight: 700; }
.mobile-nav-panel .contact-btn { font-size: 1.2rem; padding: 12px 30px; }
.nav-close-btn {
    display: block; position: absolute; top: 25px; right: 25px; font-size: 2.2rem;
    color: var(--light-text); background: none; border: none; cursor: pointer;
}

/* --- Sección Hero --- */
.hero { 
    height: 100vh; 
    position: relative; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    overflow: hidden;
    padding-top: 90px;
    box-sizing: border-box;
}

.hero-background { 
    position: absolute; 
    top: -10%;
    left: 0; 
    width: 100%; 
    height: 120%;
    background-size: cover; 
    background-position: center; 
}

.hero-background::before { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0.6) 60%, rgba(0,0,0,0.1) 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 800px; padding: 0 20px; }
.hero-content h1, .hero-content .hero-subtitle, .hero-content .hero-btn {
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.hero-content.visible h1, .hero-content.visible .hero-subtitle, .hero-content.visible .hero-btn {
    opacity: 1; transform: translateY(0);
}
.hero-content.visible .hero-subtitle { transition-delay: 0.3s; }
.hero-content.visible .hero-btn { transition-delay: 0.6s; }
.hero-content h1 { font-size: 4.2rem; font-weight: 900; color: var(--light-text); text-shadow: 2px 2px 8px rgba(0,0,0,0.7); margin-bottom: 15px; line-height: 1.2; }
.hero-subtitle { font-size: 1.3rem; color: var(--light-text); font-weight: 400; margin: 0 auto 35px auto; text-shadow: 1px 1px 4px rgba(0,0,0,0.7); }

/* --- Botones --- */
.dido-btn { padding: 15px 40px; text-decoration: none; font-weight: 700; border-radius: 50px; text-transform: uppercase; display: inline-block; transition: all 0.3s ease; border: none; cursor: pointer; font-size: 1rem; }
.hero-btn { background-color: var(--dido-blue); color: var(--light-text); font-size: 1.1rem; }
.hero-btn:hover { background-color: #249dca; transform: translateY(-3px); box-shadow: 0 6px 20px rgba(44, 179, 227, 0.4); }

/* --- SECCIÓN NOSOTROS --- */
#nosotros { padding: 100px 0; background-color: var(--light-bg); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.about-text { text-align: left; }
.about-title { font-size: 2.2rem; line-height: 1.2; color: var(--dido-orange); text-align: left; margin-bottom: 20px; text-transform: none; }
.flipper-container { perspective: 1000px; }
.flipper { position: relative; transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55); transform-style: preserve-3d; height: 480px; }
.flipper-container:hover .flipper { transform: rotateY(180deg); }
.front, .back {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    backface-visibility: hidden;
}
.front img, .back img {
    width: 100%; height: 100%; border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); object-fit: cover;
}
.back { transform: rotateY(180deg); }
.about-icons { display: flex; justify-content: space-around; text-align: center; margin-bottom: 40px; gap: 20px; }
.icon-item i { font-size: 2.5rem; color: var(--dido-medium-green); margin-bottom: 15px; }
.icon-item h4 { font-size: 1rem; color: var(--dido-dark-green); font-weight: 700; text-transform: none; margin: 0; }

/* --- SECCIÓN PRODUCTOS (EFECTO FINAL Y ROBUSTO) --- */
#productos { padding: 100px 0; background-color: var(--light-section-bg); }
.product-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 30px; 
    align-items: flex-start;
}
.product-card {
    background-color: var(--light-bg); border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1); position: relative;
    height: 420px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.product-card img { 
    width: 100%; height: 100%; object-fit: cover;
}

.product-card::after {
    content: ''; position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 50%);
    z-index: 1;
    transition: background 0.4s ease;
}

.product-card:hover::after {
    background: linear-gradient(to top, rgba(0,0,0,0.9) 40%, transparent 80%);
}

.product-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px; /* Ajusta el padding según necesites */
    box-sizing: border-box;
    z-index: 3;
    color: var(--light-text);
    display: flex;
    flex-direction: column-reverse; /* **LA CLAVE**: Invierte el orden de los elementos */
}

.product-info h3 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.2;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.8);
    transition: transform 0.4s ease;
}

.product-info p {
    color: #ddd;
    text-transform: none;
    margin: 0 0 15px 0; /* Margen inferior para separar del título */
    font-size: 0.95rem;
    line-height: 1.5;
    /* Oculta el párrafo por defecto */
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, margin-bottom 0.4s ease-in-out;
}

/* Al pasar el mouse, se revela el párrafo */
.product-card:hover .product-info p {
    opacity: 1;
    max-height: 150px; /* Altura suficiente para el texto */
}

/* --- ESTILOS PARA EL BOTÓN DE CATÁLOGO --- */
.catalog-button-container {
    text-align: center;
    margin-top: 60px;
}
.catalog-btn {
    background-color: var(--dido-dark-green);
    color: var(--light-text);
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.catalog-btn:hover {
    background-color: var(--dido-medium-green);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 106, 78, 0.3);
}

/* --- SECCIÓN CONTACTO --- */
#contacto { padding: 0; background-color: var(--dark-bg); color: var(--light-text); overflow: hidden; }
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; min-height: 70vh; }
.contact-info { padding: 60px 80px; position: relative; z-index: 2; }
.contact-info::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 5px; height: 30%; background-color: var(--dido-orange); border-radius: 0 5px 5px 0;
}
.contact-info .section-title { color: var(--light-text); text-align: left; margin-bottom: 20px; }
.contact-subtitle { color: #ccc; font-size: 1.1rem; margin: -20px 0 50px 0; font-weight: 400; text-align: left; }
.contact-options { display: flex; flex-direction: column; gap: 20px; }
.contact-option {
    background-color: rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 25px;
    display: flex; align-items: center; gap: 25px; border: 1px solid #444;
    transition: background-color 0.3s ease, transform 0.3s ease, border-color 0.3s ease; text-decoration: none;
}
.contact-option:hover { background-color: rgba(255, 255, 255, 0.1); border-color: var(--dido-orange); transform: translateY(-5px); }
.contact-option i { font-size: 2.5rem; color: var(--dido-medium-green); width: 40px; }
.contact-option-text h4 { margin: 0 0 5px 0; color: #fff; text-transform: none; font-size: 1.1rem; font-weight: 700; }
.contact-option-text p { margin: 0; color: #aaa; line-height: 1.4; font-size: 0.95rem; }
.contact-option-btn { margin-left: auto; color: var(--dido-orange); background-color: transparent; height: 40px; width: 40px; font-size: 2rem; transition: transform 0.3s ease; }
.contact-option:hover .contact-option-btn { transform: translateX(5px); }
.contact-image {
    height: 100%; width: 100%;
    background-image: linear-gradient(to right, var(--dark-bg) 0%, rgba(33,33,33,0.5) 50%, rgba(33,33,33,0) 100%), url('images/chocolates.jpg');
    background-size: cover; background-position: center;
}

/* --- Botón Flotante WhatsApp --- */
#whatsapp-button { position: fixed; bottom: 30px; right: 30px; background-color: #25D366; width: 60px; height: 60px; border-radius: 50%; display: flex; justify-content: center; align-items: center; box-shadow: 2px 2px 10px rgba(0,0,0,0.4); z-index: 1001; transform: scale(0); transition: transform 0.4s ease; text-decoration: none; font-size: 32px; color: white; }
#whatsapp-button.visible { transform: scale(1); }

/* --- Footer --- */
.footer { background-color: #1c1c1c; padding: 60px 0 20px 0; color: #ccc; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.5fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 25px; }
.footer-logo img { max-width: 180px; margin-bottom: 15px; filter: brightness(0) invert(1); }
.footer-about { font-size: 0.9rem; color: #aaa; padding-right: 20px; }
.footer-links, .footer-contact { list-style: none; padding: 0; }
.footer-links li, .footer-contact li { margin-bottom: 15px; }
.footer-links a { color: #ccc; text-decoration: none; transition: color 0.3s ease; }
.footer-links a:hover { color: var(--dido-orange); }
.footer-contact li { display: flex; align-items: center; gap: 10px; }
.footer-contact i { color: var(--dido-orange); }
.social-icons { display: flex; gap: 15px; }
.social-icons a { color: #ccc; font-size: 1.5rem; transition: color 0.3s ease; }
.social-icons a:hover { color: var(--dido-orange); }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid #333; font-size: 0.9rem; color: #888; }

/* --- Media Queries --- */
@media (max-width: 1024px) {
    .product-grid { 
        grid-template-columns: repeat(2, 1fr); 
    } 
    .product-card { height: 400px; } 

    .contact-grid { grid-template-columns: 1fr; }
    .contact-image { display: none; }
    .contact-info { padding: 80px 40px; }
    .contact-info .section-title, .contact-subtitle { text-align: center; }
    .contact-info::before {
        left: 50%; top: 0; transform: translateX(-50%);
        width: 30%; height: 5px; border-radius: 0 0 5px 5px;
    }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* --- Media Query para Tablets y Móviles --- */
@media (max-width: 992px) {
    .navbar-links-left, .navbar-links-right { display: none; }

    .navbar-container {
        padding: 5px 20px;
        justify-content: center;
        min-height: 60px;
    }

    .navbar-logo {
        height: 60px;
        width: 150px;
    }
    
    .nav-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 2px solid var(--dido-dark-green);
        border-radius: 5px;
        width: 40px;
        height: 40px;
        cursor: pointer;
        z-index: 1003;
        padding: 0;
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    .nav-toggle-btn i {
        font-size: 1.4rem;
        color: var(--dido-dark-green);
        text-shadow: none;
    }

    .about-grid { grid-template-columns: 1fr; }
    .about-image { margin-bottom: 40px; }
    .flipper { height: 350px; } 
    .hero-content h1 { font-size: 2.8rem; }
    .hero-subtitle { font-size: 1.2rem; }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-about { padding-right: 0; }
    .footer-contact li, .social-icons { justify-content: center; }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.4rem; 
        line-height: 1.3;
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
}