/* ============================
   Header Styles
   ============================ */

/* Header base */
header {
    width: 100%;
    z-index: 1000;
}

/* Header Inicio (transparente sobre slider) */
.header-inicio {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-inicio .top-bar {
    background-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.header-inicio .social-link {
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.header-inicio .social-link:hover {
    opacity: 1;
}

.header-inicio .navbar {
    background-color: rgba(255, 255, 255, 0.05);
    height: 80px;
    padding: 0;
}

.header-inicio .logo-header {
    max-height: 50px;
    /* Reduced from 54px to match interior */
}

.container-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1500px !important;
    padding: 0 71px !important;
    height: 100%;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-inicio .logo-text {
    color: white;
    font-size: 32px;
    font-weight: 800;
}

.header-inicio .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.header-inicio .navbar-toggler svg {
    color: white;
}

.header-inicio .navbar-nav {
    gap: 0;
    /* Remove gap in favor of link padding */
}

.header-inicio .nav-link {
    color: white !important;
    font-size: 14px;
    /* Reduced from 16px to match interior */
    font-weight: 400;
    text-transform: uppercase;
    padding: 8px 16px;
    /* Added padding to match interior */
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.header-inicio .nav-link:hover {
    opacity: 0.8;
}

.header-inicio .nav-link.active {
    font-weight: 700;
}

.header-inicio .btn-lang {
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 500;
}

.header-inicio .btn-zona-privada {
    color: white;
    border: 1px solid white;
    border-radius: 6px;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s ease;
    min-width: 150px;
    /* Increased from 142 to prevent wrapping */
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
}

.header-inicio .btn-zona-privada:hover {
    background-color: white;
    color: #3F649C;
}

/* Header Interior (blanco con sombra) */
.header-interior {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-interior .top-bar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.header-interior .social-link {
    color: #666;
    transition: color 0.3s ease;
}

.header-interior .social-link:hover {
    color: var(--color-azul);
}

.header-interior .navbar {
    background-color: rgba(255, 255, 255, 0.05);
}

.header-interior .logo-header {
    max-height: 50px;
}

.header-interior .logo-text {
    color: var(--color-azul);
    font-size: 32px;
    font-weight: 800;
}

.header-interior .navbar-toggler {
    border-color: rgba(0, 0, 0, 0.2);
}

.header-interior .nav-link {
    color: white !important;
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    padding: 8px 16px;
    transition: color 0.3s ease;
}

.header-interior .nav-link:hover {
    color: var(--color-azul) !important;
}

.header-interior .nav-link.active {
    color: white !important;
    font-weight: 700;
}

.header-interior .btn-lang {
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 500;
}

.header-interior .btn-zona-privada {
    color: white;
    border: 1px solid white;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.header-interior .btn-zona-privada:hover {
    background-color: var(--color-azul);
    color: white;
}

/* Header Light (para páginas con fondo claro como login-clientes) */
.header-light {
    background-color: white !important;
}

.header-light .nav-link {
    color: #333 !important;
}

.header-light .nav-link:hover {
    color: var(--color-azul) !important;
}

.header-light .nav-link.active {
    color: var(--color-azul) !important;
    font-weight: 700;
}

.header-light .btn-lang {
    color: #333;
}

.header-light .btn-zona-privada {
    color: var(--color-azul);
    border: 1px solid var(--color-azul);
}

.header-light .btn-zona-privada:hover {
    background-color: var(--color-azul);
    color: white;
}

.header-light .navbar-toggler svg {
    color: #333;
}

/* Dropdown de idioma */
.btn-lang::after {
    margin-left: 4px;
}

.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: var(--color-gris-1);
}

.dropdown-item.active {
    background-color: var(--color-azul);
    color: white;
}

/* Mobile styles */
@media (max-width: 991px) {

    header,
    .header-inicio {
        position: fixed !important;
        background-color: white !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    }

    .header-inicio .navbar,
    .header-interior .navbar {
        background-color: white !important;
    }

    .header-inicio .nav-link,
    .header-interior .nav-link,
    .header-inicio .nav-link.active,
    .header-interior .nav-link.active,
    .header-inicio .btn-lang,
    .header-interior .btn-lang,
    .header-inicio .logo-text,
    .header-interior .logo-text {
        color: #333 !important;
    }

    .header-inicio .navbar-toggler,
    .header-interior .navbar-toggler,
    .header-inicio .navbar-toggler svg {
        color: #333 !important;
        border-color: rgba(0, 0, 0, 0.2) !important;
    }

    .logo-header.d-block.d-lg-none {
        max-width: 140px;
        /* Reducimos el ancho para que no desplace al botón */
        height: auto;
    }

    .container-navbar {
        padding: 0 20px !important;
        /* Ajuste el padding lateral que en escritorio era muy grande */
    }

    .header-inicio .btn-zona-privada {
        color: var(--color-azul) !important;
        background-color: transparent !important;
        border: 1px solid var(--color-azul) !important;
    }

    .header-inicio .navbar-collapse {
        background-color: white !important;
        padding: 20px;
        margin-top: 10px;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .header-interior .navbar-collapse {
        background-color: white;
        padding: 20px;
        margin-top: 10px;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .navbar-nav {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .nav-link {
        padding: 12px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
    }

    .header-interior .nav-link {
        border-bottom: 1px solid #eee;
    }

    .btn-zona-privada {
        margin-top: 16px;
        width: 100%;
        text-align: center;
    }

    .dropdown {
        width: 100%;
        margin-top: 10px;
    }

    .btn-lang {
        width: 100%;
        text-align: left;
    }
}