﻿/* AFTERMAN v492 - Menú de cuenta con Font Awesome Free */
.am-topbar,
.am-admin-topbar {
    overflow: visible !important;
    z-index: 1200 !important;
}

.am-top-actions-account {
    overflow: visible !important;
    align-items: center !important;
    gap: 8px !important;
}

.am-account-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 1300;
}

.am-account-trigger {
    border: 1px solid rgba(255, 49, 220, 0.46);
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 45, 222, 0.22), transparent 34%),
        linear-gradient(135deg, rgba(19, 22, 43, 0.92), rgba(9, 15, 31, 0.96));
    color: #fff;
    border-radius: 999px;
    padding: 6px 11px 6px 7px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    box-shadow:
        0 0 0 1px rgba(69, 203, 255, 0.12) inset,
        0 10px 24px rgba(0, 0, 0, 0.30),
        0 0 18px rgba(227, 39, 255, 0.14);
    font-family: inherit;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.am-account-trigger:hover,
.am-account-menu.is-open .am-account-trigger {
    transform: translateY(-1px);
    border-color: rgba(67, 207, 255, 0.72);
    box-shadow:
        0 0 0 1px rgba(255, 49, 220, 0.16) inset,
        0 12px 28px rgba(0, 0, 0, 0.36),
        0 0 24px rgba(50, 203, 255, 0.18);
}

.am-account-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 10px;
    letter-spacing: .8px;
    color: #fff;
    background: linear-gradient(135deg, #f229d6, #35c9ff);
    box-shadow: 0 0 16px rgba(255, 45, 222, 0.26);
}

.am-account-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.05;
    min-width: 0;
}

.am-account-copy strong {
    display: block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .2px;
    white-space: nowrap;
}

.am-account-copy small {
    display: block;
    margin-top: 2px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .9px;
    text-transform: uppercase;
    color: rgba(230, 235, 255, 0.62);
    white-space: nowrap;
}

.am-account-chevron {
    font-size: 14px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.74);
    transform: translateY(-1px);
    transition: transform .16s ease;
}

.am-account-menu.is-open .am-account-chevron {
    transform: rotate(180deg) translateY(1px);
}

.am-account-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    max-width: min(88vw, 320px);
    padding: 8px;
    border-radius: 20px;
    border: 1px solid rgba(255, 49, 220, 0.34);
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 45, 222, 0.14), transparent 36%),
        radial-gradient(circle at 96% 86%, rgba(44, 202, 255, 0.14), transparent 40%),
        linear-gradient(180deg, rgba(19, 23, 43, 0.98), rgba(8, 12, 27, 0.98));
    box-shadow:
        0 24px 55px rgba(0, 0, 0, 0.52),
        0 0 0 1px rgba(78, 208, 255, 0.10) inset,
        0 0 30px rgba(222, 28, 255, 0.16);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(.985);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    z-index: 1400;
}

.am-account-menu.is-open .am-account-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.am-account-item {
    display: grid;
    grid-template-columns: 34px 1fr;
    column-gap: 9px;
    align-items: center;
    padding: 10px;
    border-radius: 15px;
    text-decoration: none !important;
    color: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid transparent;
    background: transparent;
    transition: background .14s ease, border-color .14s ease, transform .14s ease;
}

.am-account-item:hover,
.am-account-item:focus {
    outline: none;
    transform: translateX(2px);
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(82, 205, 255, 0.20);
}

.am-account-item > span {
    grid-row: 1 / span 2;
    width: 34px;
    height: 34px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 45, 222, 0.22), rgba(52, 200, 255, 0.18));
    box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
}

.am-account-item strong {
    font-size: 12px;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: .1px;
}

.am-account-item em {
    margin-top: 2px;
    font-style: normal;
    font-size: 10px;
    line-height: 1.15;
    font-weight: 700;
    color: rgba(225, 232, 255, 0.58);
}

.am-account-menu-section {
    display: block;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.am-account-item-admin > span {
    background: linear-gradient(135deg, rgba(255, 45, 222, 0.46), rgba(52, 200, 255, 0.30));
}

.am-account-item-danger {
    margin-top: 6px;
    border-color: rgba(255, 55, 113, 0.24);
    background: rgba(255, 55, 113, 0.075);
}

.am-account-item-danger > span {
    background: linear-gradient(135deg, rgba(255, 55, 113, 0.38), rgba(255, 45, 222, 0.20));
}

.am-admin-topbar .am-account-dropdown {
    right: 0;
}

@media (max-width: 680px) {
    .am-topbar,
    .am-admin-topbar {
        min-height: 50px;
    }

    .am-account-trigger {
        min-height: 38px;
        padding: 5px 8px 5px 5px;
        gap: 7px;
    }

    .am-account-avatar {
        width: 27px;
        height: 27px;
        font-size: 9px;
    }

    .am-account-copy strong {
        font-size: 11px;
    }

    .am-account-copy small {
        display: none;
    }

    .am-account-dropdown {
        position: fixed;
        top: 54px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 70px - env(safe-area-inset-bottom));
        overflow: auto;
        border-radius: 18px;
    }

    .am-account-item {
        padding: 9px;
        grid-template-columns: 32px 1fr;
    }

    .am-account-item > span {
        width: 32px;
        height: 32px;
        border-radius: 12px;
    }
}


/* AFTERMAN v492 - Font Awesome Free: ajustes visuales controlados */
.am-account-chevron {
    width: 19px;
    height: 19px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.82);
    transform: none;
}

.am-account-chevron i {
    font-size: 10px;
    line-height: 1;
    transition: transform .16s ease;
}

.am-account-menu.is-open .am-account-chevron {
    transform: none;
    background: rgba(62, 202, 255, 0.12);
    border-color: rgba(62, 202, 255, 0.24);
}

.am-account-menu.is-open .am-account-chevron i {
    transform: rotate(180deg);
}

.am-account-item > span i,
.am-local-mobile-dock__ico i,
.am-bottom-nav a > span i {
    font-size: 14px;
    line-height: 1;
}

.am-account-item-danger > span i {
    transform: translateX(1px);
}

.am-bottom-nav a > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
}

.am-local-mobile-dock__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 680px) {
    .am-account-chevron {
        width: 18px;
        height: 18px;
    }
    .am-account-chevron i {
        font-size: 9px;
    }
    .am-account-item > span i {
        font-size: 13px;
    }
}


/* AFTERMAN v527 - Estado activo real del menú de cuenta */
.am-account-dropdown .am-account-item.is-current,
.am-account-dropdown .am-account-item[aria-current="page"] {
    color: #fff !important;
    background: linear-gradient(135deg, rgba(255, 49, 220, 0.25), rgba(52, 200, 255, 0.15)) !important;
    border-color: rgba(255, 255, 255, 0.24) !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,.10) inset, 0 0 22px rgba(255,49,220,.14) !important;
    position: relative;
}

.am-account-dropdown .am-account-item.is-current > span,
.am-account-dropdown .am-account-item[aria-current="page"] > span {
    color: #fff !important;
    background: linear-gradient(135deg, rgba(255,49,220,.98), rgba(52,200,255,.88)) !important;
    box-shadow: 0 0 17px rgba(255,49,220,.25), 0 0 12px rgba(52,200,255,.15) !important;
}

.am-account-dropdown .am-account-item.is-current strong,
.am-account-dropdown .am-account-item.is-current em,
.am-account-dropdown .am-account-item[aria-current="page"] strong,
.am-account-dropdown .am-account-item[aria-current="page"] em {
    color: #fff !important;
}

.am-account-dropdown .am-account-item.is-current::before,
.am-account-dropdown .am-account-item[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff31cb, #35d9ff);
    box-shadow: 0 0 12px rgba(255,49,203,.30);
}

/* AFTERMAN v818 - blindaje móvil: el dropdown original NO debe abrir en celular/PWA.
   El menú móvil real lo maneja el Offcanvas v818. */
@media (max-width: 1200px), (hover: none), (pointer: coarse) {
    html body .am-account-menu > .am-account-dropdown,
    html body .am-account-menu.is-open > .am-account-dropdown,
    html body [data-am-account-menu] > [data-am-account-dropdown],
    html body [data-am-account-menu].is-open > [data-am-account-dropdown],
    html body [data-am-account-dropdown] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: fixed !important;
        inset: auto !important;
        top: -9999px !important;
        left: -9999px !important;
        right: auto !important;
        bottom: auto !important;
        width: 0 !important;
        height: 0 !important;
        max-width: 0 !important;
        max-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
        transform: none !important;
        z-index: -1 !important;
    }

    html body .am-account-menu.is-open,
    html body [data-am-account-menu].is-open {
        overflow: visible !important;
    }
}

/* AFTERMAN v819 - blindaje móvil: el dropdown antiguo nunca debe renderizarse en teléfono/PWA. */
@media (max-width: 920px), (hover: none), (pointer: coarse) {
    html body .am-account-menu > .am-account-dropdown,
    html body .am-account-menu.is-open > .am-account-dropdown,
    html body [data-am-account-menu] > [data-am-account-dropdown],
    html body [data-am-account-menu].is-open > [data-am-account-dropdown] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        inset: auto !important;
        top: -100000px !important;
        left: -100000px !important;
        right: auto !important;
        bottom: auto !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
        transform: none !important;
        clip: rect(0 0 0 0) !important;
        clip-path: inset(50%) !important;
        z-index: -2147483648 !important;
    }

    html body .am-account-menu.is-open {
        overflow: visible !important;
    }
}
