.wp-block-onlines-header.header__wrapper,
.wp-block-onlines-header.header__wrapper::before,
.wp-block-onlines-header.header__wrapper::after,
.wp-block-onlines-header.header__wrapper *,
.wp-block-onlines-header.header__wrapper *::before,
.wp-block-onlines-header.header__wrapper *::after {
    box-sizing: border-box;
}

.wp-block-onlines-header.header__wrapper {
    position: relative;
    width: 100%;
    padding-top: 35px;
    padding-bottom: 35px;
}

.wp-block-onlines-header.header__wrapper.header--home-transparent {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 20;
    padding-top: 35px;
    padding-bottom: 35px;
    background: transparent;
}

.header__container {
    width: 100%;
    max-width: var(--wp--style--global--wide-size);
    margin: 0 auto;
}

.header__site-description-control {
    margin-top: 20px;
}

.header__site-description-control textarea {
    margin-top: 10px !important;
}

.header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
}

.header__logo-primary,
.header__overlay-branding {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
}

.header__overlay-branding {
    display: none;
}

.header__logo-primary {
    height: max(var(--header-logo-height-desktop, 35px), 32px);
}

.header__logo-primary .block-editor-inner-blocks,
.header__logo-primary .block-editor-block-list__layout,
.header__logo-primary .wp-block-site-logo,
.header__logo-primary h1,
.header__logo-primary h2 {
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0;
}

.header__logo-primary .custom-logo-link,
.header__logo-primary a {
    display: inline-flex;
    align-items: center;
    height: 100%;
    overflow: visible;
}

.header__logo-primary img {
    display: block;
    width: auto !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}

.header__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.header__toggle-lines {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 24px;
}

.header__toggle-lines span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--header-accent-color, #540640);
    transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease;
}

.header--home-transparent .header__toggle-lines span {
    background: var(--wp--preset--color--custom-blanco);
}

.header__backdrop {
    display: none;
}

.header__panel {
    flex: 0 1 auto;
}

.header__dialog,
.header__panel-body {
    display: flex;
    align-items: center;
    gap: 23px;
}

.header__panel-header,
.header__meta,
.header__mobile-search-form {
    display: none;
}

.header__nav {
    display: block;
}

.header__menu {
    display: flex;
    align-items: center;
    gap: var(--header-menu-gap-desktop, 27px);
    padding: 0;
    margin: 0;
    list-style: none;
}

.header__menu-item {
    margin: 0;
    font-weight: 500;
}

.header__menu-link,
.header__menu-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 7px 10px;
    border-radius: 999px;
    background: transparent;
    color: var(--header-menu-color-desktop, #540640);
    font-family: var(--wp--preset--font-family--greycliff-cf, "Greycliff CF", sans-serif);
    font-size: var(--header-menu-font-desktop, 14px);
    font-style: normal;
    font-weight: 500;
    line-height: 1.05;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.header--home-transparent .header__menu-link,
.header--home-transparent .header__menu-text,
.header--home-transparent .header__search-toggle {
    color: var(--wp--preset--color--custom-blanco);
}

.header__menu-link,
.header__menu-text,
.header__social-link,
.header__cta,
.header__search-toggle,
.header__search-close,
.header__search-submit {
    transition: opacity 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}

.header__menu:hover .header__menu-link,
.header__menu:hover .header__menu-text {
    opacity: 0.5;
}

.header__menu:hover .header__menu-item:hover .header__menu-link,
.header__menu:hover .header__menu-item:hover .header__menu-text,
.header__menu:hover .header__menu-item:focus-within .header__menu-link,
.header__menu:hover .header__menu-item:focus-within .header__menu-text {
    color: #FEC52D;
    opacity: 1;
}

.header__menu-item:hover > .header__menu-link,
.header__menu-item:hover > .header__menu-text,
.header__menu-item:focus-within > .header__menu-link,
.header__menu-item:focus-within > .header__menu-text {
    color: #FEC52D;
}

.header__menu-link:hover,
.header__menu-text:hover,
.header__menu-link:focus-visible,
.header__menu-text:focus-visible,
.header__menu-link.is-active,
.header__menu-text.is-active,
.header__social-link:hover,
.header__social-link:focus-visible,
.header__cta:hover,
.header__cta:focus-visible,
.header__search-toggle:hover,
.header__search-toggle:focus-visible,
.header__search-close:hover,
.header__search-close:focus-visible,
.header__search-submit:hover,
.header__search-submit:focus-visible {
    opacity: 0.82;
}

.header__menu-link:hover,
.header__menu-text:hover,
.header__menu-link:focus-visible,
.header__menu-text:focus-visible {
    /* background: #FEC52D; */
    color: #09364D;
    opacity: 1;
}

.header__menu-link:focus-visible,
.header__social-link:focus-visible,
.header__cta:focus-visible,
.header__toggle:focus-visible,
.header__close:focus-visible,
.header__search-toggle:focus-visible,
.header__search-close:focus-visible,
.header__search-input:focus-visible,
.header__search-submit:focus-visible,
.header__mobile-search-input:focus-visible,
.header__mobile-search-submit:focus-visible {
    outline: 2px solid var(--header-accent-color, #540640);
    outline-offset: 3px;
}

.header__search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: transparent;
    color: var(--header-menu-color-desktop, #540640);
    cursor: pointer;
}

.header__search-toggle svg,
.header__search-close svg,
.header__mobile-search-submit svg {
    display: block;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    fill: none;
}

.header__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 28px;
    border: 0;
    border-radius: 50px;
    background: var(--header-accent-color, #540640);
    color: var(--header-button-text-color, #ffffff);
    font-family: var(--wp--preset--font-family--creato-display, "Creato Display", sans-serif);
    font-size: var(--header-button-font-desktop, 14px);
    font-style: normal;
    font-weight: 700;
    line-height: 1.05;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.header__cta--static {
    cursor: default;
}

.header--home-transparent .header__cta {
    background: var(--wp--preset--color--custom-amarillo);
    color: var(--wp--preset--color--custom-azul);
}

.header__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--header-menu-color-mobile, #540640);
    cursor: pointer;
}

.header__close svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
    fill: none;
}

.header__site-description {
    color: var(--header-menu-color-mobile, #540640);
}

.header__socials {
    display: flex;
    align-items: center;
    font-size: 21px;
    gap: .5em;
}

.header__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--header-menu-color-mobile, #540640);
    line-height: 1;
    text-decoration: none;
    padding: 3px;
}

.header__social-link:first-of-type {
    padding-left: 0;
}

.header__social-link:last-of-type {
    padding-right: 0;
}

.header__social-icon,
.header__social-icon svg {
    display: block;
}

.header__social-icon svg {
    width: auto;
    height: 1em;
}

.header__search-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
    z-index: 1000;
}

.header__search-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.header__search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(21, 21, 21, 0.42);
}

.header__search-dialog {
    position: relative;
    width: min(100%, 720px);
    padding: 42px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(21, 21, 21, 0.18);
    transform: translateY(12px);
    transition: transform 0.28s ease;
}

.header__search-modal.is-open .header__search-dialog {
    transform: translateY(0);
}

.header__search-close {
    position: absolute;
    top: 18px;
    right: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--header-accent-color, #540640);
    cursor: pointer;
}

.header__search-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.header__search-label {
    color: var(--header-accent-color, #540640);
    font-family: var(--wp--preset--font-family--creato-display, "Creato Display", sans-serif);
    font-size: 30px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.1;
}

.header__search-field {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.header__search-input {
    width: 100%;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid rgba(84, 6, 64, 0.24);
    border-radius: 999px;
    background: #ffffff;
    color: #151515;
    font-family: var(--wp--preset--font-family--creato-display, "Creato Display", sans-serif);
    font-size: 18px;
    line-height: 1.2;
}

.header__search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 28px;
    border: 0;
    border-radius: 999px;
    background: var(--header-accent-color, #540640);
    color: #ffffff;
    font-family: var(--wp--preset--font-family--creato-display, "Creato Display", sans-serif);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.header__mobile-search-field {
    position: relative;
    width: 100%;
}

.header__mobile-search-input {
    width: 100%;
    min-width: 0;
    padding: 15px 58px 15px 18px;
    border: 1px solid rgba(84, 6, 64, 0.22);
    border-radius: 999px;
    background: #ffffff;
    color: #151515;
    font-family: var(--wp--preset--font-family--creato-display, "Creato Display", sans-serif);
    font-size: 16px;
    line-height: 1.2;
}

.header__mobile-search-submit {
    position: absolute;
    top: 50%;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--header-accent-color, #540640);
    color: #ffffff;
    transform: translateY(-50%);
    cursor: pointer;
}

@media (max-width: 1023px) {
    .wp-block-onlines-header.header__wrapper {
        --header-mobile-panel-offset: 118px;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .wp-block-onlines-header.header__wrapper.header--home-transparent {
        --header-mobile-panel-offset: 104px;
        padding-top: 28px;
        padding-bottom: 28px;
    }

    .wp-block-onlines-header.header__wrapper.is-menu-open {
        z-index: 1000;
        background: var(--wp--preset--color--custom-azul, #09364D);
    }

    .wp-block-onlines-header.header__wrapper.is-menu-open.header--home-transparent {
        background: var(--wp--preset--color--custom-azul, #09364D);
    }

    .wp-block-onlines-header.header__wrapper.is-menu-open::before {
        content: "";
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        height: var(--header-mobile-panel-offset, 118px);
        background: var(--wp--preset--color--custom-azul, #09364D);
        pointer-events: none;
        z-index: 1000;
    }

    .header__bar {
        gap: 16px;
        position: relative;
        z-index: 1003;
    }

    .header__logo-primary {
        height: max(var(--header-logo-height-mobile, 30px), 30px);
    }

    .header__toggle {
        display: inline-flex;
        margin-left: auto;
        position: relative;
        z-index: 1002;
    }

    .header__wrapper.is-menu-open .header__toggle-lines {
        position: relative;
        gap: 0;
        height: 24px;
    }

    .header__wrapper.is-menu-open .header__toggle-lines span {
        position: absolute;
        top: 50%;
        left: 0;
        background: var(--wp--preset--color--custom-blanco, #ffffff);
        transform-origin: center;
    }

    .header__wrapper.is-menu-open .header__toggle-lines span:nth-child(1) {
        transform: translateY(-50%) rotate(45deg);
    }

    .header__wrapper.is-menu-open .header__toggle-lines span:nth-child(2) {
        opacity: 0;
        transform: translateY(-50%) scaleX(0);
    }

    .header__wrapper.is-menu-open .header__toggle-lines span:nth-child(3) {
        transform: translateY(-50%) rotate(-45deg);
    }

    .header__backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: var(--header-backdrop-color, rgba(21, 21, 21, 0.28));
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.35s ease, visibility 0s linear 0.35s;
        z-index: 998;
    }

    .header__panel {
        position: fixed;
        top: var(--header-mobile-panel-offset, 118px);
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        align-items: stretch;
        justify-content: stretch;
        padding: 0 2rem 28px;
        background: var(--header-mobile-background, #ffffff);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 999;
        transition: opacity 0.35s ease, visibility 0s linear 0.35s;
    }

    .header__dialog {
        width: 100%;
        height: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 0;
        background: transparent;
        border-radius: 0;
        overflow: visible;
        transform: translateY(10px);
        transition: transform 0.35s ease;
    }

    .header__wrapper.is-menu-open .header__backdrop,
    .header__wrapper.is-menu-open .header__panel {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }

    .header__wrapper.is-menu-open .header__dialog {
        transform: translateY(0);
    }

    .header__panel-header {
        display: none;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 36px;
    }

    .header__overlay-branding {
        display: none;
        align-items: center;
    }

    .header__panel-body {
        flex: 1 1 auto;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 28px;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .header__mobile-search-form {
        display: block;
        width: 100%;
    }

    .header__nav {
        width: 100%;
    }

    .header__menu {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .header__menu-link,
    .header__menu-text {
        color: var(--header-menu-color-mobile, #540640);
        font-size: 20px;
        white-space: normal;
        text-align: left;
        padding: 17px 0;
        min-height: unset;
        border-radius: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .header__cta {
        width: 100%;
        font-size: var(--header-button-font-mobile, 14px);
    }

    .header__search-toggle {
        display: none;
    }

    .header__meta {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        margin-top: auto;
        padding-top: 28px;
        border-top: 1px solid #0000001a;
    }

    .header__site-description {
        flex: 0 0 50%;
        max-width: 50%;
        margin: 0;
        color: var(--header-menu-color-mobile, #540640);
        font-family: var(--wp--preset--font-family--creato-display, "Creato Display", sans-serif);
        font-size: 12px;
        font-style: normal;
        font-weight: 400;
        line-height: 1.4;
    }

    .header__socials {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        margin-left: auto;
    }

    .header__social-link {
        color: var(--header-menu-color-mobile, #540640);
        flex: 0 0 auto;
    }

    .header__search-dialog {
        width: min(100%, 560px);
        padding: 34px 20px 24px;
        border-radius: 18px;
    }

    .header__search-label {
        padding-right: 48px;
        font-size: 24px;
    }

    .header__search-field {
        flex-direction: column;
    }

    .header__search-submit {
        width: 100%;
    }

    /* Logo en el panel — usa la altura mobile */
    .header__overlay-branding .header__logo-primary {
        height: max(var(--header-logo-height-mobile, 30px), 30px);
    }

    /* Corrige texto blanco invisible cuando el header es home-transparent */
    .header--home-transparent .header__dialog .header__menu-link,
    .header--home-transparent .header__dialog .header__menu-text {
        color: var(--header-menu-color-mobile, #09364D);
    }

    /* Barra superior oscura del panel para mostrar el logo blanco */
    .header--home-transparent .header__panel-header {
        margin: -18px -20px 28px;
        padding: 18px 24px;
        background: #09364D;
    }

    /* Botón cerrar en blanco sobre el fondo oscuro */
    .header--home-transparent .header__panel-header .header__close {
        color: #ffffff;
    }

    /* Separadores entre items */
    .header__menu-item {
        width: 100%;
        border-bottom: 1px solid rgba(9, 54, 77, 0.08);
    }

    .header__menu-item:first-child {
        border-top: 1px solid rgba(9, 54, 77, 0.08);
    }
}
