/* ============ 01 · Barra superior y header ============ */

.barra-promo {
    position: relative;
    z-index: 60;
    background: var(--grad-soft);
    font-size: .85rem;
}

.barra-promo[hidden] { display: none; }

.barra-promo__fila {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 40px;
    padding-block: 6px;
}

.barra-promo__texto { margin: 0; text-align: center; }
.barra-promo__texto a { text-decoration: underline; font-weight: 700; }

.barra-promo__cerrar {
    position: absolute;
    right: var(--gutter);
    display: grid;
    place-items: center;
    width: 26px; height: 26px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .28);
    color: var(--sobre-acento);
    cursor: pointer;
}
.barra-promo__cerrar:hover { background: rgba(0, 0, 0, .5); }

/* El circulo mide 26px porque mas grande recarga la barra, pero con el dedo
   eso no se acierta. Se agranda solo el area sensible hasta 44px, sin tocar
   lo que se ve. Mismo recurso en .redes a del pie. */
.barra-promo__cerrar::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
}

/* --- Cabecera --- */

.cabecera {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-velo);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: background-color .25s ease, border-color .25s ease;
}

.cabecera.compacta {
    background: var(--bg-velo-fuerte);
    border-bottom-color: var(--border);
}

.cabecera__fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 84px;   /* acompaña al logo más grande */
}

/* --- Logo ---
   Es un PNG blanco sobre transparente entregado por el cliente. Se
   sirve al doble del tamaño en que se muestra para que se vea nítido
   en pantallas de alta densidad; el alto lo fija el CSS y el ancho
   sale solo. */

.logo { display: inline-flex; align-items: center; }

.logo img {
    height: 40px;
    width: auto;
}

/* --- Menu principal --- */

.navegacion { display: flex; align-items: center; gap: 28px; }

.navegacion__lista { display: flex; align-items: center; gap: 4px; }

.navegacion__enlace {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text-soft);
    font: inherit;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease;
}

.navegacion__enlace:hover,
.navegacion__enlace[aria-expanded="true"] {
    color: var(--text);
    background: rgba(255, 255, 255, .06);
}

.navegacion__enlace.activo { color: var(--accent); }

/* --- Desplegable de servicios --- */

.navegacion__item-desplegable { position: relative; }

.desplegable {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 264px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.navegacion__item-desplegable.abierto .desplegable {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.desplegable a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: .88rem;
}

.desplegable a:hover { background: rgba(255, 255, 255, .07); color: var(--text); }

.navegacion__cta { padding-inline: 22px; }

/* --- Boton hamburguesa --- */

.hamburguesa {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 44px;   /* minimo tocable */
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: none;
    cursor: pointer;
}

.hamburguesa span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .22s ease, opacity .18s ease;
}

.hamburguesa[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburguesa[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburguesa[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Telefono --- */

@media (max-width: 900px) {
    .hamburguesa { display: flex; }

    .navegacion {
        position: fixed;
        inset: 0;
        z-index: 55;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: 18px;
        padding: 80px 24px 40px;
        background: var(--bg);
        /* Cerrado se oculta con opacidad, no corrido hacia la derecha:
           un panel fijo desplazado fuera de pantalla ensancha la página
           y en el teléfono se podía arrastrar hacia el costado. */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
        overflow-y: auto;
    }

    /* backdrop-filter convierte a la cabecera en el bloque contenedor
       de sus hijos position:fixed: el panel del menú quedaba del alto
       de la cabecera. Con el menú abierto se quita el desenfoque. */
    /* Logo y botón de cerrar quedan por encima del panel abierto */
    .cabecera .logo,
    .hamburguesa { position: relative; z-index: 60; }

    .cabecera:has(.navegacion.abierta) {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .navegacion.abierta {
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: opacity .25s ease, transform .25s ease, visibility 0s;
    }

    .navegacion__lista { flex-direction: column; align-items: stretch; gap: 2px; }

    .navegacion__enlace {
        justify-content: space-between;
        width: 100%;
        padding: 15px 16px;
        font-size: .95rem;
    }

    .desplegable {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        margin: 4px 0 8px;
        box-shadow: none;
        background: rgba(255, 255, 255, .04);
    }

    .navegacion__item-desplegable.abierto .desplegable { display: block; }

    .navegacion__cta { margin-top: 10px; }
}
