﻿/**
 * PWA Mobile Styles
 * Applies ONLY on mobile (≤768px)
 * Added: 2026-02-19
 */

/* ─── Bottom Navigation Bar ─────────────────────────────── */
.pwa-bottom-nav {
    display: none; /* hidden by default, shown on mobile */
}

/* Main Manu Items only */
@media (max-width: 768px) {
    .hide_on_pwa{
        display: none;
    }
}

@media (max-width: 1024px) {

    /* Padding so page content is never hidden under the bottom bar */
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .mobile-navbar {
        background-color: #1b1e2eeb !important;
    }

    /* ── Mobile menu fade-in / fade-out ─────────────────── */
    .mobile-navbar.show {
        animation: mobileNavFadeIn 0.3s ease forwards;
    }

    .mobile-navbar.is-hiding {
        display: block !important;
        animation: mobileNavFadeOut 0.3s ease forwards;
    }

    @keyframes mobileNavFadeIn {
        from { opacity: 0; transform: translateY(-6px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    @keyframes mobileNavFadeOut {
        from { opacity: 1; transform: translateY(0); }
        to   { opacity: 0; transform: translateY(-6px); }
    }
    .mobile-navbar .menu-item a {
        justify-content: center;
    }
    /* 
    s.mobile-navbar-button { 
        max-width: 36px;
        max-height: 36px;
    }
    .mobile-navbar-button img{ 
        width: 100%;
        object-fit: contain;
    }
     */

    .subscribe-action {
        margin-right: initial !important;
        margin-left: initial !important;
    }


    /* ── App-like transitions: keep header/footer above the loader ─ */
    /* loader z-index: 9999 | bottom-nav: 10000 | header: 10001     */
    #masthead {
        z-index: 10001 !important;
    }

    /* ── Bottom Nav Bar ──────────────────────────────────── */
    .pwa-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 10000;
        height: 64px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background-color: #1c1f2e;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        justify-content: space-around;
        align-items: center;
    }

    .pwa-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex: 1;
        padding: 8px 4px;
        color: rgba(255, 255, 255, 0.45);
        text-decoration: none !important;
        font-size: 10px;
        font-weight: 500;
        letter-spacing: 0.02em;
        line-height: 1;
        transition: color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        font-family: var(--font-family-primary);
    }

    .pwa-nav-item:hover,
    .pwa-nav-item:focus {
        color: rgba(255, 255, 255, 0.85);
        text-decoration: none !important;
    }

    .pwa-nav-item.active {
        color: #ffffff;
    }

    .pwa-nav-item img {
        height: 26px;
        width: auto;
        flex-shrink: 0;
        opacity: 0.4;
        transition: opacity 0.2s ease;
    }

    .pwa-nav-item.active img {
        opacity: 1;
    }

    .pwa-nav-item span {
        display: block;
        white-space: nowrap;
    }

    /* ── Mobile Header: Login / Avatar Button ────────────── */
    .mobile-header-profile {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-login-btn {
        display: inline-flex;
        align-items: center;
        color: #ffffff;
        font-size: 12px;
        font-weight: 600;
        text-decoration: none !important;
        padding: 5px 12px;
        border: 1.5px solid #ffffff;
        border-radius: 20px;
        line-height: 1.2;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.2s ease, color 0.2s ease;
        text-transform: uppercase;
        font-family: var(--font-family-primary);
        font-weight: 300;
    }

    .mobile-login-btn:hover,
    .mobile-login-btn:focus {
        background: #ffffff;
        color: #1c1f2e;
        text-decoration: none !important;
    }

    .mobile-avatar-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none !important;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-avatar-btn img,
    .mobile-avatar-btn .avatar {
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        object-fit: cover;
        display: block;
    }

    /* ── Hamburger ↔ Close icon toggle ──────────────────── */
    .mobile-navbar-button {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .nav-icon-hamburger,
    .nav-icon-close {
        height: 32px;
        width: auto;
        display: block;
        transition: opacity 0.25s ease, transform 0.3s ease;
    }

    .nav-icon-close {
        height: 26px;
    }

    /* Close icon: sits on top, hidden + rotated away by default */
    .nav-icon-close {
        position: absolute;
        inset: 0;
        margin: auto;
        opacity: 0;
        transform: rotate(45deg) scale(0.7);
        pointer-events: none;
    }

    /* Hamburger: visible by default */
    .nav-icon-hamburger {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }

    /* Open state: swap icons */
    .mobile-navbar-button.is-open .nav-icon-hamburger {
        opacity: 0;
        transform: rotate(-45deg) scale(0.7);
    }

    .mobile-navbar-button.is-open .nav-icon-close {
        opacity: 1;
        transform: rotate(0deg) scale(1);
        pointer-events: auto;
    }

    /* ── Adjust header right section to fit both buttons ─── */
    .mobile-navbar-button-wrap {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* ── PWA Install Banner ─────────────────────────────── */
    .pwa-install-banner {
        position: fixed;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
        left: 0;
        right: 0;
        z-index: 9999;
        background: #252a3d;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        padding: 12px 16px;
        animation: pwa-slide-up 0.35s ease;
    }

    @keyframes pwa-slide-up {
        from { transform: translateY(100%); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
    }

    .pwa-install-banner-inner {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .pwa-install-banner-icon img {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .pwa-install-banner-text {
        flex: 1;
        min-width: 0;
    }

    .pwa-install-banner-text strong {
        display: block;
        color: #ffffff;
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 2px;
        line-height: 1.3;
    }

    .pwa-install-banner-text span {
        display: block;
        color: rgba(255, 255, 255, 0.6);
        font-size: 11px;
        line-height: 1.4;
    }

    .pwa-install-ios-hint svg {
        width: 13px;
        height: 13px;
        fill: rgba(255, 255, 255, 0.6);
        vertical-align: middle;
        margin: 0 2px -1px;
    }

    .pwa-install-banner-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .pwa-install-btn {
        display: inline-flex;
        align-items: center;
        background: #FFEE34;
        color: #1c1f2e;
        border: none;
        border-radius: 16px;
        padding: 6px 16px;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
        line-height: 1.4;
    }

    .pwa-dismiss-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.45);
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
        padding: 0;
        -webkit-tap-highlight-color: transparent;
    }

}
/* End @media ≤1024px */
