/* =========================================
   1. ADAPTABILIDAD DEL BOTÓN DEL HEADER
   ========================================= */
.ast-builder-button-wrap .ast-custom-button {
    width: 130px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    text-align: center !important;
    line-height: 1.2 !important;
    padding: 8px 12px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* =========================================
   2. TRANSICIONES GLOBALES
   ========================================= */
.site-logo-img img {
    transition: max-width 0.3s ease, filter 0.3s ease;
}

/* =========================================
   3. ESTILOS STICKY (CONTENEDOR Y LOGO)
   ========================================= */
#masthead.is-sticky {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
    background-color: #2b448f !important;
    margin-top: 0 !important;
    animation: bajarSuave 0.3s ease-in-out;
}

body.admin-bar #masthead.is-sticky { top: 32px !important; }
@media screen and (max-width: 782px) { body.admin-bar #masthead.is-sticky { top: 46px !important; } }

@keyframes bajarSuave {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(0); }
}

html body #masthead.is-sticky .site-logo-img img {
    max-width: 130px !important;
    filter: brightness(0) invert(1) !important;
}

/* =========================================
   4. MENÚ EN LÍNEA (ESCRITORIO Y TABLET)
   AISLADO: Solo afecta al menú visible, no al móvil
   ========================================= */

/* 4A. ESTADO NORMAL (Fondo Blanco) -> Texto Negro */
html body #masthead:not(.is-sticky) .ast-primary-header-bar .main-header-menu > .menu-item > .menu-link,
html body #masthead:not(.is-sticky) .ast-primary-header-bar .main-header-menu > .menu-item > .menu-link .menu-text {
    color: #000000 !important;
}

/* 4B. ESTADO STICKY (Fondo Azul) -> Texto Blanco (SOLO PRIMER NIVEL) */
html body #masthead.is-sticky .ast-primary-header-bar .main-header-menu > .menu-item > .menu-link,
html body #masthead.is-sticky .ast-primary-header-bar .main-header-menu > .menu-item > .menu-link .menu-text {
    color: #ffffff !important;
}

/* 4C. HOVER -> Amarillo | ACTIVE -> Naranja (Solo primer nivel) */
html body #masthead .ast-primary-header-bar .main-header-menu > .menu-item:hover > .menu-link,
html body #masthead .ast-primary-header-bar .main-header-menu > .menu-item:hover > .menu-link .menu-text {
    color: #FFD700 !important;
}
html body #masthead .ast-primary-header-bar .main-header-menu > .current-menu-item > .menu-link,
html body #masthead .ast-primary-header-bar .main-header-menu > .current-menu-item > .menu-link .menu-text,
html body #masthead .ast-primary-header-bar .main-header-menu > .current-menu-ancestor > .menu-link,
html body #masthead .ast-primary-header-bar .main-header-menu > .current-menu-ancestor > .menu-link .menu-text {
    color: #F59E09 !important;
}

/* 4D. SUBMENÚS ESCRITORIO/TABLET (Siempre Negros) */
html body #masthead .ast-primary-header-bar .main-header-menu .sub-menu .menu-link,
html body #masthead .ast-primary-header-bar .main-header-menu .sub-menu .menu-link .menu-text {
    color: #000000 !important;
}
html body #masthead .ast-primary-header-bar .main-header-menu .sub-menu .menu-item:hover > .menu-link,
html body #masthead .ast-primary-header-bar .main-header-menu .sub-menu .menu-item:hover > .menu-link .menu-text {
    color: #F59E09 !important;
}

/* =========================================
   5. ICONO HAMBURGUESA MÓVIL
   ========================================= */
html body #masthead .ast-mobile-menu-buttons .menu-toggle,
html body #masthead .ast-mobile-menu-buttons .menu-toggle svg,
html body #masthead .ast-mobile-menu-buttons .menu-toggle svg path,
html body #masthead .ast-mobile-menu-buttons .ast-mobile-svg,
html body #masthead .ast-mobile-menu-buttons .ast-mobile-svg path {
    color: #F59E09 !important;
    fill: #F59E09 !important;
    stroke: none !important;
}

html body #masthead .ast-mobile-menu-buttons .menu-toggle:hover,
html body #masthead .ast-mobile-menu-buttons .menu-toggle:hover svg,
html body #masthead .ast-mobile-menu-buttons .menu-toggle:hover svg path,
html body #masthead .ast-mobile-menu-buttons .menu-toggle:hover .ast-mobile-svg,
html body #masthead .ast-mobile-menu-buttons .menu-toggle:hover .ast-mobile-svg path {
    color: #FFD700 !important;
    fill: #FFD700 !important;
}

html body #masthead .ast-mobile-menu-buttons .menu-toggle:focus,
html body #masthead .ast-mobile-menu-buttons .menu-toggle.toggled,
html body #masthead .ast-mobile-menu-buttons .menu-toggle:focus svg,
html body #masthead .ast-mobile-menu-buttons .menu-toggle.toggled svg,
html body #masthead .ast-mobile-menu-buttons .menu-toggle:focus svg path,
html body #masthead .ast-mobile-menu-buttons .menu-toggle.toggled svg path,
html body #masthead .ast-mobile-menu-buttons .menu-toggle:focus .ast-mobile-svg path,
html body #masthead .ast-mobile-menu-buttons .menu-toggle.toggled .ast-mobile-svg path {
    color: #ffffff !important;
    fill: #ffffff !important;
}

/* =========================================
   6. MENÚ DESPLEGABLE MÓVIL (POPUP BLANCO)
   AISLADO: Solo aplica al panel lateral que se abre
   ========================================= */
/* Todo el texto en negro para que contraste con el fondo blanco del cajón */
html body .ast-mobile-popup-drawer .main-header-menu .menu-link,
html body .ast-mobile-popup-drawer .main-header-menu .menu-link .menu-text {
    color: #000000 !important;
}

/* Hover amarillo en el móvil */
html body .ast-mobile-popup-drawer .main-header-menu .menu-item:hover > .menu-link,
html body .ast-mobile-popup-drawer .main-header-menu .menu-item:hover > .menu-link .menu-text {
    color: #FFD700 !important;
}

/* Active naranja en el móvil */
html body .ast-mobile-popup-drawer .main-header-menu .current-menu-item > .menu-link,
html body .ast-mobile-popup-drawer .main-header-menu .current-menu-item > .menu-link .menu-text {
    color: #F59E09 !important;
}

/* Botón Cerrar (X) - Naranja */
html body .ast-mobile-popup-drawer .ast-mobile-popup-header .menu-toggle-close,
html body .ast-mobile-popup-drawer .ast-mobile-popup-header .menu-toggle-close svg,
html body .ast-mobile-popup-drawer .ast-mobile-popup-header .menu-toggle-close svg path {
    color: #F59E09 !important;
    fill: #F59E09 !important;
    stroke: none !important;
}