/* ==========================================================
   WCAG 2.1 / 2.2 - Ajustes globales Money Exchange
   Archivo consolidado
   ========================================================== */

/* ==========================================================
   1. Enlace para saltar menú / utilidades
   ========================================================== */

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 99999;
    padding: .75rem 1rem;
    background: #025097;
    color: #fff !important;
    font-weight: 700;
    border-radius: .25rem;
    text-decoration: underline;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 1rem;
    outline: 3px solid #111 !important;
    outline-offset: 3px !important;
}

/* Texto solo para lector de pantalla */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================
   2. Foco visible global
   ========================================================== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.m-menu__link:focus-visible,
.m-nav__link:focus-visible,
.btn:focus-visible,
.language-switcher__button:focus-visible,
.language-switcher__link:focus-visible {
    outline: 3px solid #025097 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 3px #fff !important;
}

#contenido-principal:focus {
    outline: none !important;
}

/* Evitar que Metronic elimine el foco */
body a:focus,
body button:focus,
body input:focus,
body select:focus,
body textarea:focus {
    outline-offset: 3px;
}

/* ==========================================================
   3. Formularios
   ========================================================== */

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: #5f6673 !important;
    opacity: 1 !important;
}

.form-control {
    min-height: 2.75rem;
}

.input-group-text {
    color: #3f4652 !important;
    background-color: #f0f2f5 !important;
    border-color: #9ca3af !important;
}

.control-label,
.m--font-info {
    color: #025097 !important;
}

.form-control-feedback,
.help-block small,
.m--font-danger,
.m-login__error,
#errorLogin {
    color: #b42318 !important;
    font-weight: 700 !important;
    line-height: 1.4;
}

#errorLogin,
.m-login__error {
    margin-top: .75rem;
    min-height: 1.25rem;
}

/* ==========================================================
   4. Botones con contraste
   ========================================================== */

.btn-info,
.btn-info.custom-btn,
.btn.custom-btn {
    color: #fff !important;
    background-color: #025097 !important;
    border-color: #025097 !important;
}

.btn-info:hover,
.btn-info:focus,
.btn-info.custom-btn:hover,
.btn-info.custom-btn:focus,
.btn.custom-btn:hover,
.btn.custom-btn:focus {
    color: #fff !important;
    background-color: #003f78 !important;
    border-color: #003f78 !important;
}

.btn-success,
.btn-success.custom-btn {
    color: #fff !important;
    background-color: #007a63 !important;
    border-color: #007a63 !important;
}

.btn-success:hover,
.btn-success:focus,
.btn-success.custom-btn:hover,
.btn-success.custom-btn:focus {
    color: #fff !important;
    background-color: #005f4d !important;
    border-color: #005f4d !important;
}

.btn-danger {
    color: #fff !important;
    background-color: #b42318 !important;
    border-color: #b42318 !important;
}

.btn-danger:hover,
.btn-danger:focus {
    color: #fff !important;
    background-color: #8f1c13 !important;
    border-color: #8f1c13 !important;
}

/* ==========================================================
   5. Header: layout, idioma, perfil y zoom
   ========================================================== */

/* Header con altura flexible: evita solapamientos al 200% / 400% */
.m-header,
.m-header .m-brand,
.m-header .m-header-head {
    min-height: 88px !important;
    height: auto !important;
    background-color: #fff !important;
}

.m-header .m-stack.m-stack--general,
.m-header .m-brand__logo,
.m-header .m-brand__tools,
#m_header_topbar,
.m-topbar__nav-wrapper,
.m-topbar__nav {
    min-height: 88px !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
}

.m-brand,
.m-header,
.m-header-head,
.m-stack.m-stack--ver,
.m-stack__item.m-brand__tools,
.m-topbar {
    background-color: #fff !important;
}

.m-brand__tools {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .75rem !important;
    min-height: 88px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Evita que el contenido quede debajo del header fijo */
body.m-header--fixed .m-body,
.m-header--fixed .m-body {
    padding-top: 88px !important;
}

/* Logo/título del header en contraste suficiente */
.m-header__title,
.m-header__title * {
    color: #025097 !important;
}

/* ---------- Selector de idioma ---------- */

.language-switcher {
    position: relative !important;
}

.language-switcher--topbar {
    display: inline-flex !important;
    align-items: center !important;
    position: relative !important;
    z-index: 1001 !important;
}

.language-switcher--brand {
    display: none !important;
}

.language-switcher__button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .45rem !important;
    min-height: 44px !important;
    height: auto !important;
    padding: .5rem .75rem !important;
    color: #111827 !important;
    background-color: #fff !important;
    border: 1px solid #4b5563 !important;
    border-radius: .35rem !important;
    font-size: .95rem;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

.language-switcher__button span,
.language-switcher__button i {
    color: #111827 !important;
}

.language-switcher__button img {
    width: 24px;
    height: 24px;
}

.language-switcher__button .fa-globe {
    font-size: .95rem;
}

.language-switcher__button:hover,
.language-switcher__button:focus {
    color: #111827 !important;
    background-color: #f3f4f6 !important;
}

.language-switcher__menu {
    position: absolute !important;
    top: calc(100% + .25rem) !important;
    right: 0 !important;
    left: auto !important;
    z-index: 5000 !important;
    min-width: 12rem !important;
    max-width: calc(100vw - 2rem) !important;
    max-height: calc(100vh - 6rem) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: .25rem 0 !important;
    background: #fff !important;
    border: 1px solid #6b7280 !important;
    border-radius: .25rem !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15) !important;
}

.language-switcher__list {
    padding-left: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.language-switcher__link {
    display: flex !important;
    align-items: center !important;
    gap: .5rem !important;
    min-height: 44px !important;
    color: #1f2937 !important;
    text-decoration: none !important;
}

.language-switcher__link:hover,
.language-switcher__link:focus {
    color: #111827 !important;
    background-color: #e5e7eb !important;
    text-decoration: underline !important;
}

.language-switcher__link[aria-current="true"] {
    font-weight: 700 !important;
}

/* ---------- Menú de usuario del header ---------- */

.moex-user-menu-toggle:focus-visible,
.moex-user-menu-dropdown .m-nav__link:focus-visible,
.moex-user-menu-dropdown .moex-logout-button:focus-visible {
    outline: 3px solid #025097 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 3px #fff !important;
}

.moex-user-menu-toggle .m-nav__link-icon-wrapper,
.m-topbar__usericon .m-nav__link-icon-wrapper {
    color: #025097 !important;
    background-color: #e5f0fb !important;
    border: 1px solid #025097 !important;
}

.moex-user-menu-toggle .m-nav__link-icon-wrapper i,
.m-topbar__usericon .m-nav__link-icon-wrapper i {
    color: #025097 !important;
}

.moex-user-menu-dropdown {
    max-height: calc(100vh - 5rem) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.moex-user-menu-dropdown .m-dropdown__inner,
.moex-user-menu-dropdown .m-dropdown__body,
.moex-user-menu-dropdown .m-dropdown__content {
    max-height: none !important;
    overflow: visible !important;
}

.moex-user-menu-list {
    padding-left: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.moex-user-menu-link {
    display: flex !important;
    align-items: center !important;
    min-height: 44px !important;
    color: #1f2937 !important;
}

.moex-user-menu-link .m-nav__link-icon {
    color: #025097 !important;
    opacity: 1 !important;
}

.moex-user-menu-link .m-nav__link-text {
    color: #1f2937 !important;
    font-weight: 600 !important;
}

.moex-user-menu-link:hover,
.moex-user-menu-link:focus {
    background-color: #e5e7eb !important;
    text-decoration: none !important;
}

.moex-user-menu-link:hover .m-nav__link-text,
.moex-user-menu-link:focus .m-nav__link-text {
    color: #003f78 !important;
    text-decoration: underline !important;
}

.moex-user-menu-name,
.moex-user-menu-email {
    margin: 0 !important;
    line-height: 1.4 !important;
    color: #1f2937 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
}

.moex-user-menu-name {
    font-weight: 700 !important;
    font-size: 1rem !important;
}

.moex-user-menu-email {
    font-size: .9rem !important;
}

.moex-logout-button {
    min-height: 44px !important;
    min-width: 44px !important;
    color: #025097 !important;
    background-color: #fff !important;
    border: 1px solid #025097 !important;
    font-weight: 700 !important;
}

.moex-logout-button:hover,
.moex-logout-button:focus {
    color: #fff !important;
    background-color: #025097 !important;
    border-color: #025097 !important;
}

.moex-user-menu-dropdown .m-nav__separator {
    display: block;
    height: 1px;
    margin: .5rem 0;
    background-color: #d7dce3;
}

/* Perfil responsive/zoom: oculto en escritorio, visible cuando se oculta topbar */
.moex-user-menu-brand-wrapper {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Perfil responsive alineado con idioma */
.moex-user-menu-brand-wrapper,
.moex-user-menu-brand-wrapper .m-nav__item,
.moex-user-menu-brand-wrapper .m-nav__link,
.moex-user-menu-brand-wrapper .m-nav__link-icon,
.moex-user-menu-brand-wrapper .m-nav__link-icon-wrapper,
#m_aside_left_offcanvas_toggle {
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

.moex-user-menu-brand-wrapper .m-nav__link,
.moex-user-menu-brand-wrapper .m-nav__link-icon-wrapper,
#m_aside_left_offcanvas_toggle {
    min-width: 44px !important;
    min-height: 44px !important;
}

.moex-user-menu-brand-wrapper img {
    width: 35px !important;
    height: 35px !important;
    max-width: 35px !important;
    max-height: 35px !important;
}

/* Hamburguesa alineada */
#m_aside_left_offcanvas_toggle {
    display: inline-flex !important;
    padding: 0 !important;
}

/* ---------- Header responsive / zoom ---------- */

@media (max-width: 1024px) {
    .m-header,
    .m-header .m-brand,
    .m-header .m-header-head,
    .m-header .m-stack.m-stack--general,
    .m-header .m-brand__logo,
    .m-header .m-brand__tools {
        min-height: 96px !important;
    }

    body.m-header--fixed .m-body,
    .m-header--fixed .m-body {
        padding-top: 96px !important;
    }

    .language-switcher--topbar {
        display: none !important;
    }

    .language-switcher--brand,
    .moex-user-menu-brand-wrapper {
        display: inline-flex !important;
        align-items: center !important;
        position: relative !important;
        z-index: 3001 !important;
    }

    .m-brand__tools {
        flex-wrap: nowrap !important;
    }

    .language-switcher--brand .language-switcher__button {
        min-width: 44px !important;
        max-width: 11rem !important;
        padding: .45rem .65rem !important;
    }

    .language-switcher--brand .language-switcher__button > span {
        max-width: 6rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .language-switcher--brand .language-switcher__menu {
        right: 0 !important;
        left: auto !important;
        max-width: calc(100vw - 2rem) !important;
    }

    .moex-user-menu-brand-wrapper .moex-user-menu-dropdown {
        position: fixed !important;
        top: 5.25rem !important;
        right: .75rem !important;
        left: .75rem !important;
        width: auto !important;
        max-width: calc(100vw - 1.5rem) !important;
        max-height: calc(100vh - 6rem) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        z-index: 5000 !important;
        transform: none !important;
    }

    .moex-user-menu-brand-wrapper .m-dropdown__inner {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .moex-user-menu-brand-wrapper .m-dropdown__header,
    .moex-user-menu-brand-wrapper .m-dropdown__body,
    .moex-user-menu-brand-wrapper .m-dropdown__content {
        max-height: none !important;
        overflow: visible !important;
    }

    .moex-user-menu-brand-wrapper .m-card-user {
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
        width: 100% !important;
    }

    .moex-user-menu-brand-wrapper .m-card-user__pic {
        flex: 0 0 auto !important;
    }

    .moex-user-menu-brand-wrapper .m-card-user__details {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .moex-user-menu-link,
    .moex-logout-button {
        min-height: 48px !important;
    }
}

/* Compactar idioma en viewport estrecho, sin perder nombre accesible */
@media (max-width: 520px) {
    .language-switcher--brand .language-switcher__button {
        max-width: 8.5rem !important;
        padding: .45rem .6rem !important;
    }

    .language-switcher--brand .language-switcher__button > span {
        max-width: 5rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.m-header--fixed .m-body,
    .m-header--fixed .m-body {
        padding-top: 104px !important;
    }
}

@media (max-width: 380px) {
    .language-switcher--brand .language-switcher__button > span {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
}

/* Extra de seguridad para páginas con header fijo */
.m-header--fixed .m-wrapper,
.m-header--fixed main.m-content {
    padding-top: 1rem !important;
}

/* ==========================================================
   6. Menú lateral Metronic
   ========================================================== */

.m-aside-left {
    background-color: #00579d !important;
}

@media (max-width: 992px) {
    .m-brand,
    .m-header,
    .m-header-head,
    .m-topbar,
    .m-stack.m-stack--ver,
    .m-stack__item.m-brand__tools,
    .m-brand .m-brand__logo,
    .m-brand .m-brand__tools {
        background-color: #fff !important;
    }
}

/* Iconos principales sobre azul */
.m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link .m-menu__link-icon,
.m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link .m-menu__ver-arrow {
    color: #fff !important;
    opacity: 1 !important;
}

/* No forzar texto del menú minimizado: Metronic lo necesita oculto */
body.m-aside-left--minimize .m-aside-menu .m-menu__link-text {
    color: inherit !important;
}

/* Estado hover/activo del icono principal */
.m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link:hover,
.m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link:focus,
.m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--active > .m-menu__link,
.m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--hover > .m-menu__link {
    background-color: #e5e7eb !important;
}

.m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link:hover .m-menu__link-icon,
.m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link:focus .m-menu__link-icon,
.m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--active > .m-menu__link .m-menu__link-icon,
.m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--hover > .m-menu__link .m-menu__link-icon {
    color: #00579d !important;
}

/* Submenús flotantes: textos visibles y contraste */
.m-aside-menu .m-menu__submenu {
    background-color: #fff !important;
}

.m-aside-menu .m-menu__submenu .m-menu__link-text,
.m-aside-menu .m-menu__submenu .m-menu__link {
    color: #003f78 !important;
}

.m-aside-menu .m-menu__submenu .m-menu__link-icon,
.m-aside-menu .m-menu__submenu .m-menu__ver-arrow {
    color: #003f78 !important;
    opacity: 1 !important;
}

.m-aside-menu .m-menu__submenu .m-menu__link:hover,
.m-aside-menu .m-menu__submenu .m-menu__link:focus {
    background-color: #e5e7eb !important;
    text-decoration: underline !important;
}

.m-aside-menu .m-menu__submenu .m-menu__link:hover .m-menu__link-text,
.m-aside-menu .m-menu__submenu .m-menu__link:focus .m-menu__link-text {
    color: #003f78 !important;
}

/* Foco visible en menú */
.m-aside-menu .m-menu__link:focus-visible {
    outline: 3px solid #fff !important;
    outline-offset: -3px !important;
    box-shadow: 0 0 0 3px #003f78 !important;
}

/* ---------- Menú lateral público: tooltip visual sin submenús falsos ---------- */

body.m-aside-left--minimize .m-aside-menu .moex-menu-link-label,
body.m-aside-left--minimize .m-aside-menu .moex-submenu-toggle {
    position: relative;
}

body.m-aside-left--minimize .m-aside-menu .moex-menu-link-label::after {
    content: attr(aria-label);
    display: none;
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1200;
    min-width: 180px;
    padding: 1rem 1.25rem;
    color: #003f78;
    background: #fff;
    border: 1px solid #d7dce3;
    border-radius: .25rem;
    box-shadow: 0 4px 15px rgba(69, 65, 78, .2);
    font-weight: 600;
    white-space: nowrap;
}

body.m-aside-left--minimize .m-aside-menu .moex-menu-link-label:hover::after,
body.m-aside-left--minimize .m-aside-menu .moex-menu-link-label:focus::after,
body.m-aside-left--minimize .m-aside-menu .moex-menu-link-label:focus-visible::after {
    display: block;
}

/* ---------- Submenú accesible de Políticas ---------- */

.m-aside-menu .moex-menu-submenu > .m-menu__submenu {
    min-width: 250px;
    max-width: calc(100vw - 120px);
    padding: .65rem !important;
    background: #fff !important;
    border: 1px solid #d7dce3 !important;
    border-radius: .35rem !important;
    box-shadow: 0 4px 15px rgba(69, 65, 78, .2) !important;
    z-index: 1200 !important;
}

body.m-aside-left--minimize .m-aside-menu .moex-menu-submenu > .m-menu__submenu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
}

body.m-aside-left--minimize .m-aside-menu .moex-menu-submenu > .m-menu__submenu .m-menu__arrow {
    left: -8px !important;
    right: auto !important;
}

.m-aside-menu .moex-menu-submenu > .m-menu__submenu[hidden] {
    display: none !important;
}

.m-aside-menu .moex-menu-submenu.m-menu__item--open > .m-menu__submenu {
    display: block !important;
}

.m-aside-menu .moex-menu-submenu .moex-politicas-list {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.m-aside-menu .moex-menu-submenu .moex-politicas-list .m-menu__item {
    margin: 0 !important;
    padding: 0 !important;
}

.m-aside-menu .moex-menu-submenu .moex-politicas-link {
    display: block !important;
    min-height: auto !important;
    padding: .7rem .85rem !important;
    border-radius: .25rem !important;
    color: #003f78 !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
}

.m-aside-menu .moex-menu-submenu .moex-politicas-link .m-menu__link-text {
    display: block !important;
    color: #003f78 !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    white-space: normal !important;
}

.m-aside-menu .moex-menu-submenu .moex-politicas-link:hover,
.m-aside-menu .moex-menu-submenu .moex-politicas-link:focus {
    background: #e5e7eb !important;
    text-decoration: none !important;
}

.m-aside-menu .moex-menu-submenu .moex-politicas-link:hover .m-menu__link-text,
.m-aside-menu .moex-menu-submenu .moex-politicas-link:focus .m-menu__link-text {
    color: #003f78 !important;
    text-decoration: underline !important;
}

.m-aside-menu .moex-menu-submenu .moex-politicas-link:focus-visible {
    outline: 3px solid #003f78 !important;
    outline-offset: -3px !important;
    box-shadow: 0 0 0 3px #fff !important;
}

/* En zoom / móvil, Políticas se despliega como lista normal */
@media (max-width: 992px) {
    .m-aside-left {
        overflow-y: auto !important;
    }

    .m-aside-menu .moex-menu-submenu > .m-menu__submenu {
        position: static !important;
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #00579d !important;
        overflow: visible !important;
    }

    .m-aside-menu .moex-menu-submenu > .m-menu__submenu[hidden] {
        display: none !important;
    }

    .m-aside-menu .moex-menu-submenu.m-menu__item--open > .m-menu__submenu {
        display: block !important;
    }

    .m-aside-menu .moex-menu-submenu .moex-politicas-list,
    .m-aside-menu .moex-menu-submenu .m-menu__subnav {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: .35rem 0 .75rem 0 !important;
        list-style: none !important;
        background: #00579d !important;
    }

    .m-aside-menu .moex-menu-submenu .moex-politicas-list .m-menu__item {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .m-aside-menu .moex-menu-submenu .moex-politicas-link {
        display: block !important;
        width: auto !important;
        min-height: 44px !important;
        height: auto !important;
        margin: 0 1rem 0 5.3rem !important;
        padding: .65rem 1rem !important;
        border-radius: .25rem !important;
        background: transparent !important;
        color: #fff !important;
        text-decoration: none !important;
        line-height: 1.35 !important;
        text-align: left !important;
    }

    .m-aside-menu .moex-menu-submenu .moex-politicas-link .m-menu__link-text {
        display: inline !important;
        color: #fff !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        line-height: 1.35 !important;
        white-space: normal !important;
        text-decoration: none !important;
    }

    .m-aside-menu .moex-menu-submenu .moex-politicas-link:hover,
    .m-aside-menu .moex-menu-submenu .moex-politicas-link:focus {
        background: #e5e7eb !important;
        color: #003f78 !important;
        text-decoration: none !important;
    }

    .m-aside-menu .moex-menu-submenu .moex-politicas-link:hover .m-menu__link-text,
    .m-aside-menu .moex-menu-submenu .moex-politicas-link:focus .m-menu__link-text {
        color: #003f78 !important;
        text-decoration: underline !important;
    }

    .m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link {
        color: #fff !important;
    }

    .m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link .m-menu__link-text,
    .m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link .m-menu__link-icon,
    .m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link .m-menu__ver-arrow {
        color: #fff !important;
        opacity: 1 !important;
    }

    .m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link:hover,
    .m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link:focus,
    .m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--active > .m-menu__link,
    .m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--hover > .m-menu__link,
    .m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--open > .m-menu__link {
        background-color: #e5e7eb !important;
        color: #003f78 !important;
    }

    .m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link:hover .m-menu__link-text,
    .m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link:focus .m-menu__link-text,
    .m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--active > .m-menu__link .m-menu__link-text,
    .m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--hover > .m-menu__link .m-menu__link-text,
    .m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--open > .m-menu__link .m-menu__link-text,
    .m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link:hover .m-menu__link-icon,
    .m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link:focus .m-menu__link-icon,
    .m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--active > .m-menu__link .m-menu__link-icon,
    .m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--hover > .m-menu__link .m-menu__link-icon,
    .m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--open > .m-menu__link .m-menu__link-icon,
    .m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link:hover .m-menu__ver-arrow,
    .m-aside-menu .m-menu__nav > .m-menu__item > .m-menu__link:focus .m-menu__ver-arrow,
    .m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--active > .m-menu__link .m-menu__ver-arrow,
    .m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--hover > .m-menu__link .m-menu__ver-arrow,
    .m-aside-menu .m-menu__nav > .m-menu__item.m-menu__item--open > .m-menu__link .m-menu__ver-arrow {
        color: #003f78 !important;
        opacity: 1 !important;
    }
}

/* ==========================================================
   7. Footer
   ========================================================== */

.moex-footer,
#footer_moex {
    position: static !important;
    width: 100%;
    min-height: auto !important;
    height: auto !important;
    padding: .75rem 1rem !important;
    background: #fff !important;
    border-top: 1px solid #d7dce3;
}

.moex-footer .m-stack,
#footer_moex .m-stack {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.moex-footer__copyright,
.m-footer__copyright {
    margin: 0;
    color: #4b5563 !important;
    font-size: 1rem !important;
    line-height: 1.5;
}

.moex-footer__link,
.moex-footer .m-link,
.moex-footer .m-nav__link-text,
#footer_moex .m-link,
#footer_moex .m-nav__link-text {
    color: #025097 !important;
    text-decoration: underline !important;
    text-underline-offset: .18em;
    font-weight: 700;
}

.moex-footer__link:hover,
.moex-footer__link:focus,
.moex-footer .m-link:hover,
.moex-footer .m-link:focus,
.moex-footer .m-nav__link:hover .m-nav__link-text,
.moex-footer .m-nav__link:focus .m-nav__link-text,
#footer_moex .m-link:hover,
#footer_moex .m-link:focus,
#footer_moex .m-nav__link:hover .m-nav__link-text,
#footer_moex .m-nav__link:focus .m-nav__link-text {
    color: #003f78 !important;
    text-decoration: underline !important;
}

.moex-footer__list,
#footer_moex .m-footer__nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .25rem .75rem;
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.moex-footer__payments img {
    max-width: 100%;
    height: auto;
}

/* Anula comportamiento fijo del tema para evitar superposición */
body.m-footer--fixed .m-body,
body.m-footer--fixed .m-content,
body.m-footer--fixed .m-wrapper {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

body.m-footer--fixed .m-footer {
    position: static !important;
}

@media (max-width: 768px) {
    .moex-footer .m-stack,
    #footer_moex .m-stack {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .moex-footer__list,
    #footer_moex .m-footer__nav {
        justify-content: center;
    }
}

/* ==========================================================
   8. Scroll top
   ========================================================== */

.m-scroll-top {
    border: 2px solid #025097 !important;
    background: #fff !important;
    color: #025097 !important;
    padding-top: 0 !important;
}

.m-scroll-top > i {
    color: #025097 !important;
}

.m-scroll-top:hover,
.m-scroll-top:focus {
    background: #e5e7eb !important;
}

.m-scroll-top:hover > i,
.m-scroll-top:focus > i {
    color: #003f78 !important;
}

/* ==========================================================
   9. Login
   ========================================================== */

.login-footer-text {
    text-align: center;
}

.login-footer-text p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.login-social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    padding-left: 0;
    margin: 1rem 0;
    list-style: none;
}

.login-social-links a {
    display: inline-flex;
    border-radius: .25rem;
}

.login-touch-link,
.login-touch-button,
#m_login_signin_submit {
    min-height: 44px !important;
    min-width: 44px !important;
}

.login-touch-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: .5rem .25rem !important;
    line-height: 1.4 !important;
}

.login-touch-button,
#m_login_signin_submit {
    padding: .75rem 1rem !important;
    line-height: 1.25 !important;
    height: auto !important;
}

#moex_form_login .btn,
#moex_form_login a {
    margin-top: .35rem;
    margin-bottom: .35rem;
}

body #moex_form_login a#m_login_register_button.btn.btn-success.login-register-button,
body a#m_login_register_button.btn.btn-success.login-register-button {
    color: #fff !important;
    background: #007a63 !important;
    background-color: #007a63 !important;
    border-color: #007a63 !important;
}

body #moex_form_login a#m_login_register_button.btn.btn-success.login-register-button:hover,
body #moex_form_login a#m_login_register_button.btn.btn-success.login-register-button:focus,
body a#m_login_register_button.btn.btn-success.login-register-button:hover,
body a#m_login_register_button.btn.btn-success.login-register-button:focus {
    color: #fff !important;
    background: #005f4d !important;
    background-color: #005f4d !important;
    border-color: #005f4d !important;
}

@media (max-width: 768px) {
    #moex_form_login .btn,
    #moex_form_login button,
    #moex_form_login input[type="submit"],
    #moex_form_login input[type="button"],
    #moex_form_login a {
        min-height: 44px !important;
    }
}

/* ==========================================================
   10. Register
   ========================================================== */

.register-title {
    font-size: 1.35rem;
    line-height: 1.4;
    text-align: center;
    margin-bottom: 1.5rem;
}

.register-section-title {
    font-size: 1.2rem;
    line-height: 1.4;
    text-align: center;
    margin: 1.5rem 0 1rem;
}

.register-faq-subtitle {
    font-size: 1.05rem;
    line-height: 1.4;
    color: #025097;
    margin: 0 0 .5rem;
}

.form_moex {
    max-width: 100%;
}

.form_moex a:not(.btn),
.form_moex .m-link {
    color: #025097 !important;
    text-decoration: underline !important;
    text-underline-offset: .18em;
    font-weight: 600;
}

.form_moex a:not(.btn):hover,
.form_moex a:not(.btn):focus,
.form_moex .m-link:hover,
.form_moex .m-link:focus {
    color: #005f4d !important;
    text-decoration: underline !important;
}

.form_moex .m--font-success,
.form_moex .m--font-brand,
.form_moex .m--font-info {
    color: #025097 !important;
}

.form_moex .btn,
.form_moex button,
.form_moex input[type="submit"],
.form_moex input[type="button"] {
    min-height: 48px !important;
    min-width: 48px !important;
}

.register-submit-button,
#btnRegistrarse {
    color: #fff !important;
    background-color: #007a63 !important;
    border-color: #007a63 !important;
    padding: .85rem 1rem !important;
    line-height: 1.25 !important;
}

.register-submit-button:hover,
.register-submit-button:focus,
#btnRegistrarse:hover,
#btnRegistrarse:focus {
    color: #fff !important;
    background-color: #005f4d !important;
    border-color: #005f4d !important;
}

.m-checkbox input[type="checkbox"] {
    min-width: 24px !important;
    min-height: 24px !important;
}

.m-checkbox input[type="checkbox"]:focus-visible {
    outline: 3px solid #025097 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 3px #fff !important;
}

@media (max-width: 768px) {
    .form_moex {
        width: auto !important;
        max-width: 100%;
    }
}

/* ---------- Register: Select2 ---------- */

select.form-control,
select.form-control option,
select.m-select2,
select.m-select2 option {
    color: #1f2937 !important;
    background-color: #fff !important;
}

.select2-container--default .select2-selection--single {
    color: #1f2937 !important;
    background-color: #fff !important;
    border: 1px solid #6b7280 !important;
    min-height: 44px !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default .select2-selection--single:focus {
    outline: 3px solid #025097 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 3px #fff !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #1f2937 !important;
    opacity: 1 !important;
}

.select2-container--default .select2-results__option {
    color: #1f2937 !important;
    background-color: #fff !important;
}

.select2-container--default .select2-results__option--highlighted,
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option.select2-results__option--highlighted {
    color: #fff !important;
    background-color: #025097 !important;
}

select.select2-hidden-accessible,
select.select2-hidden-accessible option {
    color: #1f2937 !important;
    background-color: #fff !important;
    opacity: 1 !important;
}

select.select2-hidden-accessible[aria-hidden="true"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 1px !important;
    min-height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---------- Register: FAQ ---------- */

.form_moex .faq-list,
.form_moex .faq-list * {
    border-color: #025097 !important;
}

.form_moex .faq-list details,
.form_moex .faq-list details[open] {
    color: #1f2937 !important;
}

.form_moex .faq-list details > summary,
.form_moex .faq-list details > summary *,
.form_moex .faq-list summary,
.form_moex .faq-list summary *,
.form_moex .faq-list .faq-title,
.form_moex .faq-list .faq-question,
.wcag-faq-summary,
.wcag-faq-summary *,
.wcag-faq-summary::before,
.wcag-faq-summary::marker,
.wcag-faq-summary::-webkit-details-marker {
    color: #025097 !important;
    font-weight: 700 !important;
}

.form_moex .faq-list details > summary:hover,
.form_moex .faq-list details > summary:focus,
.form_moex .faq-list details > summary:hover *,
.form_moex .faq-list details > summary:focus *,
.form_moex .faq-list summary:hover,
.form_moex .faq-list summary:focus,
.form_moex .faq-list summary:hover *,
.form_moex .faq-list summary:focus *,
.wcag-faq-summary:hover,
.wcag-faq-summary:focus {
    color: #005f4d !important;
    text-decoration: underline !important;
}

.form_moex .faq-list details > summary::before,
.form_moex .faq-list summary::before,
.form_moex .faq-list details > summary::marker,
.form_moex .faq-list summary::marker,
.form_moex .faq-list details > summary::-webkit-details-marker,
.form_moex .faq-list summary::-webkit-details-marker {
    color: #025097 !important;
}

.form_moex .faq-list details > summary:focus-visible,
.form_moex .faq-list summary:focus-visible {
    outline: 3px solid #025097 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 3px #fff !important;
}

.faq-content {
    text-align: left !important;
    color: #1f2937 !important;
    line-height: 1.6 !important;
}

/* ---------- Register: información legal / protección de datos ---------- */

.registro-info-legal {
    margin: 1rem 0;
    font-size: 1.1rem;
    border: 1px solid #d7dce3;
    border-radius: .35rem;
    overflow: hidden;
}

.registro-info-legal__item {
    display: grid;
    grid-template-columns: minmax(12rem, 30%) 1fr;
    border-bottom: 1px solid #d7dce3;
}

.registro-info-legal__item:last-child {
    border-bottom: 0;
}

.registro-info-legal dt,
.registro-info-legal dd {
    margin: 0;
    padding: 1rem;
    line-height: 1.5;
}

.registro-info-legal dt {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 700;
    color: #1f2937;
    background: #f3f4f6;
}

.registro-info-legal dd {
    color: #1f2937;
    background: #fff;
}

.registro-info-legal a {
    color: #025097 !important;
    text-decoration: underline !important;
    text-underline-offset: .18em;
    font-weight: 700;
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    .registro-info-legal__item {
        grid-template-columns: 1fr;
    }

    .registro-info-legal dt {
        justify-content: flex-start;
        text-align: left;
        border-bottom: 1px solid #d7dce3;
    }
}

/* ==========================================================
   11. Profile / Verificación paso 2 de 2
   ========================================================== */

.profile-verification-title {
    color: #025097 !important;
    font-size: 1.35rem;
    line-height: 1.4;
    text-align: center;
    margin: 1rem 0 .5rem;
    font-weight: 700;
}

.profile-verification-help {
    color: #1f2937 !important;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.profile-verification-form .form-control::placeholder,
.profile-verification-form input::placeholder {
    color: #5f6673 !important;
    opacity: 1 !important;
}

.profile-verification-form .form-control {
    min-height: 48px !important;
    color: #1f2937 !important;
    background-color: #fff !important;
    border-color: #6b7280 !important;
}

.profile-verification-form .input-group-text {
    min-height: 48px !important;
    color: #1f2937 !important;
    background-color: #f3f4f6 !important;
    border-color: #6b7280 !important;
}

.profile-status-message {
    color: #007a63 !important;
    font-weight: 700;
    line-height: 1.5;
    margin: .75rem 0;
    text-align: center;
}

.profile-verification-form .m--font-danger,
.profile-verification-form .form-control-feedback {
    color: #b42318 !important;
    font-weight: 700 !important;
    line-height: 1.4;
    min-height: 1.25rem;
}

.profile-action-button {
    min-height: 48px !important;
    margin-top: .75rem;
    font-weight: 700 !important;
}

.profile-resend-button,
.profile-verification-form .btn-success {
    color: #fff !important;
    background-color: #007a63 !important;
    border-color: #007a63 !important;
}

.profile-resend-button:hover,
.profile-resend-button:focus,
.profile-verification-form .btn-success:hover,
.profile-verification-form .btn-success:focus {
    color: #fff !important;
    background-color: #005f4d !important;
    border-color: #005f4d !important;
}

.profile-verification-form .btn-info,
.profile-verification-form .btn-info.custom-btn {
    color: #fff !important;
    background-color: #025097 !important;
    border-color: #025097 !important;
}

.profile-verification-form .btn-info:hover,
.profile-verification-form .btn-info:focus,
.profile-verification-form .btn-info.custom-btn:hover,
.profile-verification-form .btn-info.custom-btn:focus {
    color: #fff !important;
    background-color: #003f78 !important;
    border-color: #003f78 !important;
}

.profile-verification-form button:focus-visible,
.profile-verification-form input:focus-visible,
.profile-verification-form .btn:focus-visible {
    outline: 3px solid #025097 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 3px #fff !important;
}

/* ==========================================================
   12. Responsive general
   ========================================================== */

@media (max-width: 992px) {
    .m-header,
    .m-brand,
    .m-footer,
    #footer_moex {
        height: auto !important;
    }

    .m-body,
    .m-wrapper,
    .m-content {
        min-height: auto !important;
    }
}

/* ==========================================================
   HEADER - Corrección final de alineación logos / idioma / perfil
   ========================================================== */

:root {
    --moex-header-height: 88px;
}

/* Altura real del header */
.m-header {
    min-height: var(--moex-header-height) !important;
    height: auto !important;
    background-color: #fff !important;
}

/* Contenedor principal del header */
.m-header .m-container,
.m-header .m-stack--desktop {
    min-height: var(--moex-header-height) !important;
    height: auto !important;
}

/* Brand izquierda */
.m-header .m-brand {
    min-height: var(--moex-header-height) !important;
    height: var(--moex-header-height) !important;
    display: flex !important;
    align-items: center !important;
    background-color: #fff !important;
}

.m-header .m-brand .m-stack.m-stack--general {
    width: 100% !important;
    min-height: var(--moex-header-height) !important;
    height: var(--moex-header-height) !important;
    display: flex !important;
    align-items: center !important;
}

/* Logo pequeño izquierdo */
.m-brand__logo {
    min-height: var(--moex-header-height) !important;
    height: var(--moex-header-height) !important;
    display: flex !important;
    align-items: center !important;
}

.m-brand__logo .m-brand__logo-wrapper {
    display: inline-flex !important;
    align-items: center !important;
}

.m-brand__logo img {
    display: block !important;
    width: auto !important;
    max-height: 54px !important;
}

/* Logo central Money Exchange */
.m-header-head {
    min-height: var(--moex-header-height) !important;
    height: var(--moex-header-height) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background-color: #fff !important;
}

.m-header__title {
    min-height: var(--moex-header-height) !important;
    height: var(--moex-header-height) !important;
    display: flex !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.m-header__title-text {
    display: flex !important;
    align-items: center !important;
}

.m-header__title-text img {
    display: block !important;
    width: auto !important;
    max-height: 52px !important;
}

/* Topbar derecha: idioma y perfil en escritorio */
#m_header_topbar {
    min-height: var(--moex-header-height) !important;
    height: var(--moex-header-height) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.m-topbar__nav-wrapper,
.m-topbar__nav {
    min-height: var(--moex-header-height) !important;
    height: var(--moex-header-height) !important;
    display: flex !important;
    align-items: center !important;
}

/* Herramientas responsive: idioma, perfil y hamburguesa */
.m-brand__tools {
    min-height: var(--moex-header-height) !important;
    height: var(--moex-header-height) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .75rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Selector idioma: texto negro y contraste WCAG */
.language-switcher__button,
.language-switcher__button span,
.language-switcher__button i {
    color: #111827 !important;
}

.language-switcher__button {
    min-height: 44px !important;
    height: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .45rem !important;
    padding: .5rem .75rem !important;
    line-height: 1.2 !important;
    background-color: #fff !important;
    border: 1px solid #4b5563 !important;
    border-radius: .25rem !important;
    white-space: nowrap !important;
}

.language-switcher__button img {
    width: 24px !important;
    height: 24px !important;
}

/* Idioma topbar alineado verticalmente */
.language-switcher--topbar {
    align-self: center !important;
    margin-top: 0 !important;
}

/* Perfil responsive alineado con idioma */
.moex-user-menu-brand-wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

.moex-user-menu-brand-wrapper,
.moex-user-menu-brand-wrapper .m-nav__item,
.moex-user-menu-brand-wrapper .m-nav__link,
.moex-user-menu-brand-wrapper .m-nav__link-icon,
.moex-user-menu-brand-wrapper .m-nav__link-icon-wrapper {
    min-width: 44px !important;
    min-height: 44px !important;
    height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.moex-user-menu-brand-wrapper img {
    width: 35px !important;
    height: 35px !important;
    max-width: 35px !important;
    max-height: 35px !important;
}

/* Hamburguesa alineada */
#m_aside_left_offcanvas_toggle {
    min-width: 44px !important;
    min-height: 44px !important;
    height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Evita que el contenido se meta debajo del header fijo */
body.m-header--fixed .m-body,
.m-header--fixed .m-body {
    padding-top: var(--moex-header-height) !important;
}

/* ==========================================================
   HEADER - Zoom / responsive
   ========================================================== */

@media (max-width: 1024px) {
    :root {
        --moex-header-height: 104px;
    }

    .m-header,
    .m-header .m-brand,
    .m-header-head,
    .m-header .m-container,
    .m-header .m-stack--desktop,
    .m-header .m-brand .m-stack.m-stack--general,
    .m-brand__logo,
    .m-brand__tools {
        min-height: var(--moex-header-height) !important;
        height: var(--moex-header-height) !important;
    }

    /* En zoom/responsive se oculta el idioma de topbar y se usa el de brand */
    .language-switcher--topbar {
        display: none !important;
    }

    .language-switcher--brand,
    .moex-user-menu-brand-wrapper {
        display: inline-flex !important;
        align-items: center !important;
        align-self: center !important;
        position: relative !important;
        z-index: 3001 !important;
    }

    .m-brand__tools {
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    .language-switcher--brand {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .language-switcher--brand .language-switcher__button {
        max-width: 11rem !important;
    }

    body.m-header--fixed .m-body,
    .m-header--fixed .m-body {
        padding-top: var(--moex-header-height) !important;
    }
}

/* Zoom muy alto / pantalla estrecha */
@media (max-width: 520px) {
    :root {
        --moex-header-height: 112px;
    }

    .language-switcher--brand .language-switcher__button {
        max-width: 8rem !important;
        padding: .45rem .6rem !important;
    }

    .language-switcher--brand .language-switcher__button > span {
        max-width: 4.75rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
}

/* En pantallas muy pequeñas dejamos solo icono/bandera, pero accesible por aria-label */
@media (max-width: 380px) {
    .language-switcher--brand .language-switcher__button > span {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
}

/* ==========================================================
   HEADER - Dropdown perfil con scroll en zoom alto
   ========================================================== */

@media (max-width: 1024px) {
    .moex-user-menu-brand-wrapper .moex-user-menu-dropdown {
        position: fixed !important;
        top: calc(var(--moex-header-height) + .5rem) !important;
        right: .75rem !important;
        left: .75rem !important;
        width: auto !important;
        max-width: calc(100vw - 1.5rem) !important;
        max-height: calc(100vh - var(--moex-header-height) - 1rem) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        z-index: 5000 !important;
        transform: none !important;
    }

    .moex-user-menu-brand-wrapper .m-dropdown__inner {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .moex-user-menu-brand-wrapper .m-dropdown__header,
    .moex-user-menu-brand-wrapper .m-dropdown__body,
    .moex-user-menu-brand-wrapper .m-dropdown__content {
        max-height: none !important;
        overflow: visible !important;
    }

    .moex-user-menu-brand-wrapper .m-card-user {
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
        width: 100% !important;
    }

    .moex-user-menu-brand-wrapper .m-card-user__details {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .moex-user-menu-name,
    .moex-user-menu-email {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        color: #111827 !important;
    }

    .moex-user-menu-link,
    .moex-logout-button {
        min-height: 48px !important;
    }
}

/* ==========================================================
   HOTFIX HEADER: evitar doble header en escritorio
   ========================================================== */

/* En escritorio, el header debe ser UNA sola fila */
@media (min-width: 1025px) {
    .m-header {
        height: 88px !important;
        min-height: 88px !important;
        background: #fff !important;
    }

    .m-header .m-container,
    .m-header .m-container--full-height,
    .m-header > .m-container > .m-stack.m-stack--desktop {
        height: 88px !important;
        min-height: 88px !important;
    }

    .m-header > .m-container > .m-stack.m-stack--desktop {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    /* Columna izquierda: logo pequeño */
    .m-header .m-brand {
        flex: 0 0 110px !important;
        width: 110px !important;
        max-width: 110px !important;
        height: 88px !important;
        min-height: 88px !important;
        display: flex !important;
        align-items: center !important;
        background: #fff !important;
    }

    .m-header .m-brand .m-stack.m-stack--general {
        width: 100% !important;
        height: 88px !important;
        min-height: 88px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .m-header .m-brand__logo {
        height: 88px !important;
        min-height: 88px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .m-header .m-brand__logo img {
        max-height: 54px !important;
        width: auto !important;
        display: block !important;
    }

    /* Oculta el texto pequeño que estaba apareciendo arriba */
    .m-header .m-brand__logo .m-header__title {
        display: none !important;
    }

    /* Herramientas del brand ocultas en escritorio para no crear segunda fila */
    .m-header .m-brand__tools {
        display: none !important;
    }

    /* Zona derecha: logo grande + idioma + perfil */
    .m-header .m-header-head {
        flex: 1 1 auto !important;
        width: auto !important;
        height: 88px !important;
        min-height: 88px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        background: #fff !important;
    }

    .m-header .m-header__title {
        height: 88px !important;
        min-height: 88px !important;
        display: flex !important;
        align-items: center !important;
        padding: 0 1rem !important;
    }

    .m-header .m-header__title-text {
        display: flex !important;
        align-items: center !important;
    }

    .m-header .m-header__title-text img {
        max-height: 52px !important;
        width: auto !important;
        display: block !important;
    }

    #m_header_topbar {
        height: 88px !important;
        min-height: 88px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        margin-left: auto !important;
        padding: 0 1rem 0 0 !important;
        background: #fff !important;
    }

    .m-topbar__nav-wrapper,
    .m-topbar__nav {
        height: 88px !important;
        min-height: 88px !important;
        display: flex !important;
        align-items: center !important;
    }

    .language-switcher--topbar {
        display: inline-flex !important;
        align-items: center !important;
        margin: 0 !important;
    }

    .language-switcher--brand,
    .moex-user-menu-brand-wrapper {
        display: none !important;
    }

    body.m-header--fixed .m-body,
    .m-header--fixed .m-body {
        padding-top: 88px !important;
    }
}

/* ==========================================================
   HEADER 400% - texto Money visible y accesible sin superposición
   ========================================================== */

@media (max-width: 1024px) {
    .m-brand__logo {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: 42vw !important;
        display: flex !important;
        align-items: center !important;
        gap: .5rem !important;
        overflow: visible !important;
    }

    .m-brand__logo .m-brand__logo-wrapper {
        flex: 0 0 auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        max-width: 62px !important;
        overflow: visible !important;
    }

    .m-brand__logo img {
        max-width: 56px !important;
        max-height: 56px !important;
        width: auto !important;
        height: auto !important;
    }

    .m-brand__logo .m-header__title {
        display: inline-flex !important;
        align-items: center !important;
        min-width: 0 !important;
        max-width: calc(42vw - 70px) !important;
        margin-left: .35rem !important;
        color: #025097 !important;
        line-height: 1.15 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    .m-brand__logo .m-header__title sub,
    .m-brand__logo .m-header__title b {
        color: #025097 !important;
        font-size: clamp(.85rem, 4vw, 1rem) !important;
        line-height: 1.15 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    .m-brand__tools {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: .5rem !important;
    }
}

/* En 400% se compacta, pero el texto sigue visible */
@media (max-width: 520px) {
    .m-brand__logo {
        max-width: 36vw !important;
        gap: .35rem !important;
    }

    .m-brand__logo .m-brand__logo-wrapper {
        max-width: 50px !important;
    }

    .m-brand__logo img {
        max-width: 46px !important;
        max-height: 46px !important;
    }

    .m-brand__logo .m-header__title {
        max-width: calc(36vw - 54px) !important;
        margin-left: .25rem !important;
    }

    .m-brand__logo .m-header__title sub,
    .m-brand__logo .m-header__title b {
        font-size: .82rem !important;
        line-height: 1.1 !important;
    }

    .language-switcher--brand .language-switcher__button {
        max-width: 7rem !important;
        padding: .45rem .55rem !important;
    }

    .language-switcher--brand .language-switcher__button > span {
        max-width: 3.75rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: #111827 !important;
    }
}

/* Pantallas extremadamente estrechas: texto más pequeño, pero no oculto */
@media (max-width: 380px) {
    .m-brand__logo {
        max-width: 34vw !important;
    }

    .m-brand__logo .m-header__title {
        max-width: calc(34vw - 48px) !important;
    }

    .m-brand__logo .m-header__title sub,
    .m-brand__logo .m-header__title b {
        font-size: .72rem !important;
        line-height: 1.05 !important;
    }
}
/* ==========================================================
   PROFILE DROPDOWN - Zoom alto: lista vertical accesible
   ========================================================== */

@media (max-width: 1024px) {
    .moex-user-menu-brand-wrapper .moex-user-menu-dropdown,
    .moex-user-menu-dropdown {
        position: fixed !important;
        top: calc(var(--moex-header-height, 96px) + .5rem) !important;
        right: .75rem !important;
        left: .75rem !important;
        width: auto !important;
        max-width: calc(100vw - 1.5rem) !important;
        max-height: calc(100vh - var(--moex-header-height, 96px) - 1rem) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        z-index: 5000 !important;
        transform: none !important;
        background: #fff !important;
    }

    .moex-user-menu-dropdown .m-dropdown__inner,
    .moex-user-menu-dropdown .m-dropdown__body,
    .moex-user-menu-dropdown .m-dropdown__content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .moex-user-menu-dropdown .m-card-user {
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
        width: 100% !important;
        padding: 1rem !important;
    }

    .moex-user-menu-dropdown .m-card-user__pic {
        flex: 0 0 auto !important;
    }

    .moex-user-menu-dropdown .m-card-user__pic img {
        width: 64px !important;
        height: 64px !important;
        max-width: 64px !important;
        max-height: 64px !important;
    }

    .moex-user-menu-dropdown .m-card-user__details {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .moex-user-menu-name,
    .moex-user-menu-email {
        display: block !important;
        color: #111827 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        line-height: 1.35 !important;
    }

    .moex-user-menu-list {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        padding: .5rem 1rem 1rem !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .moex-user-menu-list .m-nav__item {
        display: block !important;
        width: 100% !important;
        margin: 0 0 .35rem 0 !important;
        padding: 0 !important;
    }

    .moex-user-menu-link {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: .75rem !important;
        width: 100% !important;
        min-height: 48px !important;
        height: auto !important;
        padding: .75rem 1rem !important;
        color: #111827 !important;
        background: #fff !important;
        border-radius: .25rem !important;
        text-decoration: none !important;
        text-align: left !important;
    }

    .moex-user-menu-link .m-nav__link-icon {
        flex: 0 0 2rem !important;
        width: 2rem !important;
        min-width: 2rem !important;
        color: #025097 !important;
        opacity: 1 !important;
        font-size: 1.35rem !important;
        text-align: center !important;
    }

    .moex-user-menu-link .m-nav__link-text {
        display: block !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        color: #111827 !important;
        font-weight: 700 !important;
        font-size: 1rem !important;
        line-height: 1.35 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        text-align: left !important;
    }

    .moex-user-menu-link:hover,
    .moex-user-menu-link:focus {
        background: #e5e7eb !important;
        text-decoration: underline !important;
    }

    .moex-user-menu-link:hover .m-nav__link-text,
    .moex-user-menu-link:focus .m-nav__link-text {
        color: #003f78 !important;
        text-decoration: underline !important;
    }

    .moex-user-menu-dropdown .m-nav__separator {
        display: block !important;
        width: 100% !important;
        height: 1px !important;
        margin: .5rem 0 !important;
        background: #d7dce3 !important;
    }

    .moex-logout-button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 8rem !important;
        min-height: 48px !important;
        padding: .75rem 1.25rem !important;
        color: #025097 !important;
        background: #fff !important;
        border: 2px solid #025097 !important;
        border-radius: 999px !important;
        font-weight: 700 !important;
        text-align: center !important;
    }

    .moex-logout-button:hover,
    .moex-logout-button:focus {
        color: #fff !important;
        background: #025097 !important;
        border-color: #025097 !important;
    }

    .moex-user-menu-link:focus-visible,
    .moex-logout-button:focus-visible {
        outline: 3px solid #025097 !important;
        outline-offset: 3px !important;
        box-shadow: 0 0 0 3px #fff !important;
    }
}