/* ==================== SCROLL SUAVE GLOBAL ==================== */
html {
    scroll-behavior: smooth;
}

/* ==================== IMPORTAR FUENTE ==================== */
@import url('https://fonts.googleapis.com/css2?family=Merriweather+Black&display=swap');

/* ============================================================
   ESTILOS BASE (ESCRITORIO - Por defecto)
============================================================ */
.navbar {
    background-color: #349B7D;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 10px 7px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.navbar-logo img {
    height: 50px;
    transition: opacity 0.3s ease;
}
.navbar-logo:hover img {
    opacity: 0.8;
}

.navbar-links {
    list-style: none;
    display: flex;
    gap: 1rem;
    padding: 0;
    margin: 0;
}
.navbar-link {
    text-decoration: none;
    color: #fff;
    font-family: 'Merriweather Black', serif;
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.navbar-link:hover {
    background-color: #F8AE00;
    color: #fff;
}

/* Dropdowns Escritorio */
.navbar-item.dropdown {
    position: relative;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 5px;
    padding: 10px 0;
    z-index: 1001;
    min-width: 200px;

    /* ====== Agregado para scroll ====== */
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}
.dropdown-menu .dropdown-item {
    display: block;
    padding: 8px 20px;
    color: #333;
    font-family: 'Merriweather Black', serif;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.dropdown-menu .dropdown-item:hover {
    background-color: #F8AE00;
    color: #fff;
}
.navbar-item:hover .dropdown-menu {
    display: block;
}

/* Visibilidad por dispositivo */
.desktop-only {
    display: flex;
}
.mobile-only,
.mobile-bottom-nav {
    display: none;
}

/* ============================================================
   RESPONSIVE PARA TABLETS
============================================================ */
@media screen and (max-width: 1024px) {
    .navbar-container {
        padding: 0 50px;
    }
}

/* ============================================================
   RESPONSIVE PARA MÓVIL
============================================================ */
@media screen and (max-width: 768px) {
    .navbar-container {
        padding: 0 20px;
        justify-content: center;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: flex;
    }

    .navbar-logo {
        margin: auto;
    }

    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        background-color: #349B7D;
        border-top: 1px solid #ccc;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        padding: 0.5rem 0;
    }

    .mobile-nav-item {
        position: relative;
        text-align: center;
    }

    .mobile-nav-item .main-btn {
        background: none;
        border: none;
        font-size: 1.2rem;
        color: #fff;
        display: flex;
        flex-direction: column;
        align-items: center;
        font-weight: bold;
        cursor: pointer;
    }

    .mobile-nav-item .main-btn span {
        font-size: 0.75rem;
        margin-top: 0.2rem;
    }

    .sub-menu {
        display: none;
        position: absolute;
        bottom: 100%;
        left: 5px;
        background-color: white;
        border: 1px solid #ccc;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 0.5rem;
        max-width: 90vw;
        box-sizing: border-box;
        text-align: left;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, transform 0.3s ease;
        border-radius: 8px;
        pointer-events: none;

        /* ===== Scroll agregado para móvil ===== */
        max-height: 300px;
        overflow-y: auto;
    }

    .sub-menu a {
        display: block;
        text-decoration: none;
        padding: 0.5rem;
        color: #333;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .sub-menu a:hover {
        background-color: #f0f0f0;
        color: #349B7D;
    }

    .mobile-nav-item.active .sub-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(-10px);
        pointer-events: auto;
    }
}

/* ============================================================
   ANIMACIONES
============================================================ */
@keyframes fade-slide-up {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
