/* ===== HEADER CORREGIDO CON SCROLL HORIZONTAL PARA TABLETS ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 5px 50px;
    box-sizing: border-box;
}

header.scrolled {
    background-color: white;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    padding: 4px 50px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-container img {
    height: 55px;
    width: auto;
    transition: all 0.3s ease;
}

nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Personalizar scrollbar del menú */
nav::-webkit-scrollbar {
    height: 3px;
}

nav::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

nav::-webkit-scrollbar-thumb {
    background: #00b4d8;
    border-radius: 10px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 28px;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s ease;
    letter-spacing: 0.3px;
    position: relative;
    color: #333;
    white-space: nowrap;
}

.nav-menu li a:hover {
    color: #00b4d8;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #00b4d8;
    transition: width 0.3s ease;
}

.nav-menu li a:hover::after {
    width: 100%;
}

/* Ajuste de la barra de botones superior */
header > div:first-child {
    padding: 4px 20px 0 20px !important;
    margin-bottom: -5px !important;
}

/* ===== RESPONSIVE DEL HEADER ===== */
@media (max-width: 1024px) {
    header,
    header.scrolled {
        padding: 5px 30px;
    }
    
    nav {
        overflow-x: auto;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .nav-menu li a {
        font-size: 13px;
    }
    
    .logo-container img {
        height: 50px;
    }
}

/* iPad Air y tablets específicamente */
@media (min-width: 768px) and (max-width: 1024px) {
    nav {
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .nav-menu {
        padding-right: 20px;
    }
}

@media (max-width: 768px) {
    header,
    header.scrolled {
        padding: 5px 20px;
    }

    .nav-container {
        flex-direction: column;
        gap: 8px;
    }
    
    nav {
        width: 100%;
        justify-content: center;
        overflow-x: auto;
    }

    .nav-menu {
        gap: 18px;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .nav-menu li a {
        font-size: 13px;
        white-space: nowrap;
    }
    
    .logo-container img {
        height: 45px;
    }
    
    header > div:first-child {
        padding: 4px 15px 0 15px !important;
    }
}

@media (max-width: 480px) {
    header,
    header.scrolled {
        padding: 5px 12px;
    }
    
    nav {
        overflow-x: auto;
    }
    
    .nav-menu {
        gap: 14px;
    }
    
    .nav-menu li a {
        font-size: 12px;
    }
    
    .logo-container img {
        height: 40px;
    }
    
    header > div:first-child {
        padding: 4px 10px 0 10px !important;
    }
}