@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

/* إعدادات عامة */
* {
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    padding-top: 80px;
    background: radial-gradient(circle at top left,#6366f1 0%,#4f46e5 25%,#7c3aed 60%,#0ea5e9 100%);
    color: #e5e7eb;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg,#4f46e5,#0ea5e9) !important;
    box-shadow: 0 10px 30px rgba(15,23,42,0.35);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff !important;
}

.navbar-nav .nav-link {
    color: #e5e7eb !important;
    font-weight: 500;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover {
    color: #ffffff !important;
    background: rgba(15,23,42,0.18);
    border-radius: 999px;
}

/* زر السلة و الأزرار داخل النافبار */
.navbar .btn.btn-light,
.navbar .btn.btn-outline-light {
    border-radius: 999px;
    font-weight: 600;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: none;
}

.navbar .btn.btn-light:hover,
.navbar .btn.btn-outline-light:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* أزرار عامة */
.btn-primary,
.btn-success {
    border-radius: 999px;
    font-weight: 600;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg,#6366f1,#22c55e);
    box-shadow: 0 14px 30px rgba(79,70,229,0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg,#4f46e5,#16a34a);
}

.btn-success {
    background: linear-gradient(135deg,#16a34a,#22c55e) !important;
    box-shadow: 0 12px 25px rgba(34,197,94,0.35);
}

/* Hero section (الواجهة الأمامية) */
.hero-section {
    background: linear-gradient(135deg,#4f46e5,#0ea5e9);
    color: #fff;
    padding: 60px 0 40px;
    margin-top: -20px;
    margin-bottom: -10px;
    border-radius: 0 0 32px 32px;
    box-shadow: 0 20px 40px rgba(15,23,42,0.35);
}

.hero-title {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-weight: 700;
}

.hero-section p {
    opacity: 0.95;
}

/* تبويبات التصنيفات في الصفحة الرئيسية */
.nav-pills .nav-link {
    border-radius: 999px;
    color: #e0e7ff;
    background: transparent;
    border: 1px solid rgba(191,219,254,0.4);
    font-weight: 500;
}

.nav-pills .nav-link:hover {
    background: rgba(15,23,42,0.15);
}

.nav-pills .nav-link.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* كروت المنتجات */
.product-card {
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15,23,42,0.15);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(15,23,42,0.25);
}

.product-img {
    width: 100% !important;
    height: 220px !important;
    object-fit: contain !important;
    background: #f5f5f5;
    padding: 10px;
}

.card-title {
    font-size: 0.98rem;
    margin-bottom: 0.25rem;
}

.product-card .fs-5 {
    font-size: 0.9rem !important;
}

/* إخفاء عناصر غير مرغوبة تحت الصور */
.product-card .badge:empty,
.product-card span:empty {
    display: none !important;
}
.product-card .btn.btn-primary,
.product-card .btn.rounded-circle {
    display: none !important;
}

/* صفحة السلة */
.cart-item-img {
    height: 80px;
    width: 100%;
    max-width: 100px;
    object-fit: cover;
    border-radius: 12px;
    background: #f3f4f6;
}

.cart-item {
    transition: background 0.2s ease;
}

.cart-item:hover {
    background: rgba(249,250,251,0.9);
}

.total-section {
    background: #0f172a;
    color: #6fa8dc;
    border-radius: 20px !important;
    box-shadow: 0 20px 40px rgba(15,23,42,0.65);
    border: 1px solid rgba(148,163,184,0.35);
}

/* أيقونة السلة الفارغة */
.empty-cart-icon i {
    opacity: 0.6;
    color: #9ca3af;
}

/* صفحة الدفع checkout */
.checkout-page {
    background: transparent;
}

.checkout-card {
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15,23,42,0.45);
    border: none;
    overflow: hidden;
}

.checkout-card .card-header {
    background: linear-gradient(135deg,#2563eb,#1d4ed8);
    color: #ffffff;
    border-bottom: none;
    text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

.checkout-card .card-body {
    background: #0b1120;
    color: #6fa8dc;
}

.checkout-card h4,
.checkout-card h5 {
    color: #f9fafb;
}

.checkout-card .text-success {
    color: #22c55e !important;
}

.checkout-card .form-control,
.checkout-card .form-select,
.checkout-card textarea {
    border-radius: 10px;
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(148,163,184,0.7);
    color: #f9fafb;
}

.checkout-card .form-control::placeholder,
.checkout-card textarea::placeholder {
    color: #6fa8dc;
}

/* لوحة الإدارة (Admin) */
body.admin-page {
    background: radial-gradient(circle at top left,#020617 0%,#0f172a 40%,#1e293b 100%);
}

.admin-header {
    background: linear-gradient(135deg,#0f172a,#111827);
    color: #e5e7eb;
    box-shadow: 0 16px 35px rgba(15,23,42,0.75);
}

.admin-header .navbar-brand {
    font-size: 1.2rem;
}

.admin-header .navbar-text {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* كروت داخل لوحة الإدارة */
.admin-page .card {
    border-radius: 18px;
    box-shadow: 0 16px 35px rgba(15,23,42,0.7);
    border: 1px solid rgba(148,163,184,0.25);
    background: rgba(15,23,42,0.95);
    color: #e5e7eb;
}

.admin-page .card-header {
    background: linear-gradient(135deg,rgba(79,70,229,0.8),rgba(56,189,248,0.4));
    border-bottom: 1px solid rgba(148,163,184,0.4);
    color: #f9fafb;
}

/* الجداول داخل لوحة الإدارة */
.admin-page .table-responsive {
    font-size: 0.85rem;
}

.admin-page table {
    margin-bottom: 0;
    background-color: transparent;     /* إلغاء الخلفية البيضاء الافتراضية */
}

.admin-page table thead th {
    background: rgba(15,23,42,0.95);
    color: #f9fafb;
    border-color: rgba(55,65,81,0.9);
}

/* نجبر كل خلايا الجسم أن تكون داكنة بنص فاتح */
.admin-page table tbody tr:nth-child(even),
.admin-page table tbody tr:nth-child(odd) {
    background-color: rgba(15,23,42,0.9) !important;
}

.admin-page table tbody td {
    background-color: transparent !important;
    color: #f9fafb !important;
    border-color: rgba(55,65,81,0.7);
}

/* أزرار الحذف في لوحة الإدارة */
.admin-page .btn-danger {
    color: #fff;
}

/* حقول النماذج في لوحة الإدارة */
.admin-page .form-control,
.admin-page .form-select {
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(148,163,184,0.7);
    color: #f9fafb;
    border-radius: 10px;
}

.admin-page .form-control::placeholder {
    color: #cbd5f5;
}

/* دعم RTL */
[dir="rtl"] .text-start { text-align: right !important; }
[dir="rtl"] .text-end { text-align: left !important; }
[dir="rtl"] .ms-auto { margin-right: auto !important; }
[dir="rtl"] .me-auto { margin-left: auto !important; }
[dir="rtl"] .navbar-nav .nav-link { margin-right: 0.5rem; }
[dir="rtl"] .position-absolute.end-100 { right: 100% !important; }
[dir="rtl"] .position-absolute.start-100 { left: 100% !important; }

/* موبايل */
@media (max-width: 576px) {
    body {
        padding-top: 70px;
    }

    .product-img {
        height: 160px !important;
    }

    .hero-title {
        font-size: 1.8rem;
    }
}

/* تابلت */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .cart-item-img {
        height: 70px;
    }

    .total-section {
        margin-top: 1.5rem;
    }

    .navbar-collapse {
        background: rgba(15,23,42,0.9);
        margin-top: 0.5rem;
        border-radius: 0 0 16px 16px;
        padding: 0.75rem 1rem;
    }

    .navbar-nav .nav-item {
        width: 100%;
        text-align: center;
    }

    .navbar-nav .btn {
        width: 100%;
    }
}

/* تحسين لوحة الإدارة على الموبايل */
@media (max-width: 767.98px) {
    body {
        padding: 0 8px;
    }
    .admin-header .navbar-brand {
        font-size: 1.05rem;
    }
    .admin-header .navbar-text {
        font-size: 0.78rem;
    }
    .admin-page .card {
        border-radius: 14px;
        margin-bottom: 0.85rem;
    }
    .admin-page .card-header h5 {
        font-size: 1rem;
    }
    .admin-page .table-responsive {
        font-size: 0.8rem;
    }
    .admin-page .table-responsive table td,
    .admin-page .table-responsive table th {
        white-space: nowrap;
    }
    .card-body form.row.g-2 > .col-12,
    .card-body form.row.g-3 > .col-12 {
        margin-bottom: 0.5rem;
    }
    .col-12.col-lg-7,
    .col-12.col-lg-5 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* جداول لوحة التحكم كاملة العرض في Desktop */
@media (min-width: 992px) {
    .admin-page {
        width: 100vw !important;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        margin-bottom: 2rem;
    }
    
    .admin-page .table-responsive {
        padding: 0 1rem;
        background: var(--bs-table-bg);
        border-radius: 0.5rem;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    
    .admin-page .table {
        margin: 0;
        font-size: 0.875rem;
    }
    
    .admin-page th {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white !important;
        border: none;
        padding: 1rem 0.75rem;
        font-weight: 600;
        white-space: nowrap;
    }
    
    .admin-page td {
        padding: 0.875rem 0.75rem;
        vertical-align: middle;
        border-color: #e9ecef;
    }
    
    .admin-page .card {
        box-shadow: none !important;
        border: none !important;
        margin-bottom: 0;
    }
}

/* Mobile: احتفظ بالتصميم الحالي */
@media (max-width: 991.98px) {
    .admin-page .table-responsive {
        margin: 0 -1rem;
        border-radius: 0;
    }
}

/* تحسينات إضافية للكروت */
.card-body {
    padding: 1.5rem;
}

.table img {
    border: 2px solid #e9ecef;
    transition: transform 0.2s;
}

.table img:hover {
    transform: scale(1.05);
}

.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px; /* غيّرها إلى left لو تريد يسار */
    background-color: #25d366;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    z-index: 1000;
}

.whatsapp-icon {
    margin-top: 14px;
}

.whatsapp-float:hover {
    background-color: #1ebe5d;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    transition: 0.2s;
}

