/* ==========================================================================
   ⚡ CYBER MOBILE UI ENGINE v6.0 - NEXT-GEN ULTRA-FUTURISTIC RESPONSIVE SYSTEM
   Designed for High-End Cyberpunk / Fintech Gaming / Mobile-First Experience
   ========================================================================== */

/* ─── 1. CYBER ANIMATIONS & EFFECTS ─── */
@keyframes cyberOrbPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(217, 70, 239, 0.6), 0 0 32px rgba(168, 85, 247, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.3);
        transform: translateY(-16px) scale(1);
    }
    50% {
        box-shadow: 0 0 28px rgba(217, 70, 239, 0.95), 0 0 50px rgba(168, 85, 247, 0.65), inset 0 0 16px rgba(255, 255, 255, 0.5);
        transform: translateY(-18px) scale(1.05);
    }
}

@keyframes cyberBorderGlow {
    0%, 100% { border-color: rgba(168, 85, 247, 0.4); }
    50% { border-color: rgba(217, 70, 239, 0.85); }
}

@keyframes cyberStatusPing {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 0.2; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

@keyframes cyberHoloScan {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 200%; }
}

/* ─── 2. MOBILE VIEWPORT & BODY GUARDS ─── */
@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 12px)) !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    /* Prevent accidental sideways jitter on mobile swipe */
    html, body {
        overflow-x: hidden !important;
        touch-action: pan-y !important;
    }

    /* Edge-to-edge container margins on mobile */
    .container, .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* ─── 3. MOBILE HEADER HUD BAR (< 992px) ─── */
@media (max-width: 991.98px) {
    .main-navbar {
        padding: 8px 12px !important;
        background: rgba(9, 7, 20, 0.92) !important;
        backdrop-filter: blur(24px) saturate(190%) !important;
        -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
        border-bottom: 1px solid rgba(168, 85, 247, 0.35) !important;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.8) !important;
    }

    .cyber-mobile-header-actions {
        display: flex !important;
        align-items: center;
        gap: 8px;
    }

    /* Holographic Quick Balance Chip */
    .cyber-mobile-balance-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(13, 11, 26, 0.9);
        border: 1px solid rgba(168, 85, 247, 0.4);
        border-radius: 20px;
        padding: 5px 11px;
        text-decoration: none !important;
        box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
        transition: all 0.2s ease;
    }
    .cyber-mobile-balance-pill:active {
        transform: scale(0.95);
        border-color: #d946ef;
        background: rgba(168, 85, 247, 0.2);
    }
    .cyber-mobile-balance-val {
        color: #f1f5f9;
        font-weight: 800;
        font-size: 0.84rem;
        letter-spacing: -0.2px;
    }
    .cyber-mobile-balance-add {
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: linear-gradient(135deg, #a855f7, #d946ef);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.65rem;
        box-shadow: 0 0 8px rgba(217, 70, 239, 0.7);
    }

    /* Cyber Menu Trigger Button */
    .cyber-mobile-menu-btn {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        background: rgba(168, 85, 247, 0.14) !important;
        border: 1px solid rgba(168, 85, 247, 0.4) !important;
        color: #f1f5f9 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
    }
    .cyber-mobile-menu-btn:active {
        transform: scale(0.92);
        background: rgba(168, 85, 247, 0.28) !important;
        border-color: #d946ef !important;
    }
}

/* ─── 4. CYBER DOCK (MOBILE BOTTOM NAVIGATION) ─── */
.cyber-mobile-dock {
    display: none;
}

@media (max-width: 991.98px) {
    .cyber-mobile-dock {
        display: flex;
        align-items: center;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1040;
        background: rgba(9, 7, 20, 0.94);
        backdrop-filter: blur(28px) saturate(200%);
        -webkit-backdrop-filter: blur(28px) saturate(200%);
        border-top: 1px solid rgba(168, 85, 247, 0.4);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.9), 0 -1px 16px rgba(168, 85, 247, 0.3);
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 8px)) 8px;
    }

    /* Top Glowing Neon Indicator Line */
    .cyber-mobile-dock::before {
        content: '';
        position: absolute;
        top: 0;
        left: 8%;
        right: 8%;
        height: 1.5px;
        background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.8), rgba(217, 70, 239, 0.95), transparent);
        pointer-events: none;
    }

    .cyber-dock-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none !important;
        color: #94a3b8;
        padding: 5px 2px;
        position: relative;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        -webkit-tap-highlight-color: transparent;
        border-radius: 12px;
    }

    .cyber-dock-item:active {
        transform: scale(0.92);
    }

    .cyber-dock-icon {
        font-size: 1.18rem;
        margin-bottom: 2px;
        transition: all 0.2s ease;
        position: relative;
    }

    .cyber-dock-label {
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.2px;
        line-height: 1;
        transition: all 0.2s ease;
    }

    /* Active State Glow */
    .cyber-dock-item.active {
        color: #ffffff;
    }
    .cyber-dock-item.active .cyber-dock-icon {
        color: #d946ef;
        transform: translateY(-2px);
        text-shadow: 0 0 14px rgba(217, 70, 239, 0.9);
    }
    .cyber-dock-item.active .cyber-dock-label {
        color: #e9d5ff;
        font-weight: 800;
    }
    .cyber-dock-item.active::after {
        content: '';
        position: absolute;
        bottom: 2px;
        width: 16px;
        height: 3px;
        border-radius: 3px;
        background: linear-gradient(90deg, #a855f7, #d946ef);
        box-shadow: 0 0 10px rgba(217, 70, 239, 0.95);
    }

    /* ⚡ Center Floating Cyber Orb (Key Generator) */
    .cyber-dock-center-orb {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none !important;
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }

    .cyber-orb-button {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: linear-gradient(135deg, #a855f7 0%, #7c3aed 50%, #d946ef 100%);
        border: 2px solid rgba(255, 255, 255, 0.4);
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.35rem;
        animation: cyberOrbPulse 3s infinite ease-in-out;
        transition: all 0.2s ease;
        position: relative;
        z-index: 2;
    }

    .cyber-orb-button:active {
        transform: translateY(-12px) scale(0.95);
    }

    .cyber-orb-label {
        font-size: 0.66rem;
        font-weight: 800;
        color: #f5d0fe;
        letter-spacing: 0.3px;
        margin-top: -6px;
        text-shadow: 0 0 8px rgba(217, 70, 239, 0.7);
    }
}

/* ─── 5. CYBER HUD MOBILE OFFCANVAS (DRAWER) ─── */
@media (max-width: 991.98px) {
    .offcanvas.offcanvas-end {
        width: 86% !important;
        max-width: 360px !important;
        background: #090714 !important;
        border-left: 1px solid rgba(168, 85, 247, 0.4) !important;
        box-shadow: -15px 0 45px rgba(0, 0, 0, 0.9), -2px 0 20px rgba(168, 85, 247, 0.2) !important;
    }

    .cyber-hud-profile-card {
        background: radial-gradient(circle at 0% 0%, rgba(168, 85, 247, 0.2) 0%, rgba(13, 11, 26, 0.96) 75%);
        border: 1px solid rgba(168, 85, 247, 0.35);
        border-radius: 18px;
        padding: 16px;
        margin-bottom: 16px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
        position: relative;
        overflow: hidden;
    }

    .cyber-hud-profile-card::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 100px;
        height: 100px;
        background: radial-gradient(circle, rgba(217, 70, 239, 0.16) 0%, transparent 70%);
        pointer-events: none;
    }

    .cyber-avatar-ring {
        width: 46px;
        height: 46px;
        border-radius: 50%;
        background: linear-gradient(135deg, #a855f7, #d946ef);
        padding: 2px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 0 14px rgba(168, 85, 247, 0.6);
    }
    .cyber-avatar-inner {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        background: #090714;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #c084fc;
        font-size: 1.2rem;
    }

    /* 4-Tile Quick HUD Action Grid */
    .cyber-hud-tile-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 18px;
    }

    .cyber-hud-tile {
        background: rgba(13, 11, 26, 0.9);
        border: 1px solid rgba(168, 85, 247, 0.3);
        border-radius: 14px;
        padding: 12px 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        text-decoration: none !important;
        transition: all 0.2s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
    .cyber-hud-tile:active {
        transform: scale(0.95);
        border-color: #d946ef;
        background: rgba(168, 85, 247, 0.18);
    }
    .cyber-hud-tile-icon {
        font-size: 1.35rem;
        transition: all 0.2s ease;
    }
    .cyber-hud-tile-label {
        font-size: 0.76rem;
        font-weight: 700;
        color: #e2e8f0;
        text-align: center;
    }
}

/* ─── 6. MOBILE PRODUCT CARDS OPTIMIZATION (< 576px) ─── */
@media (max-width: 575.98px) {
    /* Compact, proportional image banner on phones */
    .product-card-img-wrap,
    .theme-product-card .overflow-hidden.rounded-3 {
        height: 135px !important;
    }

    .theme-product-card {
        padding: 10px !important;
        border-radius: 16px !important;
        background: #0d0b1a !important;
        border: 1px solid rgba(168, 85, 247, 0.3) !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
        transition: transform 0.15s ease, border-color 0.15s ease !important;
    }
    .theme-product-card:active {
        transform: scale(0.97) !important;
        border-color: rgba(217, 70, 239, 0.7) !important;
    }

    /* Category pills horizontal smooth touch scroll */
    .cat-pill-container,
    .shop-cat-filter-wrapper {
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding-bottom: 6px !important;
        gap: 8px !important;
    }
    .cat-pill-container::-webkit-scrollbar,
    .shop-cat-filter-wrapper::-webkit-scrollbar {
        display: none !important;
    }
    .cat-pill-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 6px 14px !important;
        font-size: 0.78rem !important;
    }
}

/* ─── 7. MOBILE CYBER BOTTOM-SHEET MODAL (< 768px) ─── */
@media (max-width: 767.98px) {
    #productVariantModal .modal-dialog {
        margin: 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
    }

    #productVariantModal .modal-content {
        border-radius: 26px 26px 0 0 !important;
        border-bottom: none !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
        padding-bottom: 24px !important;
        box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.95), 0 -2px 25px rgba(168, 85, 247, 0.3) !important;
        background: #090714 !important;
    }

    /* Cyber Pull Handle Bar */
    .cyber-sheet-handle {
        width: 44px;
        height: 5px;
        border-radius: 5px;
        background: rgba(168, 85, 247, 0.45);
        margin: 10px auto 4px auto;
    }

    #productVariantModal .modal-header {
        padding: 10px 16px 12px 16px !important;
    }

    #productVariantModal .modal-body {
        padding: 14px 16px !important;
    }

    /* Modal Image compact on mobile */
    #productVariantModal #pv_image {
        height: 150px !important;
    }

    /* Variant buttons grid on mobile */
    .pv-variant-btn {
        flex: 1 1 100% !important;
        padding: 12px 14px !important;
    }
}

/* ─── 8. KEY GENERATOR MOBILE OPTIMIZATION (< 768px) ─── */
@media (max-width: 767.98px) {
    .keygen-wrapper {
        max-width: 100% !important;
        padding: 0 4px !important;
    }
    .keygen-card {
        padding: 22px 16px !important;
        border-radius: 20px !important;
    }
    .keygen-title {
        font-size: 1.35rem !important;
    }
    .keygen-cost-box {
        padding: 12px 14px !important;
        flex-direction: column !important;
        gap: 6px !important;
        text-align: center !important;
    }
    .keygen-btn-submit {
        padding: 14px 16px !important;
        font-size: 1rem !important;
        letter-spacing: 1px !important;
    }
}

/* ─── 9. PRODUCT DETAIL PAGE MOBILE OPTIMIZATION (< 768px) ─── */
@media (max-width: 767.98px) {
    .product-hero-card {
        padding: 16px 12px !important;
        border-radius: 20px !important;
    }
    .product-image-container img {
        height: 200px !important;
    }
    .variant-chip-select {
        flex: 1 1 calc(50% - 6px) !important;
        min-width: auto !important;
        padding: 8px 10px !important;
    }
    .btn-buy-license {
        width: 100% !important;
        padding: 14px !important;
        font-size: 1rem !important;
    }
}
