:root {
  /* ألوان الوضع الفاتح */
  --bg-light: #ffffff;
  --text-light: #333333;
  --primary-light: #2563eb;
  --border-light: #e5e7eb;
  --bg-tertiary-light: #f7f7f7;
  --success-light: #34c759;
  --error-light: #ef4444;
  
  /* ألوان الوضع الداكن */
  --bg-dark: #1a1a1a;
  --text-dark: #f0f0f0;
  --primary-dark: #6c757d;
  --border-dark: #374151;
  --bg-tertiary-dark: #2f2f2f;
  --success-dark: #2ecc71;
  --error-dark: #e74c3c;
}

/* تطبيق الألوان حسب الوضع */
body {
  --bg-card: var(--bg-light);
  --text-primary: var(--text-light);
  --primary-color: var(--primary-light);
  --border-color: var(--border-light);
  --bg-tertiary: var(--bg-tertiary-light);
  --success-color: var(--success-light);
  --error-color: var(--error-light);
}

body.dark-mode {
  --bg-card: var(--bg-dark);
  --text-primary: var(--text-dark);
  --primary-color: var(--primary-dark);
  --border-color: var(--border-dark);
  --bg-tertiary: var(--bg-tertiary-dark);
  --success-color: var(--success-dark);
  --error-color: var(--error-dark);
  background: var(--bg-dark);
  color: var(--text-dark);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

/* الهيدر */
.main-header {
    background: var(--bg-card);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
    flex-wrap: wrap;
    gap: 1rem;
}

.navbar > * {
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0.5rem;
    transition: color 0.3s ease;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1001;
        gap: 0;
        overflow-y: auto;
        align-items: stretch;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        width: 100%;
        padding: 0;
        margin: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem 1rem;
        font-size: 1.1rem;
        width: 100%;
        text-align: right;
        color: var(--text-primary);
    }
    
    .nav-menu a:hover {
        background: var(--bg-tertiary);
    }
    
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    .close-menu {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        font-size: 2rem;
        cursor: pointer;
        color: var(--text-primary);
        padding: 0.5rem;
        transition: all 0.3s;
    }
    
    .close-menu:hover {
        color: var(--primary-color);
        transform: rotate(90deg);
    }
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: var(--bg-tertiary);
}

/* تحسينات للشاشات الكبيرة */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-menu {
        gap: 0.75rem;
    }
    
    .nav-menu a {
        padding: 0.5rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .logo {
        font-size: 1.3rem;
    }
}

@media (min-width: 1025px) and (max-width: 1200px) {
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-menu a {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
    }
}

@media (min-width: 1201px) {
    .nav-menu {
        gap: 1.5rem;
    }
    
    .nav-menu a {
        padding: 0.5rem 1rem;
    }
}

/* إخفاء الأيقونات على الشاشات الكبيرة */
@media (min-width: 769px) {
    .nav-menu a {
        font-size: 1rem;
    }
}

/* تحسينات إضافية للموبايل */
@media (max-width: 480px) {
    .nav-menu {
        width: 85%;
        max-width: 300px;
    }
    
    .nav-menu a {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }
}

.cart-icon {
    position: relative;
    font-size: 1.5rem;
    text-decoration: none;
}

.cart-badge,
.notification-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 50%;
}

/* القسم الترويجي */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

@media (max-width: 768px) {
    .hero {
        padding: 3rem 0;
    }
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .hero p {
        font-size: 1rem;
    }
}

/* الأزرار */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-block {
    display: block;
    width: 100%;
}

/* الأقسام */
.categories-section, .products-section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
}

.category-card {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, background-color 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 768px) {
    .category-card img {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .category-card img {
        height: 130px;
    }
}

.category-card h3 {
    padding: 1rem;
    text-align: center;
}

/* المنتجات */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
}

.product-card {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, background-color 0.3s ease;
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    height: 280px;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 768px) {
    .product-image {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .product-image {
        height: 180px;
    }
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.product-price {
    color: #2563eb;
    font-size: 1.25rem;
    font-weight: bold;
    margin: 1rem 0;
}

/* صفحة المنتج */
.product-page {
    padding: 3rem 0;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
    }
}

.product-gallery .main-image img {
    width: 100%;
    border-radius: 10px;
}

.thumbnail-images {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.thumbnail-images img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumbnail-images img.active,
.thumbnail-images img:hover {
    border-color: #2563eb;
}

.product-details h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .product-details h1 {
        font-size: 1.5rem;
    }
}

.product-category {
    color: #666;
    margin-bottom: 1rem;
}

.product-price-box {
    background: #f0f9ff;
    padding: 1rem;
    border-radius: 5px;
    margin: 1.5rem 0;
}

.product-price-box .price {
    font-size: 2rem;
    color: #2563eb;
    font-weight: bold;
}

.product-description {
    margin: 2rem 0;
}

.product-stock {
    margin: 1.5rem 0;
}

.in-stock {
    color: #10b981;
    font-weight: 600;
}

.out-of-stock {
    color: #ef4444;
    font-weight: 600;
}

.quantity-selector {
    margin: 1.5rem 0;
}

.quantity-selector input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 1rem;
}

/* السلة */
.cart-table {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.cart-table table {
    width: 100%;
    border-collapse: collapse;
}

@media (max-width: 768px) {
    .cart-table {
        overflow-x: auto;
        padding: 1rem;
    }
    
    .cart-table table {
        min-width: 600px;
    }
}

.cart-table th {
    background: var(--bg-tertiary);
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
    transition: background-color 0.3s ease;
}

.cart-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-product img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.cart-table input[type="number"] {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.btn-remove {
    color: #ef4444;
    font-size: 1.5rem;
    text-decoration: none;
    cursor: pointer;
}

.cart-summary {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 10px;
    max-width: 400px;
    margin-right: auto;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

@media (max-width: 768px) {
    .cart-summary {
        max-width: 100%;
        margin: 2rem 0;
        padding: 1.5rem;
    }
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2563eb;
    border-bottom: none;
}

.empty-cart {
    text-align: center;
    padding: 4rem;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background-color 0.3s ease;
}

/* صفحة إتمام الطلب */
.checkout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

@media (max-width: 768px) {
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem 0;
    }
}

.checkout-form {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group textarea {
    resize: vertical;
}

.order-summary-sidebar {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 10px;
    height: fit-content;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.summary-total {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    font-size: 1.25rem;
    font-weight: bold;
    color: #2563eb;
    margin-top: 1rem;
}

/* الفوتر */
.main-footer {
    background: #1f2937;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #60a5fa;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #60a5fa;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* تسجيل الدخول */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert.success {
    background: #d1fae5;
    color: #065f46;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

/* تحسينات شاملة للموبايل */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-info h3 {
        font-size: 0.95rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    .cart-product img {
        width: 50px;
        height: 50px;
    }
    
    .checkout-form,
    .order-summary-sidebar {
        padding: 1.5rem;
    }
    
    .login-box {
        padding: 2rem 1.5rem;
    }
}

/* تحسينات للتابلت */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 30px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Button hover effects */
.product-image {
    position: relative;
    overflow: hidden;
}

.product-image > a {
    display: block;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.product-image a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-image a:hover img {
    transform: scale(1.05);
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Product card hover effect */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Image zoom on hover */
.product-image img {
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

/* Toast notification style */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
    z-index: 9999;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: #2563eb;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    border: none;
}

.scroll-to-top:hover {
    background: #1d4ed8;
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.scroll-to-top.show {
    display: flex;
}

@media (max-width: 768px) {
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        left: 20px;
        font-size: 1.3rem;
    }
}

/* Enhanced animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Improved focus states for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Better image loading */
img {
    max-width: 100%;
    height: auto;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Improved card shadows on hover */
.product-card,
.category-card {
    position: relative;
}

.product-card::after,
.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.product-card:hover::after,
.category-card:hover::after {
    opacity: 1;
}

/* Smooth page transitions */
.page-transition {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Enhanced form inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
textarea,
select {
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Print styles */
@media print {
    .no-print,
    .scroll-to-top {
        display: none !important;
    }
    
    .main-header,
    .main-footer {
        display: none !important;
    }
}

/* ========================================
   تحسينات شاملة للموبايل
   ======================================== */

/* تحسينات عامة للموبايل */
@media (max-width: 768px) {
    /* تحسين النصوص */
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* تحسين الهيدر */
    .navbar {
        padding: 0.75rem 0;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    /* تحسين القائمة */
    .nav-menu a {
        padding: 1rem 0;
        border-bottom: 1px solid #f0f0f0;
        display: block;
        font-size: 1.1rem;
    }
    
    /* تحسين البطاقات */
    .product-card,
    .category-card {
        margin-bottom: 1rem;
    }
    
    .product-card img,
    .category-card img {
        height: 200px;
    }
    
    .product-card h3,
    .category-card h3 {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    /* تحسين الأزرار */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
        text-align: center;
    }
    
    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    /* تحسين الـ Grid */
    .products-grid,
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* تحسين النماذج */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* منع zoom على iOS */
        padding: 0.875rem;
    }
    
    /* تحسين السلة */
    .cart-items {
        padding: 1rem;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .cart-item img {
        width: 100%;
        max-width: 200px;
    }
    
    /* تحسين Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-section {
        margin-bottom: 2rem;
    }
    
    /* تحسين المودال */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* تحسين الجداول */
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    /* إخفاء بعض الأعمدة على الموبايل */
    .hide-mobile {
        display: none;
    }
}

/* تحسينات للموبايل الصغير */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    /* عمود واحد للمنتجات */
    .products-grid,
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card img,
    .category-card img {
        height: 250px;
    }
    
    /* تحسين القائمة */
    .nav-menu {
        width: 100%;
        right: -100%;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    /* تحسين الأزرار */
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* تحسينات للتابلت */
@media (min-width: 769px) and (max-width: 1024px) {
    .products-grid,
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .container {
        max-width: 960px;
    }
}

/* تحسين Touch للموبايل */
@media (hover: none) and (pointer: coarse) {
    /* زيادة مساحة الضغط */
    .btn,
    a,
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* إزالة hover effects على الموبايل */
    .product-card:hover,
    .category-card:hover,
    .btn:hover {
        transform: none;
    }
    
    /* تحسين الـ tap */
    * {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.2);
    }
}

/* Overlay للقائمة على الموبايل */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    .menu-overlay.active {
        display: block;
    }
}

/* زر إغلاق القائمة */
.menu-close {
    display: none;
}

@media (max-width: 768px) {
    .menu-close {
        display: block;
        position: absolute;
        top: 1rem;
        left: 1rem;
        background: #f0f0f0;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        font-size: 1.5rem;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .menu-close:hover {
        background: #e0e0e0;
        transform: rotate(90deg);
    }
}

/* تحسين الصور للموبايل */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    .product-image,
    .category-image {
        width: 100%;
        object-fit: cover;
    }
}

/* تحسين الـ Spacing */
@media (max-width: 768px) {
    section {
        padding: 2rem 0;
    }
    
    .section-title {
        margin-bottom: 1.5rem;
    }
}

/* تحسين الـ Scrollbar على الموبايل */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #2563eb;
        border-radius: 4px;
    }
}

/* تحسين الـ Loading للموبايل */
@media (max-width: 768px) {
    .loading {
        font-size: 0.9rem;
    }
    
    .spinner {
        width: 30px;
        height: 30px;
    }
}

/* تحسين الإشعارات للموبايل */
@media (max-width: 768px) {
    .alert,
    .notification {
        font-size: 0.9rem;
        padding: 0.75rem;
        border-radius: 8px;
    }
}

/* تحسين البحث للموبايل */
@media (max-width: 768px) {
    .search-form {
        width: 100%;
    }
    
    .search-input {
        width: 100%;
        font-size: 16px;
    }
}

/* تحسين الـ Pagination للموبايل */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .pagination a,
    .pagination span {
        min-width: 40px;
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* تحسين الـ Breadcrumb للموبايل */
@media (max-width: 768px) {
    .breadcrumb {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
}

/* تحسين الـ Tabs للموبايل */
@media (max-width: 768px) {
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-item {
        white-space: nowrap;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
}

/* تحسين الـ Accordion للموبايل */
@media (max-width: 768px) {
    .accordion-header {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .accordion-content {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* ========================================
   تنسيقات إضافية للوضع الليلي
   ======================================== */

/* تحسين الوضع الليلي للبطاقات */
body.dark-mode .product-card,
body.dark-mode .category-card {
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

body.dark-mode .product-card:hover,
body.dark-mode .category-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

/* تحسين الوضع الليلي للنماذج */
body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus,
body.dark-mode .form-group select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* تحسين الوضع الليلي للأزرار */
body.dark-mode .btn-secondary {
    background: #4b5563;
}

body.dark-mode .btn-secondary:hover {
    background: #374151;
}

/* تحسين الوضع الليلي للجداول */
body.dark-mode table {
    border-color: var(--border-color);
}

body.dark-mode tr:hover {
    background: var(--bg-tertiary);
}

/* تحسين الوضع الليلي للتنبيهات */
body.dark-mode .alert.success {
    background: #065f46;
    color: #d1fae5;
}

body.dark-mode .alert.error {
    background: #991b1b;
    color: #fee2e2;
}

/* تحسين الوضع الليلي للـ Scrollbar */
body.dark-mode ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #667eea;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* تحسين الوضع الليلي للـ Toast */
body.dark-mode .toast {
    background: #1f2937;
    color: #f0f0f0;
    border: 1px solid var(--border-color);
}

/* تحسين الوضع الليلي للـ Modal */
body.dark-mode .modal-content {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* تحسين الوضع الليلي للـ Dropdown */
body.dark-mode .dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

body.dark-mode .dropdown-item {
    color: var(--text-primary);
}

body.dark-mode .dropdown-item:hover {
    background: var(--bg-tertiary);
}

/* تحسين الوضع الليلي للـ Pagination */
body.dark-mode .pagination a,
body.dark-mode .pagination span {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode .pagination a:hover {
    background: var(--bg-tertiary);
}

body.dark-mode .pagination .active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* تحسين الوضع الليلي للـ Breadcrumb */
body.dark-mode .breadcrumb {
    background: var(--bg-card);
    color: var(--text-primary);
}

body.dark-mode .breadcrumb a {
    color: #667eea;
}

/* تحسين الوضع الليلي للـ Badge */
body.dark-mode .badge {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* تحسين الوضع الليلي للـ Product Details */
body.dark-mode .product-detail-grid {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

body.dark-mode .product-price-box {
    background: var(--bg-tertiary);
}

body.dark-mode .product-category {
    color: var(--text-secondary);
}

/* تحسين الوضع الليلي للـ Quantity Selector */
body.dark-mode .quantity-selector input {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* تحسين الوضع الليلي للـ Hero Section */
body.dark-mode .hero {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

/* تحسين الوضع الليلي للـ Footer */
body.dark-mode .main-footer {
    background: #0f172a;
    border-top: 1px solid var(--border-color);
}

body.dark-mode .footer-section h3 {
    color: #667eea;
}

body.dark-mode .footer-section a {
    color: #9ca3af;
}

body.dark-mode .footer-section a:hover {
    color: #667eea;
}

/* تأثيرات انتقالية سلسة */
body.dark-mode * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* إصلاح النقر على الأزرار في البطاقات */
.product-card .product-info {
    position: relative;
    z-index: 2;
}

.product-card .product-image {
    position: relative;
    z-index: 1;
}

.product-card .btn {
    position: relative;
    z-index: 3;
    pointer-events: auto;
}
