/* ===== تحسينات واجهات الطلب للجوال ===== */

/* ===== المتغيرات الأساسية ===== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.15);
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 12px;
}

/* ===== الخلفية المحسنة ===== */
.order-page-bg {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

/* ===== البطاقات المحسنة ===== */
.order-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    border: none;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.order-card:hover {
    box-shadow: var(--card-shadow-hover);
    transition: box-shadow 0.3s ease;
}

/* ===== رأس الصفحة المحسن ===== */
.order-header {
    text-align: center;
    padding: 2rem 1rem;
}

.order-header-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.35);
}

.order-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.order-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

/* ===== بطاقات الاختيار المحسنة ===== */
.selection-card {
    cursor: pointer;
    display: block;
}

.selection-card input[type="radio"] {
    display: none;
}

.selection-card .card-inner {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius-md);
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.selection-card .card-inner:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.15);
}

.selection-card input[type="radio"]:checked + .card-inner {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.25);
}

.selection-card .check-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.selection-card input[type="radio"]:checked + .card-inner .check-badge {
    opacity: 1;
    transform: scale(1);
}

/* ===== أيقونات البطاقات ===== */
.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    transition: transform 0.3s ease;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-icon i {
    font-size: 1.5rem;
}

.card-icon.primary { background: rgba(102, 126, 234, 0.1); color: #667eea; }
.card-icon.success { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.card-icon.warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.card-icon.info { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }

/* ===== عناوين البطاقات ===== */
.card-title-sm {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle-sm {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ===== صندوق المعلومات ===== */
.info-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: var(--border-radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.info-box.success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #a7f3d0;
}

.info-box.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
}

/* ===== الأزرار المحسنة ===== */
.btn-order-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-order-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.45);
    color: white;
}

.btn-order-primary:active {
    transform: translateY(-1px);
}

.btn-order-secondary {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-order-secondary:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

/* ===== شريط التقدم ===== */
.order-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    z-index: 0;
}

.progress-step:last-child::after {
    display: none;
}

.progress-step.active::after,
.progress-step.completed::after {
    background: var(--primary-gradient);
}

.progress-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.85rem;
    z-index: 1;
    transition: background 0.3s ease, color 0.3s ease;
}

.progress-step.active .progress-dot {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.progress-step.completed .progress-dot {
    background: var(--success-gradient);
    color: white;
}

.progress-label {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.5rem;
    text-align: center;
}

.progress-step.active .progress-label,
.progress-step.completed .progress-label {
    color: #1e293b;
    font-weight: 600;
}

/* ===== المدخلات المحسنة ===== */
.input-modern {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-modern:focus {
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

.input-modern::placeholder {
    color: #94a3b8;
}

/* ===== مجموعة المدخلات ===== */
.input-group-modern {
    position: relative;
}

.input-group-modern .input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.input-group-modern input {
    padding-right: 3rem;
}

/* ===== التحسينات للجوال ===== */
@media (max-width: 576px) {
    .order-header {
        padding: 1.5rem 1rem;
    }
    
    .order-header-icon {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
        border-radius: 16px;
    }
    
    .order-title {
        font-size: 1.25rem;
    }
    
    .order-subtitle {
        font-size: 0.85rem;
    }
    
    .selection-card .card-inner {
        padding: 0.75rem;
    }
    
    .card-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 0.5rem;
    }
    
    .card-icon i {
        font-size: 1.25rem;
    }
    
    .card-title-sm {
        font-size: 0.8rem;
    }
    
    .card-subtitle-sm {
        font-size: 0.7rem;
    }
    
    .check-badge {
        width: 24px;
        height: 24px;
        top: 6px;
        right: 6px;
        font-size: 0.7rem;
    }
    
    .btn-order-primary,
    .btn-order-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .info-box {
        padding: 0.875rem 1rem;
    }
    
    /* تحسين التباعد */
    .order-card .card-body {
        padding: 1rem !important;
    }
    
    /* شريط التقدم */
    .progress-dot {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
    
    .progress-label {
        font-size: 0.65rem;
    }
}

/* ===== شاشات صغيرة جداً ===== */
@media (max-width: 360px) {
    .order-header-icon {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }
    
    .order-title {
        font-size: 1.1rem;
    }
    
    .card-icon {
        width: 42px;
        height: 42px;
    }
    
    .card-title-sm {
        font-size: 0.75rem;
    }
}

/* ===== تأثيرات اللمس ===== */
@media (hover: none) {
    .selection-card .card-inner:active {
        transform: scale(0.98);
    }
    
    .btn-order-primary:active,
    .btn-order-secondary:active {
        transform: scale(0.97);
    }
}

/* ===== تحسين الرسوم المتحركة ===== */
.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* ===== التحميل ===== */
.loading-overlay-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay-modern.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner-modern {
    text-align: center;
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== تحسينات إضافية للملخص ===== */
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: #64748b;
    font-size: 0.9rem;
}

.summary-value {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.summary-total {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.summary-total .summary-label {
    font-size: 1rem;
    color: #047857;
}

.summary-total .summary-value {
    font-size: 1.25rem;
    color: #047857;
}

/* ===== رسائل التنبيه ===== */
.alert-modern {
    border: none;
    border-radius: var(--border-radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-modern.success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #047857;
}

.alert-modern.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
}

.alert-modern.info {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: #0369a1;
}

.alert-modern i {
    font-size: 1.25rem;
    margin-top: 2px;
}
