/* --- 1. الأساسيات العامة --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0; padding: 0;
    background-color: #f4f7f6;
    text-align: center;
    direction: ltr; /* لضمان توافق الواجهة البرمجية */
}

/* --- 2. شريط الأدوات العلوي --- */
.top-bar {
    display: flex; 
    justify-content: center;
    gap: 15px; 
    padding: 15px;
    background: #ffffff; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.top-bar select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ddd;
    outline: none;
}

/* --- 3. نظام شبكة المنتجات (4-5 في الصف) --- */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 20px !important; 
    padding: 25px !important;
    max-width: 1300px; 
    margin: 0 auto !important;
}

/* --- 4. بطاقة المنتج --- */
.product-card {
    background: white !important;
    border-radius: 15px !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important; 
    text-align: center !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    width: 100% !important; 
    height: 180px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    margin-bottom: 15px !important;
    border-radius: 10px;
    cursor: zoom-in;
}

.product-info h3 {
    font-size: 16px;
    color: #333;
    margin: 10px 0;
    height: 40px;
    overflow: hidden;
}

.price-tag {
    font-size: 1.2rem; 
    font-weight: 800;
    color: #2980b9; 
    margin: 10px 0 !important;
    width: 100% !important; 
    text-align: center !important;
}

.buy-btn {
    width: 90% !important; 
    padding: 12px !important;
    background-color: #27ae60 !important;
    color: white !important; 
    border: none !important;
    border-radius: 8px !important; 
    cursor: pointer;
    font-weight: bold !important;
    transition: 0.3s;
}

.buy-btn:hover {
    background-color: #219150;
}

/* --- 5. نظام الحسابات (Auth) --- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.auth-card {
    background: white; 
    padding: 35px; 
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    width: 90%; 
    max-width: 400px;
}

.auth-tabs {
    display: flex; 
    justify-content: space-around; 
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.auth-tabs button {
    background: none; 
    border: none; 
    padding: 10px 20px;
    font-size: 16px; 
    font-weight: 600;
    cursor: pointer; 
    color: #95a5a6;
    transition: 0.3s;
}

.auth-tabs button.active {
    color: #2980b9;
    border-bottom: 3px solid #2980b9;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group input {
    width: 100%; 
    padding: 14px; 
    border: 1px solid #ddd;
    border-radius: 10px; 
    font-size: 16px;
    box-sizing: border-box; /* لضمان عدم خروج الحواف عن الإطار */
    background-color: #f9f9f9;
}

.input-group input:focus {
    border-color: #2980b9;
    background-color: #fff;
    outline: none;
}

/* --- 6. الصورة المكبرة (Overlay) --- */
.image-overlay {
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.92); 
    display: none;
    justify-content: center; 
    align-items: center;
    z-index: 10000; 
    cursor: zoom-out;
}

#fullImage { 
    max-width: 90%; 
    max-height: 85%; 
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(255,255,255,0.1);
}
#paymentInstructions {
    border: 2px dashed #007bff;
    background: #f0f8ff;
    color: #333;
    padding: 15px;
    margin: 10px 0;
    font-size: 1.1rem;
}
/* Modal Styling */
.modal {
    display: none; position: fixed; z-index: 9999;
    left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8);
    justify-content: center; align-items: center;
}
.modal-content {
    background: white; padding: 30px; border-radius: 15px; width: 90%; max-width: 450px; position: relative; text-align: center;
}
.close-btn { position: absolute; right: 20px; top: 10px; font-size: 28px; cursor: pointer; }

/* Payment Buttons */
.payment-options { display: flex; gap: 15px; justify-content: center; }
.pay-btn {
    padding: 15px 30px; border-radius: 10px; font-weight: bold; cursor: pointer; border: 2px solid #eee; flex: 1; font-size: 1.1rem;
}
.wave-style { background-color: #00a0ff; color: white; border: none; } /* Blue for Wave */
.bankily-style { background-color: #ffffff; color: #1d1d1d; border: 2px solid #1d1d1d; } /* White for Bankily */

.whatsapp-confirm-btn {
    background-color: #25d366; color: white; border: none; padding: 15px; width: 100%; border-radius: 8px; font-weight: bold; cursor: pointer; margin-top: 15px;
}