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

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

/* Desktop User area with bell */
.app-topbar-desktop-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   TOP APP BAR
   ============================================ */
.app-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #010c06;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1030;
}

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

.app-topbar-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;
    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: #0a4a2e;
    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-item.active {
    color: #1a56a8;
}

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

.app-bottomnav-item:hover {
    color: #1a56a8;
}

/* ============================================
   CONTENT AREA
   ============================================ */
.app-content {
    padding-top: 56px;
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
    background-color: #14190d;
    color: #fff;
}

/* ============================================
   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: 0;
    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;
}

/* ============================================
   PWA INSTALL BANNER
   ============================================ */
.pwa-install-banner {
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 12px);
    left: 12px;
    right: 12px;
    background-color: #1a2a1d;
    border: 1px solid rgba(255,212,1,0.2);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1035;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    animation: pwaSlideUp 0.4s ease;
}

.pwa-install-banner.hidden {
    display: none;
}

@keyframes pwaSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.pwa-install-banner img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.pwa-install-banner-text {
    flex: 1;
}

.pwa-install-banner-title {
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.pwa-install-banner-desc {
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
}

.pwa-install-banner .btn-install {
    padding: 8px 16px;
    background-color: #ffd401;
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.pwa-install-banner .btn-install:hover {
    background-color: #e6c000;
}

.pwa-install-banner .btn-dismiss {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 4px;
    font-size: 1.1rem;
}

/* ============================================
   PWA iOS INSTALL BANNER
   ============================================ */
.pwa-ios-banner {
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 12px);
    left: 12px;
    right: 12px;
    z-index: 1035;
    animation: pwaSlideUp 0.4s ease;
}

.pwa-ios-banner.hidden {
    display: none;
}

.pwa-ios-banner-content {
    background-color: #1a2a1d;
    border: 1px solid rgba(255,212,1,0.2);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.pwa-ios-banner-content img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.pwa-ios-banner-text {
    flex: 1;
}

.pwa-ios-banner-title {
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.pwa-ios-banner-steps {
    color: rgba(255,255,255,0.6);
    font-size: 0.78rem;
    line-height: 1.4;
}

.pwa-ios-banner-steps i {
    color: #ffd401;
    font-size: 0.9rem;
    vertical-align: middle;
}

.pwa-ios-banner-steps strong {
    color: #ffd401;
}

.pwa-ios-banner-arrow {
    width: 16px;
    height: 16px;
    background-color: #1a2a1d;
    border-right: 1px solid rgba(255,212,1,0.2);
    border-bottom: 1px solid rgba(255,212,1,0.2);
    transform: rotate(45deg);
    margin: -9px auto 0;
}

/* ============================================
   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)
   ============================================ */
@media (min-width: 768px) {
    /* Hide bottom nav on desktop */
    .app-bottomnav {
        display: none;
    }

    /* Show desktop top nav - not fixed, scrolls with page */
    .app-topbar {
        position: relative;
        height: 64px;
        padding: 0 40px;
    }

    .app-topbar-logo {
        height: 80px;
    }

    .app-topbar-mobile-only {
        display: none;
    }

    .app-topbar-desktop-nav {
        display: flex !important;
        align-items: center;
        gap: 6px;
        flex: 1;
        justify-content: center;
    }

    .app-topbar-nav-link {
        color: #0a4a2e;
        text-decoration: none;
        font-family: 'Mulish', sans-serif;
        font-size: 0.92rem;
        font-weight: 700;
        padding: 10px 20px;
        border-radius: 8px;
        background-color: rgba(255,255,255,0.6);
        border: 1px solid rgba(0,0,0,0.06);
        box-shadow: 0 1px 3px rgba(0,0,0,0.04);
        transition: all 0.25s ease;
        white-space: nowrap;
    }

    .app-topbar-nav-link:hover {
        color: #fff;
        background-color: #0a4a2e;
        box-shadow: 0 4px 14px rgba(10,74,46,0.3);
        transform: translateY(-1px);
    }

    .app-topbar-nav-link.active {
        color: #fff;
        background-color: #1a56a8;
        border-color: #1a56a8;
        box-shadow: 0 4px 14px rgba(26,86,168,0.3);
    }

    /* Dropdown menus */
    .app-topbar-dropdown {
        position: relative;
    }

    .app-topbar-dropdown:hover > .app-topbar-nav-link {
        color: #fff;
        background-color: #0a4a2e;
        box-shadow: 0 4px 14px rgba(10,74,46,0.3);
        transform: translateY(-1px);
    }

    .app-topbar-dropdown-menu {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 50%;
        transform: translateX(-50%);
        min-width: 240px;
        background-color: #fff;
        border-radius: 12px;
        box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
        padding: 10px 0;
        z-index: 1050;
        border: 1px solid rgba(0,0,0,0.06);
    }

    .app-topbar-dropdown-menu::before {
        content: '';
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        width: 12px;
        height: 12px;
        background-color: #fff;
        border-top: 1px solid rgba(0,0,0,0.06);
        border-left: 1px solid rgba(0,0,0,0.06);
    }

    .app-topbar-dropdown:hover .app-topbar-dropdown-menu {
        display: block;
    }

    .app-topbar-dropdown-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 20px;
        color: #444;
        text-decoration: none;
        font-family: 'Mulish', sans-serif;
        font-size: 0.9rem;
        font-weight: 600;
        transition: all 0.2s ease;
        border-left: 3px solid transparent;
    }

    .app-topbar-dropdown-item:hover {
        background-color: #f0faf4;
        color: #0a4a2e;
        border-left-color: #0a4a2e;
    }

    .app-topbar-dropdown-item i {
        font-size: 1.05rem;
        width: 22px;
        text-align: center;
        color: #0a4a2e;
        transition: transform 0.2s;
    }

    .app-topbar-dropdown-item:hover i {
        transform: scale(1.15);
    }

    .app-topbar-dropdown-divider {
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(0,0,0,0.08), transparent);
        margin: 8px 16px;
    }

    .app-topbar-dropdown-logout {
        color: #dc3545;
    }

    .app-topbar-dropdown-logout:hover {
        background-color: #fef2f2;
        color: #dc3545;
        border-left-color: #dc3545;
    }

    .app-topbar-dropdown-logout i {
        color: #dc3545;
    }

    /* Content area - no bottom padding needed */
    .app-content {
        padding-top: 0;
        padding-bottom: 0;
    }

    /* Drawer on desktop - wider */
    .app-drawer {
        width: 320px;
    }

    /* PWA install banner position */
    .pwa-install-banner {
        bottom: 20px;
        left: auto;
        right: 20px;
        max-width: 380px;
    }
}

/* ============================================
   GLOBAL SHOP HEADER (mobile user header)
   ============================================ */
.shop-header {
    background: linear-gradient(135deg, #1a3a8a, #0d2563);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.shop-header-back {
    color: #fff;
    font-size: 1.3rem;
    text-decoration: none;
    display: flex;
    align-items: center;
}

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

.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: 700;
    font-size: 1rem;
    color: #ffd401;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-header-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
    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;
}

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

.shop-header-badge-medal {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffd401;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
    border: none;
    z-index: 10;
    padding: 3px;
}

.shop-header-badge-medal img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

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

/* ============================================
   MOBILE ONLY (< 768px)
   ============================================ */
@media (max-width: 767.98px) {
    .app-topbar {
        display: none !important;
    }

    .app-content {
        padding-top: 0;
    }
}

/* Hide shop-header on desktop (topbar handles it) */
@media (min-width: 768px) {
    #globalShopHeader {
        display: none;
    }
}

/* ============================================
   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));
    }
}
