/* ═══════════════════════════════════════════════════════════
   Vivora PWA — vivora-pwa.css
   شريط التحكم السفلي + زرار التحميل
   ═══════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────
   شريط التحكم السفلي — موبايل فقط
──────────────────────────────────────── */
#vivora-bottom-nav {
    display: none; /* مخفي على الديسكتوب */
}

@media (max-width: 768px) {

    /* مساحة إضافية في الأسفل عشان المحتوى ميتغطاش */
    body {
        padding-bottom: 68px;
    }

    #vivora-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        z-index: 9998;
        background: #fff;
        border-top: 1px solid #EDE3D8;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        height: 64px;
        align-items: stretch;
        direction: rtl;

        /* Safe area للهواتف ذات الشق */
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .vbn-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        text-decoration: none;
        color: #9B8B7A;
        font-size: 0.62rem;
        font-weight: 600;
        font-family: 'Tajawal', sans-serif;
        transition: color 0.2s ease, background 0.2s ease;
        border: none;
        background: none;
        cursor: pointer;
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }

    .vbn-item:active {
        background: #FAF5F0;
    }

    .vbn-item.active {
        color: #1A1A1A;
    }

    /* خط علوي للعنصر النشط */
    .vbn-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        right: 20%;
        left: 20%;
        height: 2px;
        background: #C8A882;
        border-radius: 0 0 3px 3px;
    }

    .vbn-icon {
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .vbn-icon svg {
        width: 22px;
        height: 22px;
        stroke: currentColor;
        fill: none;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* عداد السلة */
    .vbn-badge {
        position: absolute;
        top: -4px;
        left: -4px;
        background: #1A1A1A;
        color: #fff;
        font-size: 0.55rem;
        font-weight: 700;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .vbn-label {
        font-size: 0.62rem;
        line-height: 1;
    }

}

/* ────────────────────────────────────────
   زرار "أضف للشاشة الرئيسية"
──────────────────────────────────────── */
#vivora-pwa-install {
    display: none; /* يظهر فقط لما يكون متاح */
    position: fixed;
    bottom: 80px; /* فوق الشريط السفلي */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

#vivora-pwa-install.vsp-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.vpwa-card {
    background: #1A1A1A;
    color: #fff;
    border-radius: 14px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    min-width: 280px;
    direction: rtl;
}

.vpwa-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #C8A882;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.vpwa-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vpwa-body {
    flex: 1;
}

.vpwa-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
    font-family: 'Tajawal', sans-serif;
}

.vpwa-desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.65);
    font-family: 'Tajawal', sans-serif;
}

.vpwa-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vpwa-btn-install {
    background: #C8A882;
    color: #1A1A1A;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    transition: background 0.2s;
    white-space: nowrap;
}

.vpwa-btn-install:hover {
    background: #D4B48E;
}

.vpwa-btn-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
    cursor: pointer;
    text-align: center;
    font-family: 'Tajawal', sans-serif;
    padding: 2px;
    transition: color 0.2s;
}

.vpwa-btn-close:hover {
    color: rgba(255,255,255,0.9);
}

@media (max-width: 768px) {
    #vivora-pwa-install {
        display: block;
    }
}
