/* النافذة المنبثقة العربية */
.ar-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    padding: 20px;
    direction: rtl;
    animation: arOverlayFadeIn 0.3s ease-out;
}

@keyframes arOverlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ar-modal-content {
    background: linear-gradient(135deg, #1a6fc4 0%, #0d4d8c 100%);
    color: white;
    width: 100%;
    max-width: 520px;
    border-radius: 20px;
    padding: 35px 30px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
    animation: arModalAppear 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.ar-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #ff9800, #ff5722);
}

@keyframes arModalAppear {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* زر الإغلاق */
.ar-close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.ar-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* محتوى النافذة */
.ar-modal-header {
    margin-bottom: 30px;
    position: relative;
}

.ar-modal-header h2 {
    font-size: 1.9rem;
    margin-bottom: 15px;
    font-weight: 800;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ar-discount-badge {
    display: inline-block;
    background: linear-gradient(45deg, #ff9800, #ff5722);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.4rem;
    margin: 15px 0;
    box-shadow: 0 6px 15px rgba(255, 152, 0, 0.4);
    animation: arPulse 2s infinite;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

@keyframes arPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ar-modal-body {
    margin-bottom: 35px;
    font-size: 1.15rem;
    line-height: 1.9;
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 12px;
    border-right: 5px solid #ff9800;
}

.ar-certificates h3 {
    margin-bottom: 12px;
    color: #ffcc80;
    font-size: 1.3rem;
    font-weight: 700;
}

/* أزرار الاتصال */
.ar-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.ar-btn {
    padding: 16px 32px;
    border: none;
    border-radius: 50px;
    font-size: 1.15rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 200px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.ar-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.ar-btn:hover::after {
    width: 300px;
    height: 300px;
}

.ar-btn-whatsapp {
    background-color: #25D366;
    color: white;
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.3);
}

.ar-btn-whatsapp:hover {
    background-color: #1da851;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
}

.ar-btn-call {
    background-color: white;
    color: #0d4d8c;
    box-shadow: 0 6px 15px rgba(255, 255, 255, 0.2);
}

.ar-btn-call:hover {
    background-color: #f8f9fa;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
}

.ar-btn i {
    font-size: 1.4rem;
}

/* منع التمرير عند ظهور النافذة */
body.ar-popup-open {
    overflow: hidden;
    padding-right: 15px; /* منع القفزة عند إخفاء شريط التمرير */
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    .ar-modal-content {
        padding: 25px 20px;
        max-width: 90%;
    }
    
    .ar-modal-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .ar-btn {
        width: 100%;
        max-width: 100%;
        padding: 14px 20px;
    }
    
    .ar-modal-header h2 {
        font-size: 1.6rem;
    }
    
    .ar-discount-badge {
        font-size: 1.2rem;
        padding: 8px 20px;
    }
}

@media (max-width: 480px) {
    .ar-modal-content {
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .ar-modal-header h2 {
        font-size: 1.4rem;
    }
    
    .ar-discount-badge {
        font-size: 1.1rem;
        padding: 7px 18px;
    }
    
    .ar-modal-body {
        padding: 15px;
        font-size: 1rem;
    }
    
    .ar-btn {
        font-size: 1rem;
        padding: 12px 18px;
    }
}

/* دعم متصفحات أقدم */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .ar-modal-overlay {
        background-color: rgba(0, 0, 0, 0.9);
    }
    
    .ar-btn::after {
        display: none;
    }
}