#pwa-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 19999;
    display: none;
    animation: fadeIn 0.4s ease;
}

#pwa-install-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 88%;
    max-width: 380px;
    background: #fff;
    border-radius: 30px;
    padding: 35px 20px;
    box-shadow: 0 35px 70px rgba(0,0,0,0.45);
    z-index: 20000;
    display: none; /* Flex via JS */
    flex-direction: column;
    text-align: center;
    animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    0% { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.urdu-text {
    font-family: 'Noto Nastaliq Urdu', serif;
    direction: rtl;
    line-height: 2.2 !important;
}

.pwa-hero-section {
    margin-bottom: 20px;
}

.pwa-modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 15px;
    box-shadow: 0 8px 20px rgba(49, 125, 12, 0.2);
}

.pwa-hero-section h2 {
    font-size: 20px;
    color: #317d0c;
    margin: 0;
    font-weight: bold;
}

.pwa-benefits-section {
    background: #f4f9f1;
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 25px;
    text-align: right;
}

.pwa-benefits-section h3 {
    font-size: 15px;
    color: #444;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(49, 125, 12, 0.1);
    padding-bottom: 5px;
}

.pwa-benefits-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.pwa-benefits-list li {
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.pwa-benefits-list li i {
    color: #317d0c;
    font-size: 16px;
}

.pwa-modal-footer {
    padding-top: 5px;
}

.pwa-btn-install-premium {
    width: 100%;
    background: #317d0c;
    color: #fff;
    border: none;
    border-radius: 15px;
    padding: 10px 15px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(49, 125, 12, 0.3);
}

.pwa-btn-install-premium:hover {
    background: #266109;
    transform: scale(1.02);
}

#pwa-ios-instructions {
    display: none;
    margin-top: 15px;
    padding: 10px;
    background: #fff9e6;
    border-radius: 10px;
    font-size: 13px;
    color: #856404;
}

/* Mobile Navigation Swap Stabilization */
.visible-xs .canvas_open {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    z-index: 10 !important;
}

.visible-xs .canvas_open a {
    border: none !important;
    width: auto !important;
    height: auto !important;
    line-height: inherit !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-decoration: none !important;
}

.visible-xs .mini_cart_wrapper {
    margin-left: 0 !important;
}

.visible-xs #cartbtn {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    float: none !important;
    margin-top: 0 !important;
}

.menu-label {
    font-family: 'Work Sans', sans-serif !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
}

.pwa-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.pwa-text p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #666;
}

.pwa-actions {
    display: flex;
    gap: 10px;
    margin-left: 10px;
}

.pwa-btn {
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.pwa-btn-install {
    background: #317d0c;
    color: #fff;
}

.pwa-btn-install:hover {
    background: #266109;
    transform: translateY(-2px);
}

.pwa-btn-close {
    background: #f0f0f0;
    color: #999;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: absolute;
    top: -10px;
    right: -10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* iOS Specific Styles */
#pwa-ios-instructions {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.ios-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #444;
}

.ios-icon {
    font-size: 20px;
}

@media (max-width: 480px) {
    #pwa-install-banner {
        top: auto !important;
        bottom: 20px !important;
        left: 15px !important;
        right: 15px !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
        padding: 25px 15px !important;
        flex-direction: column;
        text-align: center;
        border-radius: 20px;
    }
    
    .pwa-modal-body {
        flex-direction: column;
        padding: 0;
    }
    
    .pwa-actions {
        width: 100%;
        margin: 0;
        margin-top: 15px;
    }
    
    .pwa-btn-install {
        width: 100%;
    }

    .pwa-btn-close {
        top: 10px !important;
        right: 10px !important;
        background: rgba(0,0,0,0.05) !important;
    }
}

/* Header App Hub Styles */
.kc-app-hub {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid #317d0c;
    padding: 6px 12px; /* Compressed padding */
    border-radius: 10px;
    margin-left: 10px;
    box-shadow: 0 4px 15px rgba(49, 125, 12, 0.1);
    transition: all 0.3s ease;
    flex-shrink: 0; /* Never overlap/squeeze */
    min-width: fit-content;
}

.kc-app-hub:hover {
    border-color: #47ad12;
    box-shadow: 0 6px 20px rgba(49, 125, 12, 0.2);
    transform: translateY(-1px);
}

.app-hub-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 12px; /* Smaller font as requested */
    font-weight: 700;
    line-height: 1.6;
    transition: transform 0.2s;
}

.app-hub-link:hover {
    transform: scale(1.05);
    color: #317d0c;
}

.app-hub-icon {
    height: 24px; /* Slightly smaller icons */
    width: auto;
    object-fit: contain;
}

.kc-app-hub.row-integrated-v2 {
    display: none; /* Strictly hidden on desktop */
}

@media (max-width: 767px) {
    .categories_flex_row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        gap: 4px;
        padding: 0 2px;
    }
    
    .categories_title {
        flex: 0 0 auto !important; /* Protect green button from cropping */
        width: auto !important;
    }

    .categories_title h2 {
        font-size: 13px !important;
        padding: 0 10px !important;
        height: 32px !important;
        line-height: 32px !important;
        white-space: nowrap !important;
    }

    .kc-app-hub.row-integrated-v2 {
        display: flex !important;
        align-items: center;
        gap: 5px;
        margin-left: auto !important; /* Stick to the right margin */
    }

    .kc-app-hub.row-integrated-v2 .app-hub-link {
        font-size: 10px;
        gap: 4px;
        padding: 2px 6px;
        background: #fff;
        border: 1px solid #317d0c;
        border-radius: 6px;
        height: 30px;
        white-space: nowrap;
        display: flex;
        align-items: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        color: #317d0c;
        font-weight: bold;
    }

    .kc-app-hub.row-integrated-v2 .app-hub-icon {
        height: 14px;
    }

    .kc-app-hub.row-integrated-v2 .app-hub-divider {
        display: none;
    }

    .kc-app-hub.mobile-view {
        display: none !important; /* Purge the vertical block if it somehow appears */
    }
}

    .canvas_open {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #317d0c;
        font-weight: 700;
        text-decoration: none;
    }

    .canvas_open i {
        font-size: 24px;
    }

    .menu-label {
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #333;
    }
}
