/* Header fijo, menú móvil lateral y marca */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--c-dark);
    transition: box-shadow 0.3s ease;
}

.main-header.scrolled {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    height: var(--header-h);
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 4%;
}

/* ---------- Marca ---------- */
.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
}

/* El glifo del logotipo es neón sobre fondo transparente: se muestra directamente
   sobre el índigo del header, sin recuadro que lo separe del fondo. */
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--brand-mark);
    height: var(--brand-mark);
    flex-shrink: 0;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Respaldo si el logotipo no carga: iniciales en el acento de marca */
.brand-mark--fallback {
    border: 2px solid var(--c-accent);
    border-radius: 6px;
}

.brand-mark--fallback::before {
    content: 'AD';
    font-family: var(--font-titles);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--c-accent-on-dark);
}

.brand-name {
    font-family: var(--font-titles);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--c-on-dark);
    white-space: nowrap;
}

/* ---------- Navegación ---------- */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    margin-left: auto;
}

.nav-link {
    position: relative;
    padding: 0.6rem 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--c-on-dark);
    white-space: nowrap;
    transition: color 0.25s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 3px;
    background-color: var(--c-accent);
    transition: width 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--c-accent-on-dark);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* El CTA del menú solo se usa en la versión móvil */
.btn-nav-cta {
    display: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-shrink: 0;
}

.btn-header-cta {
    min-height: 42px;
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-lang {
    min-width: 42px;
    min-height: 36px;
    padding: 0.3rem 0.7rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    color: var(--c-on-dark);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease;
}

.btn-lang:hover {
    border-color: var(--c-accent-on-dark);
    color: var(--c-accent-on-dark);
}

/* ---------- Botón de menú ---------- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 44px;
    height: 44px;
    padding: 13px 10px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--c-on-dark);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ---------- Pantallas medianas y pequeñas ---------- */
@media (max-width: 1180px) {
    .nav-menu {
        gap: 1.2rem;
    }

    .nav-link {
        font-size: 0.86rem;
    }
}

@media (max-width: 1080px) {
    .btn-header-cta {
        display: none;
    }
}

@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(310px, 86vw);
        height: 100vh;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.6rem;
        padding: calc(var(--header-h) + 1.5rem) 2rem 2rem;
        background-color: var(--c-dark);
        box-shadow: -6px 0 28px rgba(0, 0, 0, 0.4);
        overflow-y: auto;
        transition: right 0.35s ease;
    }

    .nav-menu.open {
        right: 0;
    }

    .nav-link {
        width: 100%;
        font-size: 1.05rem;
    }

    .btn-nav-cta {
        display: inline-flex;
        width: 100%;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .brand-name {
        font-size: 0.95rem;
    }

    .brand-mark {
        width: var(--brand-mark-sm);
        height: var(--brand-mark-sm);
    }
}
