/* =========================================================================
   HEADER PROPIO DE LAS LANDINGS DE SERVICIOS (.phh)
   Sustituye a la barra de Astra solo en esas landings. Ver
   inc/landings/partials/site-header.php para dónde se engancha y por qué.
   ========================================================================= */
.phh {
    --phh-yellow: #ffd200;
    --phh-ink: #171717;
    position: relative;
    z-index: 500;
    width: 100%;
    height: 112px;
    background: #fff;
    border-bottom: 1px solid #eee;
    font-family: 'Montserrat', sans-serif;
}

.phh * {
    box-sizing: border-box;
}

.phh__inner {
    max-width: 1750px;
    height: 100%;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

/* ============ LOGO ============ */
.phh__logo {
    display: flex;
    align-items: center;
    flex: none;
}

.phh__logo img {
    display: block;
    height: 44px;
    width: auto;
}

.phh__logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--phh-ink);
    letter-spacing: -0.01em;
}

.phh__logo-text strong {
    font-weight: 800;
}

/* ============ NAV (escritorio) ============
   El menú y los botones van agrupados a la derecha, junto al logo a la
   izquierda: ninguno de los dos lleva flex:1, así que no se estiran — es
   .phh__inner (justify-content:space-between) quien reparte el espacio
   entre ambos bloques. */
.phh__panel {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 100%;
}

.phh__nav {
    flex: none;
    height: 100%;
}

.phh__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 36px;
}

.phh__link,
.phh__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    padding: 0;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--phh-ink);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.phh__link:hover,
.phh__trigger:hover {
    color: #000;
}

.phh__chevron {
    flex: none;
    transition: transform 0.2s ease;
}

.phh__item--dropdown.is-open .phh__chevron {
    transform: rotate(180deg);
}

/* ============ DESPLEGABLES ============ */
.phh__item {
    /* Estira cada item a toda la altura de la barra (no solo la de su
       texto): así el desplegable, pegado con top:100% al propio <li>,
       cuelga del borde inferior real de la barra en vez de la mitad. */
    position: relative;
    align-self: stretch;
    display: flex;
    align-items: center;
}

.phh__dropdown {
    position: absolute;
    /* Pegado al trigger (sin hueco): un hueco vacío ahí rompería el hover,
       porque el ratón "sale" del <li> al bajar hacia el panel antes de
       llegar a él. La separación visual la da la línea amarilla, no el
       espacio en blanco. */
    top: 100%;
    left: 0;
    min-width: 260px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #fff;
    border-top: 3px solid var(--phh-yellow);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.phh__item--dropdown.is-open .phh__dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Escritorio: además de con clic (JS, is-open), se abre al pasar el ratón. */
@media (min-width: 1025px) {
    .phh__item--dropdown:hover .phh__dropdown {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .phh__item--dropdown:hover .phh__chevron {
        transform: rotate(180deg);
    }
}

.phh__dropdown li {
    border-bottom: 1px solid #eee;
}

.phh__dropdown li:last-child {
    border-bottom: 0;
}

.phh__dropdown a {
    display: block;
    padding: 13px 20px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--phh-ink);
    text-decoration: none;
}

.phh__dropdown a:hover {
    background: #f6f6f6;
}

.phh__dropdown a.is-current {
    background: #f0f0f0;
    font-weight: 700;
}

/* ============ BOTONES ============ */
.phh__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
}

.phh__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 24px;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.phh__btn:hover {
    opacity: 0.88;
}

.phh__btn--dark {
    background: var(--phh-ink);
    color: #fff !important;
}

.phh__btn--yellow {
    background: var(--phh-yellow);
    color: #111 !important;
}

/* ============ MENÚ MÓVIL ============ */
.phh__burger {
    display: none;
    flex: none;
    width: 32px;
    height: 24px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
}

.phh__burger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--phh-ink);
}

.phh.is-menu-open .phh__burger span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

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

.phh.is-menu-open .phh__burger span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

@media (max-width: 1024px) {
    .phh__inner {
        padding: 0 24px;
    }

    .phh__burger {
        display: flex;
    }

    .phh__panel {
        display: none;
    }

    .phh.is-menu-open .phh__panel {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #eee;
        box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
        max-height: calc(100vh - 112px);
        overflow-y: auto;
    }

    .phh.is-menu-open .phh__menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0;
    }

    .phh__item {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .phh__link,
    .phh__trigger {
        width: 100%;
        padding: 16px 24px;
        justify-content: space-between;
    }

    /* En móvil el desplegable no flota: empuja el resto del menú hacia abajo.
       Sin línea amarilla mientras está cerrado (border-top:0): si no, se
       queda una rayita amarilla permanente bajo cada item con submenú
       aunque esté plegado, porque el borde no desaparece solo por que la
       caja mida 0 de alto. */
    .phh__dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        pointer-events: none;
        transform: none;
        border-top: 0;
        box-shadow: none;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        transition: max-height 0.2s ease, border-top-width 0.2s ease;
    }

    .phh__item--dropdown.is-open .phh__dropdown {
        border-top: 3px solid var(--phh-yellow);
    }

    .phh__item--dropdown.is-open .phh__dropdown {
        pointer-events: auto;
        max-height: 600px;
        padding: 0 0 8px;
    }

    .phh__dropdown a {
        padding: 12px 24px 12px 36px;
    }

    .phh.is-menu-open .phh__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 16px 24px 24px;
        border-top: 1px solid #f0f0f0;
        margin-top: 8px;
    }

    .phh__btn {
        width: 100%;
    }
}
