/* =========================================================
   Voz Del Reino — application menu
   ========================================================= */

body.vdr-menu-open {
    overflow: hidden;
}

.menu {
    position: relative;
    z-index: 1002;
    display: grid;
    place-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.menu svg {
    width: 27px;
    height: 27px;
    pointer-events: none;
}

.vdr-app-menu {
    position: fixed;
    inset: 0;
    z-index: 100000;
    visibility: hidden;
    pointer-events: none;
}

.vdr-app-menu.is-open {
    visibility: visible;
    pointer-events: auto;
}

.vdr-app-menu__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(1, 13, 36, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition:
        background 220ms ease,
        backdrop-filter 220ms ease;
}

.vdr-app-menu.is-open .vdr-app-menu__backdrop {
    background: rgba(1, 13, 36, 0.68);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.vdr-app-menu__panel {
    position: absolute;
    top: 0;
    right: 0;

    width: min(86vw, 350px);
    height: 100%;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;

    padding:
        max(18px, env(safe-area-inset-top))
        18px
        max(22px, env(safe-area-inset-bottom));

    border-left: 1px solid rgba(255, 255, 255, 0.12);

    background:
        linear-gradient(
            165deg,
            #102b5d 0%,
            #081d43 46%,
            #061632 100%
        );

    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.34);

    transform: translateX(105%);
    transition: transform 240ms cubic-bezier(.2, .75, .25, 1);
}

.vdr-app-menu.is-open .vdr-app-menu__panel {
    transform: translateX(0);
}

.vdr-app-menu__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 17px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.vdr-app-menu__logo {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    object-fit: contain;
    border-radius: 14px;
    background: #ffffff;
    padding: 5px;
    box-sizing: border-box;
}

.vdr-app-menu__brand {
    min-width: 0;
    flex: 1;
}

.vdr-app-menu__brand strong {
    display: block;
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.15;
}

.vdr-app-menu__brand span {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vdr-app-menu__close {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.vdr-app-menu__close svg {
    width: 20px;
    height: 20px;
}

.vdr-app-menu__nav {
    display: grid;
    gap: 9px;
    margin-top: 20px;
}

.vdr-app-menu__item {
    width: 100%;
    min-height: 54px;
    box-sizing: border-box;
    padding: 0 15px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition:
        background 150ms ease,
        border-color 150ms ease,
        transform 150ms ease;
}

.vdr-app-menu__item:hover,
.vdr-app-menu__item:focus-visible {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.18);
}

.vdr-app-menu__item:active {
    transform: scale(0.985);
}

.vdr-app-menu__item-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.11);
}

.vdr-app-menu__item-icon svg {
    width: 19px;
    height: 19px;
}

.vdr-app-menu__item-copy {
    min-width: 0;
    flex: 1;
}

.vdr-app-menu__item-copy strong {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.vdr-app-menu__item-copy span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    line-height: 1.25;
}

.vdr-app-menu__chevron {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    opacity: 0.55;
}

.vdr-app-menu__footer {
    margin-top: auto;
    padding-top: 18px;
    text-align: center;
    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
    line-height: 1.45;
}

@media (max-width: 370px) {
    .vdr-app-menu__panel {
        width: 90vw;
        padding-inline: 15px;
    }

    .vdr-app-menu__item {
        min-height: 51px;
        padding-inline: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vdr-app-menu__panel,
    .vdr-app-menu__backdrop {
        transition: none;
    }
}

/* =========================================================
   Reliable menu interaction fixes
   ========================================================= */

#vdrMenuOpen {
    position: relative !important;
    z-index: 10001 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

#vdrMenuOpen svg,
#vdrMenuOpen path {
    pointer-events: none !important;
}

#vdrAppMenu {
    z-index: 2147483000 !important;
}

#vdrAppMenu .vdr-app-menu__backdrop {
    z-index: 1 !important;
}

#vdrAppMenu .vdr-app-menu__panel {
    z-index: 2 !important;
    pointer-events: auto !important;
}

#vdrAppMenu.is-open {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#vdrAppMenu.is-open .vdr-app-menu__panel {
    transform: translate3d(0, 0, 0) !important;
}

/* Menu emergency interaction override */
#vdrMenuOpen {
    position: relative !important;
    z-index: 999999 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

#vdrAppMenu {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483640 !important;
}

#vdrAppMenu.is-open {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#vdrAppMenu.is-open .vdr-app-menu__panel {
    transform: translateX(0) !important;
    visibility: visible !important;
}

#vdrAppMenu .vdr-app-menu__panel,
#vdrAppMenu .vdr-app-menu__backdrop,
#vdrMenuClose,
#vdrAppMenu .vdr-app-menu__item {
    pointer-events: auto !important;
}

/* Larger square app icon in slide-out menu */
.vdr-app-menu__logo {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    flex: 0 0 64px !important;
    object-fit: cover !important;
    border-radius: 16px !important;
}

/* Larger menu app icon with less visible white border */
.vdr-app-menu__logo {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    flex: 0 0 72px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 18px !important;
    transform: scale(1.08) !important;
}


/* Final menu icon sizing */
.vdr-app-menu__logo {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    flex: 0 0 72px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 18px !important;
    transform: none !important;
}


/* Strongly cropped menu app icon */
.vdr-app-menu__logo {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    flex: 0 0 72px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 18px !important;
    transform: none !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}


/* Clean app-version footer */
.vdr-app-menu__footer {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 18px 16px 20px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    letter-spacing: 0.02em !important;
    color: rgba(255, 255, 255, 0.52) !important;
    text-align: center !important;
}

.vdr-app-menu__version-label {
    font-weight: 400 !important;
}

.vdr-app-menu__version-number {
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.72) !important;
}
