/* ============================================
   VaiDeLP App Shell - Mobile-First Layout
   ============================================ */

/* Prevent double-tap zoom on iOS */
* {
    touch-action: manipulation;
}

/* Prevent horizontal scrollbar from full-bleed 100vw elements */
html, body {
    overflow-x: hidden;
}

/* Bell Icon (sininho customizado) */
.bell-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Desktop nav e user — escondidos no mobile */
.app-topbar-desktop-nav {
    display: none;
}

.app-topbar-desktop-user {
    display: none;
    align-items: center;
    gap: 16px;
}

/* Desktop avatar com brasão */
.desktop-user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 4px 12px 4px 4px;
    border-radius: 30px;
    transition: background 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.desktop-user-profile:hover {
    background: rgba(255, 255, 255, 0.1);
}

.desktop-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.desktop-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #424242;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.desktop-avatar span {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
}

.desktop-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.desktop-avatar-medal {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.desktop-avatar-medal img,
.desktop-avatar-medal svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.desktop-username {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Desktop user dropdown menu */
.desktop-user-menu-wrap {
    position: relative;
}

.desktop-user-chevron {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
    transition: transform 0.2s;
}

.desktop-user-menu-wrap.open .desktop-user-chevron {
    transform: rotate(180deg);
}

.desktop-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #0f1f14;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1060;
    animation: dropdownFadeIn 0.15s ease;
}

.desktop-user-menu-wrap.open .desktop-user-dropdown {
    display: block;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.desktop-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.desktop-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.desktop-dropdown-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: #ffd401;
}

.desktop-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 12px;
}

.desktop-dropdown-logout {
    color: rgba(255, 107, 107, 0.8);
}

.desktop-dropdown-logout:hover {
    background: rgba(220, 53, 69, 0.12);
    color: #ff6b6b;
}

.desktop-dropdown-logout i {
    color: rgba(255, 107, 107, 0.8);
}

/* ============================================
   TOP APP BAR
   ============================================ */
.app-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(72px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    background-color: #1457AA;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 24px;
    padding-right: 24px;
    gap: 16px;
    z-index: 1030;
    flex-shrink: 0;
}

/* Mobile: esconde topbar, usa shop-header */
.app-topbar {
    display: none;
}

/* Desktop: mostra topbar com navegação */
@media (min-width: 992px) {
    .app-topbar {
        display: flex !important;
    }
    .app-topbar-desktop-nav {
        display: flex !important;
        align-items: center;
        gap: 4px;
        flex: 1;
        justify-content: center;
    }
    .app-topbar-desktop-user {
        display: flex !important;
    }
    .app-topbar-spacer,
    .app-topbar-title,
    .app-topbar-bell {
        display: none !important;
    }
    .shop-header {
        display: none !important;
    }
    .app-bottomnav {
        display: none !important;
    }
    .app-content {
        padding-top: calc(72px + env(safe-area-inset-top, 0px)) !important;
    }
}

/* Desktop nav links */
.app-topbar-nav-link {
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Mulish', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.app-topbar-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.app-topbar-nav-link.active {
    background: rgba(255, 212, 1, 0.15);
    color: #ffd401;
}

.app-topbar-nav-link i {
    color: #ffd401;
}

/* Notebook pequeno: comprimir menu */
@media (min-width: 992px) and (max-width: 1399px) {


    .app-topbar {
        padding-left: 16px;
        padding-right: 16px;
        gap: 10px;
    }
    .desktop-username {
        display: none;
    }
}

/* Telas muito pequenas desktop: esconder ícones dos links */
@media (min-width: 992px) and (max-width: 1199px) {
    .app-topbar-nav-link {
        font-size: 0.78rem;
        padding: 6px 8px;
    }
    .app-topbar-nav-link i {
        display: none;
    }
}

/* Left spacer to balance the bell on the right, keeping logo centered */
.app-topbar-spacer {
    width: 44px;
    flex-shrink: 0;
}

.app-topbar-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.app-topbar-logo img {
    height: 40px;
    width: auto;
}

/* ============================================
   Selo Premium — abaixo do avatar (Flutter parity)
   ============================================ */
.selo-premium {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 3;
    display: block;
    object-fit: contain;
}
.selo-premium--profile     { bottom: -12px; width: 32px; height: 32px; }
.selo-premium--member      { bottom: -6px;  width: 18px; height: 18px; }
.selo-premium--ranking     { bottom: -6px;  width: 16px; height: 16px; }
.selo-premium--podium-gold { bottom: -4px;  width: 14px; height: 14px; }
.selo-premium--podium      { bottom: -4px;  width: 12px; height: 12px; }

/* Bell icon in topbar for mobile tab screens (like Flutter AppBarLpNotifications) */
.app-topbar-bell {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.app-topbar-bell .notif-bell-img {
    width: 38px;
    height: 38px;
    transform-origin: 50% 0;
}

/* Flutter ShakingBell animation: 500ms, ±15° decreasing */
.app-topbar-bell.shaking .notif-bell-img {
    animation: bellShake 500ms ease-in-out;
}

@keyframes bellShake {
    0%   { transform: rotate(0deg); }
    12%  { transform: rotate(15deg); }
    37%  { transform: rotate(-15deg); }
    62%  { transform: rotate(10deg); }
    87%  { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

/* Notification badge — Flutter: 16x16, top-right, white circle */
.app-topbar-bell .notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #fff;
    color: #001807;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.app-topbar-title {
    display: none; /* Flutter tabs only show logo + bell, no title */
    flex: 1;
    text-align: center;
    color: #ffd401;
    font-family: 'Mulish', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-topbar-action {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.7);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.app-topbar-action:hover {
    background-color: rgba(255,255,255,0.08);
    color: #fff;
}

/* ============================================
   BOTTOM NAVIGATION (mobile only)
   ============================================ */
.app-bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #ffd401;
    border-top: none;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}

.app-bottomnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px 8px;
    color: #000000;
    text-decoration: none;
    font-family: 'Mulish', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: color 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
}

.app-bottomnav-item i {
    font-size: 1.5rem;
    margin-bottom: 3px;
    transition: transform 0.2s, color 0.2s;
}

.app-bottomnav-icon {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px;
    max-height: 28px;
    object-fit: contain;
    margin-bottom: 2px;
    transition: transform 0.2s, filter 0.2s;
}

.app-bottomnav-item.active {
    color: #1457AA;
}

.app-bottomnav-item.active i {
    transform: scale(1.15);
}

.app-bottomnav-item.active .app-bottomnav-icon {
    transform: scale(1.15);
    /* #1457AA via CSS filter — computed for black→sapphireBlue */
    filter: invert(22%) sepia(90%) saturate(1800%) hue-rotate(200deg) brightness(90%) contrast(95%);
}

.app-bottomnav-item:hover {
    color: #1457AA;
}

/* ============================================
   CONTENT AREA
   ============================================ */
.app-content {
    padding-top: calc(72px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
    background-color: #14190d;
    color: #fff;
    flex: 1;
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

@media (max-width: 991.98px) {
    .app-content {
        overflow-x: hidden;
    }
}


/* ============================================
   DRAWER MENU ("Mais")
   ============================================ */
.app-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.app-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.app-drawer {
    position: fixed;
    top: calc(72px + env(safe-area-inset-top, 0px));
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background-color: #0a1a0d;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.app-drawer-overlay.open .app-drawer {
    transform: translateX(0);
}

.app-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.app-drawer-header img {
    height: 28px;
    width: auto;
}

.app-drawer-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.2rem;
    transition: background-color 0.2s, color 0.2s;
}

.app-drawer-close:hover {
    background-color: rgba(255,255,255,0.08);
    color: #fff;
}

.app-drawer-user {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-drawer-user-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd401;
    font-size: 1.2rem;
}

.app-drawer-user-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.app-drawer-user-label {
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem;
}

.app-drawer-nav {
    flex: 1;
    padding: 12px 0;
}

.app-drawer-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-family: 'Mulish', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.app-drawer-link:hover {
    background-color: rgba(255,255,255,0.05);
    color: #fff;
}

.app-drawer-link.active {
    color: #ffd401;
    background-color: rgba(255,212,1,0.05);
}

.app-drawer-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.app-drawer-link-highlight {
    background-color: rgba(26,86,168,0.3);
    color: #fff;
    font-weight: 600;
    border-left: 3px solid #1a56a8;
}

.app-drawer-link-highlight i {
    color: #ffd401;
}

.app-drawer-link-highlight:hover {
    background-color: rgba(26,86,168,0.4);
    color: #fff;
}

.app-drawer-divider {
    height: 1px;
    background-color: rgba(255,255,255,0.06);
    margin: 8px 20px;
}

.app-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.app-drawer-footer .btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background-color: rgba(220,53,69,0.1);
    border: 1px solid rgba(220,53,69,0.2);
    color: #ff6b6b;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.app-drawer-footer .btn-logout:hover {
    background-color: rgba(220,53,69,0.2);
    color: #ff6b6b;
}

.app-drawer-footer .btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background-color: #ffd401;
    border: none;
    color: #000;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.app-drawer-footer .btn-login:hover {
    background-color: #e6c000;
    color: #000;
}

/* ============================================
   PAGE CONTENT OVERRIDES (for app layout)
   ============================================ */
.app-content .page-content {
    padding-top: 1.5rem;
    min-height: auto;
}

/* Login container within app layout */
.app-content .login-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* ============================================
   DESKTOP LAYOUT (>= 768px)
   ============================================ */
/* Desktop: drawer wider, hide desktop-only elements */
@media (min-width: 768px) {
    .app-drawer {
        width: 320px;
    }
}

/* ============================================
   GLOBAL SHOP HEADER (mobile user header)
   ============================================ */
.shop-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #1457AA;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 8px 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid rgba(214, 168, 86, 0.30);
    min-height: 80px;
    z-index: 1031;
}

.shop-header-back {
    color: #fff;
    font-size: 1.6rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    flex-shrink: 0;
}

.shop-header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    justify-content: flex-start;
}

.shop-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 3px solid transparent;
    transition: border-color 0.3s;
}

.shop-header-avatar span {
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
}

.shop-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-header-info {
    min-width: 0;
}

.shop-header-name {
    font-family: 'Mulish', sans-serif;
    font-weight: 900;
    font-size: 14px;
    color: #FFD401;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-header-sub {
    font-size: 12px;
    color: #fff;
    font-weight: 700;
    line-height: 1.3;
}

.shop-header-bell {
    flex-shrink: 0;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-header-bell .notif-bell-img {
    width: 36px;
    height: 36px;
    transform-origin: 50% 0;
}

.shop-header-bell.shaking .notif-bell-img {
    animation: bellShake 500ms ease-in-out;
}

.shop-header-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
}

.shop-header-badge-medal {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    z-index: 10;
}

.shop-header-badge-medal img,
.shop-header-badge-medal svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.shop-header-badge-medal i {
    font-size: 0.7rem;
    color: #fff;
}

/* ============================================
   MOBILE ONLY (< 768px)
   ============================================ */
@media (max-width: 767.98px) {
    /* Mobile: full width */
    .app-content {
        width: 100%;
        padding-top: calc(80px + env(safe-area-inset-top, 0px));
    }
}

/* shop-header always visible — no desktop hiding */

/* ============================================
   LGPD OVERRIDE (above bottom nav on mobile)
   ============================================ */
@media (max-width: 767.98px) {
    .app-content .lgpd-banner {
        bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }
}
