/* ============================================
   STYLE: SERVICES - SINGLE - POPUP
   Tourist Identity - المصلح للسكرول
   ============================================ */

/* 1. Backdrop (الخلفية المظلمة) */
.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 16, 54, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.popup-overlay.active {
    display: flex;
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 2. Popup Container (الحاوية الرئيسية) */
.popup-container {
    position: relative;
    background: #fff;
    border-radius: 32px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh; /* تحديد أقصى ارتفاع */
    animation: popupSlideIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    overflow: hidden !important; /* منع السكرول في الحاوية نفسها */
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 3. Popup Body (الجزء القابل للتمرير - هنا السر) */
.popup-container .popup-body {
    padding: 40px; /* نقلنا البادينج هنا لضمان عمل بكرة الماوس في كل المساحة */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1;
    outline: none;
    -webkit-overflow-scrolling: touch; /* سكرول ناعم للموبايل */
}

/* 4. Close Button */
.popup-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #f7f9fc;
    color: #667085;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: grid;
    place-items: center;
    z-index: 100; /* التأكد أنه فوق كل شيء */
}

.popup-close:hover {
    background: #fff0f1;
    color: #d8232a;
    transform: rotate(90deg);
}

/* 5. Header & Content */
.popup-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f2f5;
}

.popup-header .popup-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #d8232a;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 28px;
    flex-shrink: 0;
}

.popup-header .popup-title {
    font-size: 24px;
    font-weight: 700;
    color: #172033;
    margin: 0;
}

.popup-header .popup-subtitle {
    font-size: 14px;
    color: #667085;
    margin: 2px 0 0;
}

/* 6. Service Summary */
.popup-service-summary {
    background: #f7f9fc;
    border: 1px solid #e7edf5;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.popup-service-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}

.popup-service-summary .summary-row .summary-label {
    color: #667085;
    font-weight: 700;
}

.popup-service-summary .summary-row .summary-value {
    color: #172033;
    font-weight: 700;
    text-align: left;
}

/* 7. Form Styles */
.popup-form .form-group {
    margin-bottom: 16px;
}

.popup-form .form-group label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: #344054;
    margin-bottom: 6px;
}

.popup-form .form-group input,
.popup-form .form-group select,
.popup-form .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e7edf5;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.popup-form .form-group input:focus,
.popup-form .form-group textarea:focus {
    outline: none;
    border-color: #d8232a;
    box-shadow: 0 0 0 4px rgba(216, 35, 42, 0.08);
}

.popup-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.popup-form .btn-submit {
    width: 100%;
    padding: 16px;
    font-size: 17px;
    background: #d8232a;
    color: #fff;
    border: 0;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(216, 35, 42, 0.2);
}

.popup-form .btn-submit:hover {
    background: #b01e24;
    transform: translateY(-2px);
}

/* 8. Success Message */
.popup-success {
    display: none;
    text-align: center;
    padding: 20px 0;
}

.popup-success .success-icon {
    width: 60px;
    height: 60px;
    background: #ecfdf5;
    color: #047857;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    font-size: 30px;
}

/* 9. Scrollbar Styling (لأجهزة الكمبيوتر) */
.popup-container .popup-body::-webkit-scrollbar {
    width: 6px;
}
.popup-container .popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.popup-container .popup-body::-webkit-scrollbar-thumb {
    background: #d8232a;
    border-radius: 10px;
}

/* 10. Responsive */
@media (max-width: 767px) {
    .popup-container {
        max-height: 95vh;
        border-radius: 24px;
    }
    .popup-container .popup-body {
        padding: 25px 20px;
    }
    .popup-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .popup-header .popup-title {
        font-size: 20px;
    }
}

/* RTL Support */
[dir="rtl"] .popup-close {
    left: auto;
    right: 16px;
}
[dir="rtl"] .popup-service-summary .summary-row .summary-value {
    text-align: right;
}