/* =========================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================= */
:root {
    --primary: #86B817;       /* Verde Ecoturismo */
    --primary-dark: #6da30f;  /* Verde Oscuro para Hover */
    --secondary: #03045e;     /* Azul Profundo */
    --dark: #14141F;          /* Texto Oscuro */
    --light: #F0F2F5;         /* Fondos Claros */
    --white: #ffffff;
    --text: #555555;          /* Texto de párrafos */
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Nunito', sans-serif; color: var(--text); background: var(--white); font-size: 18px; line-height: 1.6; overflow-x: hidden; }
h1, h2, h3, h4, h5, h6 { color: var(--dark); font-weight: 800; line-height: 1.2; margin-bottom: 15px; }
a { text-decoration: none; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* UTILIDADES */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* =========================================
   2. HEADER Y MENÚ (CORREGIDO + DESPLEGABLE)
   ========================================= */
header { background: var(--white); padding: 10px 0; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.nav-links { display: flex; gap: 25px; align-items: center; } /* Añadido align-items */
.nav-links a { color: var(--dark); font-weight: 700; font-size: 15px; }
.nav-links a:hover { color: var(--primary); }

.menu-toggle { 
    display: none; 
    font-size: 1.8rem; 
    cursor: pointer; 
    color: var(--primary); 
}

/* --- ESTILOS DEL MENÚ DESPLEGABLE (NUEVO) --- */
.nav-links li.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none; /* Oculto por defecto */
    position: absolute;
    background-color: var(--white);
    min-width: 240px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.15);
    z-index: 1000;
    border-radius: 8px;
    padding: 10px 0;
    top: 100%; /* Justo debajo del botón */
    left: 0;
    text-align: left;
    border-top: 3px solid var(--primary); /* Detalle visual bonito */
}

.dropdown-content li {
    display: block;
    margin: 0;
}

.dropdown-content li a {
    color: #333;
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: background 0.3s;
    font-weight: 500; /* Un poco menos negrita que el menú principal */
}

.dropdown-content li a:hover {
    background-color: #f1f1f1;
    color: var(--primary);
    padding-left: 25px; /* Efecto de desplazamiento */
}

/* Mostrar menú al hacer hover */
.nav-links li.dropdown:hover .dropdown-content {
    display: block;
}
/* ------------------------------------------ */


/* =========================================
   3. HERO
   ========================================= */
.hero {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('img/islas-marietas-mexico.webp') center/cover no-repeat;
    padding: 120px 0;
    text-align: center;
    color: var(--white);
}
.hero-title { color: #fff !important; font-size: clamp(2.5rem, 5vw, 3.5rem); text-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.hero p { color: #fff; font-size: 1.3rem; max-width: 800px; margin: 0 auto 30px; font-weight: 600; text-shadow: 1px 1px 5px rgba(0,0,0,0.3); }

/* =========================================
   4. BOTONES
   ========================================= */
.btn { display: inline-block; background: var(--primary); color: var(--white); padding: 12px 30px; border-radius: 50px; font-weight: 700; border: none; cursor: pointer; transition: 0.3s; }
.btn:hover { background: var(--secondary); transform: translateY(-2px); color: white; }
.btn-white { background: var(--white); color: var(--dark) !important; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }

/* =========================================
   5. SECCIONES Y TOURS
   ========================================= */
.experts-section { padding: 60px 20px; }
.flex-layout { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; }
.flex-image, .flex-content { flex: 1; min-width: 300px; }
.flex-image img { border-radius: 10px; box-shadow: var(--shadow); }

#tours { padding: 40px 20px; } 
.tours-grid { display: flex; flex-wrap: wrap; gap: 25px; justify-content: center; }

.tour-item { 
    background: var(--white); 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: var(--shadow); 
    flex: 1 1 300px; 
    max-width: 380px; 
    transition: 0.3s;
    border-bottom: 5px solid transparent; 
}
.tour-item:hover { 
    transform: translateY(-5px); 
    border-bottom: 5px solid var(--primary); 
}
.tour-content { padding: 25px; text-align: center; }

/* =========================================
   6. NUEVA GALERÍA (FORMATO CUADRÍCULA PROFESIONAL)
   ========================================= */
.gallery-section { padding: 60px 20px 80px 20px; background: var(--white); text-align: center; }
.gallery-section h2 { color: var(--primary); margin-bottom: 35px; }
.subtitle { color: #999; font-weight: 800; letter-spacing: 2px; margin-bottom: 10px; display: block; }

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.photo-item {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.photo-item:hover {
    transform: translateY(-5px);
}

.photo-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.photo-caption {
    padding: 15px;
    font-size: 0.9rem;
    color: var(--text);
    text-align: left;
    line-height: 1.4;
    border-top: 1px solid #eee;
}

.photo-caption strong {
    color: var(--primary);
    display: block;
    margin-bottom: 5px;
}

/* =========================================
   7. PROYECTOS
   ========================================= */
.projects-section { background: var(--light); padding: 100px 20px; margin-top: 0; }
.projects-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.project-card { 
    background: var(--white); padding: 30px 20px; border-radius: 12px; 
    text-align: center; box-shadow: var(--shadow); flex: 1 1 200px; 
    max-width: 230px; transition: 0.3s; border-bottom: 4px solid transparent; 
}
.project-card:hover { transform: translateY(-5px); border-bottom: 4px solid var(--primary); }
.project-icon { font-size: 2.5rem; display: block; margin-bottom: 15px; }

/* =========================================
   8. RESERVA
   ========================================= */
.booking-section { padding: 100px 0; background: var(--white); }
.booking-form { background: var(--light); padding: 40px; border-radius: 20px; max-width: 600px; margin: 0 auto; }
.booking-form input, .booking-form select { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; margin-bottom: 10px; }

/* =========================================
   9. FOOTER
   ========================================= */
footer { background: var(--secondary); color: white; padding: 60px 0; text-align: center; }
.footer-logo { width: 200px; height: auto; margin: 0 auto 20px auto; display: block; }
.footer-contact p { margin-bottom: 10px; font-size: 0.95rem; color: #e0e0e0; }
.footer-contact i { margin-right: 10px; color: var(--primary); width: 20px; }
.footer-contact a { color: #e0e0e0; transition: 0.3s; text-decoration: none; }
.footer-contact a:hover { color: var(--primary); text-decoration: underline !important; }

.footer-social { margin-top: 30px; display: flex; justify-content: center; gap: 15px; }
.footer-social a { 
    display: flex; align-items: center; justify-content: center; 
    width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, 0.3); 
    border-radius: 50%; color: white; font-size: 16px; transition: 0.3s; 
}
.footer-social a:hover { background-color: var(--primary); border-color: var(--primary); transform: translateY(-3px); }

/* =========================================
   10. RESPONSIVE Y MENÚ MÓVIL (CORREGIDO Y ADAPTADO)
   ========================================= */
@media (max-width: 768px) {
    .nav-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    header .btn {
        padding: 8px 15px !important;
        font-size: 0.85rem !important;
        white-space: nowrap;
        order: 2;
    }

    .menu-toggle { 
        display: block !important; 
        order: 1;
        margin-left: auto;
        margin-right: 10px;
    }

.nav-links {
        display: none;
        flex-direction: column;
        position: fixed; /* CAMBIO: De absolute a fixed para que se quede quieto */
        top: 65px;       /* Altura aproximada de tu header */
        left: 0;
        width: 100%;
        height: calc(100vh - 65px); /* CAMBIO: Altura máxima = 100% de la pantalla menos el header */
        background-color: var(--secondary);
        padding: 30px 30px 80px 30px; /* Padding extra abajo para que no se corte el último botón */
        text-align: center;
        z-index: 1001;
        overflow-y: auto; /* CAMBIO CLAVE: Permite hacer scroll DENTRO del menú */
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }

    .nav-links.active { display: flex !important; }
    .nav-links li { margin: 15px 0; }
    .nav-links li a { color: var(--white) !important; font-size: 1.2rem; font-weight: 700; }

    /* ESTILOS ESPECÍFICOS PARA EL DROPDOWN EN MÓVIL */
    .dropdown-content {
        position: static; /* Ya no flota */
        display: block; /* Siempre visible o lista plana */
        box-shadow: none;
        background: transparent;
        padding: 0;
        border-top: none;
        margin-top: 10px;
        padding-left: 0;
    }
    
    .dropdown-content li {
        margin: 5px 0; /* Menos margen que los items principales */
    }

    .dropdown-content li a {
        color: #ddd !important; /* Un poco más gris para diferenciar */
        font-size: 1rem !important; /* Más pequeño que el menú principal */
        font-weight: 400 !important;
        padding: 5px 0;
    }
    
    .dropdown-content li a:hover {
        padding-left: 0; /* Sin desplazamiento en móvil */
        background: transparent;
        color: var(--primary) !important;
    }
    /* ----------------------------------------------- */

    .hero-title { font-size: 2.2rem; }
    .flex-layout { flex-direction: column; text-align: center; }
    section { padding: 40px 15px; }
    
    .photo-gallery { grid-template-columns: 1fr; }

    .tour-detail-layout {
        flex-direction: column;
        padding: 40px 15px; 
    }

    .tour-sidebar, 
    .tour-main-content {
        position: static;
        order: -1; 
        width: 100%; 
        min-width: 0; 
    }

    .tour-sidebar {
        margin-bottom: 30px;
    }
}

/* =========================================
   11. POLÍTICAS, PRECIOS Y FAQ
   ========================================= */
.policy-block { margin-bottom: 60px; }
.policy-title { color: var(--primary); border-left: 5px solid var(--primary); padding-left: 15px; margin-bottom: 20px; }
.restrictions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 25px; }
.restriction-item { background: var(--light); padding: 20px; border-radius: 8px; font-weight: 700; color: #cc0000; border: 1px solid #ffd6d6; }

.price-box { margin: 15px 0; line-height: 1.4; }
.old-price { text-decoration: line-through; color: #999; font-size: 0.95rem; margin-right: 5px; }
.current-price { font-weight: 800; font-size: 1.5rem; color: var(--primary); }
.discount-badge { background-color: var(--primary); color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 700; display: inline-block; vertical-align: middle; margin-left: 5px; }
.p-row { margin-bottom: 8px; font-size: 0.9rem; }
.p-row strong { color: #555; margin-right: 5px; }

.faq-item { background: var(--white); border: 1px solid #eee; border-radius: 8px; margin-bottom: 15px; overflow: hidden; }
.faq-item summary { padding: 15px 20px; cursor: pointer; font-weight: 700; color: var(--secondary); background-color: #f9f9f9; display: flex; justify-content: space-between; align-items: center; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.5rem; }
.faq-item[open] summary::after { content: '-'; }
.faq-item p { padding: 20px; border-top: 1px solid #eee; color: #555; }

.tour-detail-layout { display: flex; flex-wrap: wrap; gap: 40px; padding: 60px 20px; }
.tour-main-content { flex: 2; min-width: 300px; }
.tour-sidebar { flex: 1; min-width: 300px; position: sticky; top: 100px; background: var(--white); padding: 30px; border-radius: 15px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); border: 1px solid #eee; }

.whatsapp-float { transition: transform 0.3s ease; }
.whatsapp-float:hover { transform: scale(1.1); background-color: #128C7E !important; }

.tour-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    background-color: #ffffff;
    color: #555;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-item i {
    color: var(--primary);
    font-size: 1.1rem;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* =======================================================
   12. LAYOUT DE ESCRITORIO (FIX FORMULARIO FLOTANTE)
   ======================================================= */
@media (min-width: 992px) {
    .tour-detail-layout {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
        gap: 40px;
    }

    .tour-main-content {
        flex: 1;
        max-width: 65%;
    }

    .tour-sidebar {
        width: 350px;
        flex-shrink: 0;
        position: sticky;
        top: 40px;
        margin-top: 0;
    }
}