/* ============ مؤسسة جوهرة الندى لنقل وتحلية المياه - متجاوب مع الجوال ============ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

:root {
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --light: #f8f9fa;
    --dark: #212529;
    --sidebar-width: 250px;
    --header-height: 60px;
    --font: 'Cairo', Tahoma, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: #f0f2f5;
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============ الهيدر العلوي ============ */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 1000;
}

.topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar .brand img {
    max-height: 40px;
    width: auto;
}

.store-name {
    color: var(--primary);
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* زر القائمة (يظهر فقط في الجوال) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--primary);
    cursor: pointer;
    padding: 0 10px;
}

/* روابط الهيدر في الحاسوب */
.topbar .nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.topbar .nav-links a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: 0.2s;
    white-space: nowrap;
}

.topbar .nav-links a:hover {
    color: var(--primary);
}

/* ============ القائمة الجانبية (للإدارة) ============ */
.sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
    padding: 15px 0;
    overflow-y: auto;
    z-index: 999;
    transition: 0.3s ease;
}

.sidebar .nav-title {
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
    border-right: 3px solid transparent;
}

.sidebar a i {
    width: 20px;
    text-align: center;
}

.sidebar a:hover {
    background: #f0f5ff;
    color: var(--primary);
    border-right-color: var(--primary);
}

.sidebar a.active {
    background: #e8f0fe;
    color: var(--primary);
    border-right-color: var(--primary);
}

/* ============ المحتوى الرئيسي ============ */
.main-content {
    margin-top: var(--header-height);
    padding: 15px;
    min-height: calc(100vh - var(--header-height));
}

.with-sidebar {
    margin-right: var(--sidebar-width);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ============ البطاقات ============ */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* ============ الجداول ============ */
.table-container {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
}
table th, table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
table th {
    background: #f8f9fa;
    font-weight: 700;
}

/* ============ الأزرار ============ */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: #000; }
.btn-info { background: var(--info); color: #000; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ============ النماذج ============ */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; }
.form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 14px;
}
.form-control:focus { border-color: var(--primary); outline: none; }

/* ============ المنتج الرئيسي ============ */
.product-card {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
}
.product-image { flex: 1; text-align: center; }
.product-image img { max-width: 100%; border-radius: 16px; }
.product-details { flex: 1.5; }
.product-details h1 { font-size: 2rem; margin-bottom: 15px; }
.price {
    font-size: 28px;
    color: var(--success);
    font-weight: 700;
    margin: 15px 0;
    background: #e9f7ef;
    display: inline-block;
    padding: 6px 20px;
    border-radius: 40px;
}

/* ============ قسم الخدمات ============ */
.services-section {
    margin-top: 40px;
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}
.service-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s;
    text-align: center;
    border: 1px solid #e0e0e0;
}
.service-card:hover {
    transform: translateY(-5px);
}
.service-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}
.service-card h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 15px 0 10px;
}
.service-card p {
    padding: 0 15px 20px;
    color: #555;
    line-height: 1.6;
}
.section-title {
    text-align: center;
    margin-bottom: 20px;
}
.section-title img {
    max-width: 300px;
    width: 100%;
}

/* ============ الإحصائيات ============ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}
.bg-blue { background: var(--primary); }
.bg-green { background: var(--success); }

/* تنسيق تفاصيل الحساب البنكي */
.bank-details {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
    border-radius: 20px;
    border-right: 5px solid #0d6efd;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.bank-details-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 2px dashed #0d6efd;
    padding-bottom: 10px;
}
.bank-details-header i {
    font-size: 32px;
    color: #0d6efd;
}
.bank-details-header h3 {
    margin: 0;
    color: #0d6efd;
    font-weight: bold;
}
.bank-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
}
.bank-info-card {
    background: white;
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.bank-info-card.iban-card {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
}
.bank-info-card .label {
    color: #6c757d;
    font-size: 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.bank-info-card.iban-card .label {
    color: rgba(255,255,255,0.8);
}
.bank-info-card .value {
    font-weight: bold;
    font-size: 16px;
    color: #212529;
}
.bank-info-card.iban-card .value {
    color: white;
    direction: ltr;
    text-align: left;
    font-family: monospace;
    letter-spacing: 1px;
}
.copy-btn {
    margin-top: 10px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 25px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
}
.copy-btn:hover {
    background: rgba(255,255,255,0.3);
}
.bank-note {
    margin-top: 20px;
    padding: 12px;
    background: #e9ecef;
    border-radius: 12px;
    font-size: 13px;
    color: #495057;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
@media (max-width: 768px) {
    .bank-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ============ تذييل ============ */
.footer {
    text-align: center;
    padding: 20px;
    background: white;
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
    color: var(--secondary);
}

/* ============ عرض المنتجات بشكل عمودي (صف واحد لكل منتج) ============ */
.products-list .product-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    padding: 20px;
    margin-bottom: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.product-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
}
.product-item .product-info {
    flex: 1;
}
.product-item h3 {
    margin: 0 0 10px 0;
}
.product-item .price {
    font-size: 1.3rem;
    color: var(--success);
    font-weight: bold;
}

/* ============ الطباعة ============ */
@media print {
    .topbar, .sidebar, .btn, .no-print { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; }
}

/* ============ استجابة للجوال ============ */
@media (max-width: 768px) {
    .menu-toggle {
        display: block !important;
    }
    .topbar .nav-links {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    .topbar .nav-links.show {
        display: flex;
    }
    .topbar .nav-links a {
        padding: 12px 20px;
        border-bottom: 1px solid #eee;
        white-space: normal;
    }
    .store-name {
        font-size: 0.8rem;
        white-space: normal;
        max-width: 140px;
        line-height: 1.3;
    }
    .topbar .brand img {
        max-height: 35px;
    }
    .with-sidebar {
        margin-right: 0;
    }
    .sidebar {
        right: -250px;
    }
    .sidebar.open {
        right: 0;
    }
    .product-card {
        flex-direction: column;
    }
    .product-details h1 {
        font-size: 1.5rem;
    }
    .price {
        font-size: 1.8rem;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    .service-card img {
        height: 180px;
    }
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    /* تنسيق المنتج العمودي للجوال */
    .products-list .product-item {
        flex-direction: column;
        text-align: center;
    }
    .products-list .product-item img {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .store-name {
        font-size: 0.7rem;
        max-width: 110px;
    }
    .topbar .brand img {
        max-height: 30px;
    }
    .page-title {
        font-size: 18px;
    }
    .card {
        padding: 12px;
    }
}