/* إصلاح مشاكل الخطوط */
@font-face {
    font-family: 'Cairo';
    src: url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');
    font-display: swap;
}

/* إعادة تعيين الخطوط لتجنب أخطاء التحميل */
* {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* إخفاء أخطاء الخطوط */
@font-face {
    font-family: 'fallback';
    src: url('data:font/woff2;base64,') format('woff2');
    font-display: swap;
}

/* تحسينات السلة */
.cart-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cart-header {
    text-align: center;
    margin-bottom: 30px;
}

.cart-header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.cart-header p {
    color: #666;
    font-size: 1.1rem;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.empty-cart i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-cart h2 {
    color: #333;
    margin-bottom: 15px;
}

.empty-cart p {
    color: #666;
    margin-bottom: 30px;
}

.cart-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

.cart-items {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
}

.cart-summary {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
}

.cart-summary h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    padding-top: 20px;
    border-top: 2px solid #ec4899;
}

.cart-actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-primary, .btn-secondary {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #ec4899;
    color: white;
}

.btn-primary:hover {
    background: #d63384;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* زر واتساب */
.btn-whatsapp {
    background: #25D366 !important;
    color: white !important;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-whatsapp:hover {
    background: #128C7E !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp:active {
    transform: translateY(0px);
}

.btn-whatsapp i {
    margin-left: 8px;
    font-size: 1.1rem;
}

/* تأثير انتقالي للزر */
.btn-whatsapp::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-whatsapp:hover::before {
    left: 100%;
}

/* تحسينات الاستجابة للأجهزة المحمولة */
@media (max-width: 768px) {
    .cart-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cart-summary {
        position: relative;
        top: 0;
    }
    
    .cart-header h1 {
        font-size: 2rem;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary, .btn-whatsapp {
        width: 100%;
        padding: 15px 20px;
        font-size: 1.1rem;
    }
    
    .btn-whatsapp i {
        font-size: 1.3rem;
    }
}

/* تحسينات إضافية */
.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.remove-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.item-quantity input:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.2);
}

/* تحسين التحميل */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ec4899;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* إصلاح مشاكل Font Awesome */
.fa, .fas, .far, .fal, .fab {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'Font Awesome 6 Brands' !important;
}

/* تحسين عرض الأيقونات */
.cart-header i,
.empty-cart i,
.cart-summary i,
.btn-primary i,
.btn-secondary i,
.remove-btn i {
    margin-left: 8px;
}

/* تحسين الألوان */
:root {
    --primary-color: #ec4899;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --light-text: #666;
    --border-color: #ddd;
    --danger-color: #dc3545;
    --success-color: #28a745;
}

/* تحسين التباين */
.cart-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* تحسين إمكانية الوصول */
.quantity-btn:focus,
.remove-btn:focus,
.btn-primary:focus,
.btn-secondary:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* إصلاح مشاكل الخطوط النهائي */
@media print {
    * {
        font-family: 'Arial', sans-serif !important;
    }
}

/* تحسين الأداء */
.cart-item,
.cart-summary {
    will-change: transform;
}

/* إصلاح مشاكل الخطوط المتقدمة */
@supports (font-display: swap) {
    @font-face {
        font-family: 'Cairo';
        src: url('https://fonts.gstatic.com/s/cairo/v28/SLXgc1nY6HkvalYM.woff2') format('woff2');
        font-display: swap;
        font-weight: 400;
    }
    
    @font-face {
        font-family: 'Cairo';
        src: url('https://fonts.gstatic.com/s/cairo/v28/SLXgc1nY6HkvalYM.woff2') format('woff2');
        font-display: swap;
        font-weight: 600;
    }
}

/* نافذة الحجز للسلة */
.reservation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 15px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px auto;
    z-index: 10001;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff4757;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 10002;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #ff3742;
    transform: scale(1.1);
}

.modal-header {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: white;
    padding: 30px;
    border-radius: 15px 15px 0 0;
    text-align: center;
}

.modal-header h2 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.modal-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.reservation-form {
    padding: 30px;
}

.cart-summary-modal {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.cart-summary-modal h3 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.modal-cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.modal-cart-item-info {
    flex: 1;
}

.modal-cart-item-info h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1rem;
}

.modal-cart-item-info .item-details {
    color: #666;
    font-size: 0.9rem;
}

.modal-cart-item-price {
    text-align: right;
    font-weight: bold;
    color: #ec4899;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.delivery-info-display {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.delivery-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #0066cc;
    font-weight: 500;
}

.delivery-detail:last-child {
    margin-bottom: 0;
}

.delivery-detail i {
    color: #0066cc;
}

.order-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
    border: 2px solid #dee2e6;
}

.order-summary h3 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
    font-size: 1rem;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    padding-top: 15px;
    border-top: 2px solid #ec4899;
    margin-top: 10px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.btn-cancel,
.btn-reserve {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    justify-content: center;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-reserve {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-reserve:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-reserve:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* تحسينات للأجهزة المحمولة للنافذة المنبثقة */
@media (max-width: 768px) {
    .reservation-modal {
        padding: 10px;
        align-items: flex-start;
    }
    
    .modal-content {
        margin: 10px auto;
        max-height: 95vh;
        border-radius: 10px;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .reservation-form {
        padding: 20px;
    }
    
    .modal-cart-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: right;
    }
    
    .modal-cart-item img {
        width: 50px;
        height: 50px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-cancel,
    .btn-reserve {
        width: 100%;
        min-width: auto;
    }
} 