/* Reset و Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1C1C1C;
    --secondary-color: #555555;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-color: #F7F5F2;
    --dark-color: #222222;
    --gray-color: #95a5a6;
    --border-color: #ddd;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --button-press-color: #555555;
}

/* تحسين تأثير الضغط على جميع الأزرار */
button:active, 
.btn:active,
.auth-btn:active,
.submit-btn:active,
.add-to-cart-btn:active {
    background-color: var(--button-press-color) !important;
    transform: scale(0.95);
    transition: all 0.1s ease;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #FFFFFF;
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* شاشة المصادقة */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f7f5f2 0%, #ffffff 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    padding: 20px;
}

.auth-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

.auth-header {
    margin-bottom: 30px;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}

.auth-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-btn {
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-btn i {
    font-size: 18px;
}

.google-btn {
    background: #2B2B2B;
    color: #E0E0E0;
}

.google-btn:hover {
    background: #444444;
    transform: translateY(-2px);
}

.email-btn {
    background: #2B2B2B;
    color: #E0E0E0;
}

.email-btn:hover {
    background: #444444;
    transform: translateY(-2px);
}

.guest-btn {
    background: #2B2B2B;
    color: #E0E0E0;
}

.guest-btn:hover {
    background: #444444;
    transform: translateY(-2px);
}

.auth-note {
    margin-top: 20px;
    color: var(--gray-color);
    font-size: 14px;
    line-height: 1.5;
}

/* نموذج البريد الإلكتروني */
.email-auth-form {
    margin-top: 20px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 14px;
    padding: 8px;
    transition: var(--transition);
}

.back-btn:hover {
    color: var(--button-press-color);
}

.form-group {
    margin-bottom: 20px;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    transition: var(--transition);
    background: #f9f9f9;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(85, 85, 85, 0.1);
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.submit-btn {
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:not(.secondary) {
    background: var(--secondary-color);
    color: white;
}

.submit-btn:not(.secondary):hover {
    background: #444444;
    transform: translateY(-2px);
}

.submit-btn.secondary {
    background: var(--light-color);
    color: var(--dark-color);
    border: 2px solid var(--border-color);
}

.submit-btn.secondary:hover {
    background: #e8e6e3;
    transform: translateY(-2px);
}

/* تأثير الضغط على الأزرار - تطبيق اللون الجديد */
.submit-btn:not(.secondary):active {
    background: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

.submit-btn.secondary:active {
    background: var(--button-press-color) !important;
    color: white !important;
    border-color: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

.auth-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.auth-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.auth-terms {
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    text-align: right;
    font-size: 13px;
}

.auth-terms p {
    font-size: 14px;
    color: var(--dark-color);
    margin-bottom: 10px;
    line-height: 1.5;
}

.auth-terms ul {
    font-size: 13px;
    color: var(--dark-color);
    margin: 10px 0 0 20px;
    padding: 0;
    list-style-position: inside;
}

.auth-terms li {
    margin-bottom: 5px;
}

/* التطبيق الرئيسي */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============== الهيدر المعدل ============== */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    gap: 10px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left, .header-right {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 100px;
}

.header-left {
    justify-content: flex-end;
}

.header-right {
    justify-content: flex-start;
}

.header-center {
    flex: 0 1 auto;
    min-width: 120px;
    text-align: center;
}

/* عناصر الجزء الأيمن */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--light-color);
    color: var(--secondary-color);
}

.menu-toggle:active {
    background: var(--button-press-color) !important;
    color: white !important;
}

.nav-icon {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--primary-color);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.nav-icon:hover {
    background: var(--light-color);
    color: var(--secondary-color);
}

.nav-icon:active {
    background: var(--button-press-color) !important;
    color: white !important;
    transform: scale(0.95) !important;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* زر الرجوع */
#backBtn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
}

#backBtn:hover {
    background: var(--light-color);
}

#backBtn:active {
    background: var(--button-press-color) !important;
    color: white !important;
    transform: scale(0.95) !important;
}

/* الشعار */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    cursor: pointer;
}

.logo img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.logo h1 {
    font-size: 18px;
    color: var(--primary-color);
    font-weight: 700;
    white-space: nowrap;
}

/* شريط البحث */
.search-container {
    display: flex;
    width: 100%;
    max-width: 200px;
}

.search-container input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 0 20px 20px 0;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    background: #f9f9f9;
    width: 0;
    transition: var(--transition);
}

.search-container input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: white;
}

.search-container button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0 12px;
    border-radius: 20px 0 0 20px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-container button:hover {
    background: #444444;
}

.search-container button:active {
    background: var(--button-press-color) !important;
    transform: scale(0.95) !important;
}

/* ============== نهاية الهيدر المعدل ============== */

/* القائمة المتنقلة */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    z-index: 2000;
}

.mobile-nav.active {
    right: 0;
}

/* طبقة خلفية عند فتح القائمة */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
    backdrop-filter: blur(2px);
}

.nav-overlay.active {
    display: block;
}

/* منع التمرير عند فتح القائمة */
body.menu-open {
    overflow: hidden;
}

.mobile-nav-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--shadow);
}

.close-menu {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-menu:hover {
    background: var(--light-color);
    color: var(--danger-color);
}

.close-menu:active {
    background: var(--button-press-color) !important;
    color: white !important;
    transform: scale(0.95) !important;
}

.mobile-nav-links {
    list-style: none;
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.mobile-nav-links li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 25px;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    border-right: 3px solid transparent;
    font-size: 16px;
}

.mobile-nav-links li a:hover {
    background: var(--light-color);
    color: var(--secondary-color);
    border-right-color: var(--secondary-color);
}

.mobile-nav-links li a:active {
    background: var(--button-press-color) !important;
    color: white !important;
    border-right-color: var(--button-press-color) !important;
}

.mobile-nav-links li a i {
    width: 20px;
    text-align: center;
}

.mobile-nav-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 25px;
    color: var(--danger-color) !important;
    text-decoration: none;
    transition: var(--transition);
    border-right: 3px solid transparent;
    font-size: 16px;
    font-weight: 600;
}

.logout-link:hover {
    background: #fff5f5;
    border-right-color: var(--danger-color);
}

.logout-link:active {
    background: var(--danger-color) !important;
    color: white !important;
    border-right-color: var(--danger-color) !important;
}

.logout-item {
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
}

/* المحتوى الرئيسي */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.section {
    display: none;
    animation: fadeIn 0.5s ease;
    width: 100%;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* المنتجات */
.section-title {
    font-size: 32px;
    margin-bottom: 40px;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 15px;
    text-align: center;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

/* تحسينات الشاشة الرئيسية */
.category-item:hover {
    transform: translateY(-5px);
    background: #f0ede9 !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.category-item i {
    transition: transform 0.3s ease;
}

.category-item:hover i {
    transform: scale(1.2);
}

.all-products-home {
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.loading-more {
    text-align: center;
    padding: 20px;
    width: 100%;
}

.loading-spinner-small {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0,0,0,0.05);
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--secondary-color);
}

/* صور المنتجات المربعة 1:1 */
.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background: var(--light-color);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

/* دعم للمتصفحات القديمة */
@supports not (aspect-ratio: 1 / 1) {
    .product-image {
        height: 250px;
        padding-top: 0;
    }
}

.badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    z-index: 2;
}

.badge.new {
    background: var(--success-color);
}

.badge.sale {
    background: var(--danger-color);
}

.badge.best {
    background: var(--secondary-color);
}

.product-info {
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    font-size: 13px;
    margin-bottom: 3px;
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.2;
}

.product-description {
    font-size: 11px;
    color: var(--gray-color);
    margin-bottom: 5px;
    min-height: auto;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--secondary-color);
}

.original-price {
    font-size: 11px;
    color: var(--gray-color);
    text-decoration: line-through;
}

.product-stock {
    font-size: 12px;
    color: var(--gray-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    align-items: center;
}

.action-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.add-to-cart {
    background: var(--secondary-color);
    color: white;
    flex: 2;
}

.add-to-cart:hover {
    background: #444444;
    transform: translateY(-2px);
}

.add-to-cart:active {
    background: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

.buy-now {
    background: var(--primary-color);
    color: white;
    flex: 2;
}

.buy-now:hover {
    background: #333333;
    transform: translateY(-2px);
}

.buy-now:active {
    background: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

.favorite-btn {
    background: transparent;
    color: var(--gray-color);
    border: none;
    width: auto;
    height: auto;
    padding: 5px;
    font-size: 20px;
}

.favorite-btn.active {
    color: #e74c3c;
}

.favorite-btn.active {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.favorite-btn:hover {
    transform: scale(1.1);
}

.favorite-btn:active {
    background: var(--button-press-color) !important;
    border-color: var(--button-press-color) !important;
    color: white !important;
    transform: scale(0.95) !important;
}

/* الفلاتر */
.filters-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .filters-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.filter-select {
    padding: 8px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    background: white;
    cursor: pointer;
    color: var(--dark-color);
    min-width: 150px;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 12px;
    background: white;
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.filter-btn:hover:not(.active) {
    background: var(--light-color);
    border-color: var(--secondary-color);
}

.filter-btn:active {
    background: var(--button-press-color) !important;
    color: white !important;
    border-color: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

/* سلة التسوق */
.cart-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 992px) {
    .cart-container {
        flex-direction: row;
    }
    .cart-items {
        flex: 2;
    }
    .cart-summary {
        flex: 1;
    }
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    min-height: 60px;
}

@media (min-width: 576px) {
    .cart-item {
        flex-direction: row;
    }
}

.cart-item-image {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    align-self: center;
    position: relative;
}

.cart-item-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 5px;
}

.cart-item-title {
    font-size: 13px;
    margin-bottom: 0;
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 12px;
    grid-column: 1;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-row: 1 / 3;
    grid-column: 2;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--light-color);
    padding: 2px 5px;
    border-radius: 6px;
}

.quantity-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--primary-color);
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.quantity-btn:hover {
    background: var(--secondary-color);
    color: white;
}

.quantity-btn:active {
    background: var(--button-press-color) !important;
}

.quantity {
    font-weight: 600;
    font-size: 14px;
    min-width: 25px;
    text-align: center;
    color: var(--primary-color);
}

.remove-item-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 5px;
}

.remove-item-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.remove-item-btn:active {
    background: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

.cart-item-total {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 10px;
}

.cart-summary {
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 100px;
}

.cart-summary h3 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--primary-color);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--light-color);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.summary-item.total {
    border-bottom: none;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 6px;
    margin-bottom: 8px;
}

.checkout-btn {
    width: 100%;
    padding: 10px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.checkout-btn:disabled {
    background: var(--gray-color);
    cursor: not-allowed;
    transform: none !important;
}

.checkout-btn:not(:disabled):hover {
    background: #1da851;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.2);
}

.checkout-btn:not(:disabled):active {
    background: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

.shipping-note {
    margin-top: 20px;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #0c5460;
    border-right: 4px solid #3498db;
}

.empty-cart, .empty-favorites {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.empty-cart i, .empty-favorites i {
    color: var(--secondary-color);
    margin-bottom: 25px;
    opacity: 0.8;
}

.empty-cart h3, .empty-favorites h3 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.empty-cart p, .empty-favorites p {
    color: var(--gray-color);
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
}

/* قسم المميزات */
.features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid var(--light-color);
}

.feature {
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary-color);
}

.feature i {
    font-size: 42px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.feature h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.feature p {
    color: var(--gray-color);
    font-size: 15px;
    line-height: 1.5;
}

/* الملف الشخصي */
.profile-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

@media (min-width: 768px) {
    .profile-header {
        flex-direction: row;
        text-align: right;
    }
}

.profile-image-container {
    position: relative;
}

.profile-image-container img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: var(--shadow);
}

.edit-image-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.edit-image-btn:hover {
    background: #444444;
    transform: scale(1.1);
}

.edit-image-btn:active {
    background: var(--button-press-color) !important;
    transform: scale(0.95) !important;
}

.profile-info h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.since-text {
    color: var(--gray-color);
    font-size: 14px;
}

.profile-section {
    margin-bottom: 30px;
    padding: 25px;
    background: var(--light-color);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.profile-section h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    color: var(--primary-color);
    font-size: 20px;
}

/* تحسين تصميم الملف الشخصي */
.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.detail-card:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow);
}

.detail-card i {
    font-size: 20px;
    color: var(--secondary-color);
    width: 40px;
    height: 40px;
    background: var(--light-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-content {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 12px;
    color: var(--gray-color);
    font-weight: 600;
}

.detail-value {
    font-size: 15px;
    color: var(--dark-color);
    font-weight: 700;
}

.edit-profile-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Cairo';
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.edit-profile-btn:hover {
    background: var(--secondary-color);
}

/* إحصائيات المستخدم */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--secondary-color);
}

.stat-card i {
    font-size: 42px;
    color: var(--secondary-color);
}

.stat-card h3 {
    font-size: 28px;
    margin-bottom: 5px;
    color: var(--primary-color);
}

/* الفوتر */
.footer {
    background: var(--primary-color);
    color: white;
    margin-top: 60px;
    padding-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 0 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-logo img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
}

.footer-logo h3 {
    font-size: 22px;
    color: white;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.social-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-size: 18px;
}

.social-icon:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

.social-icon:active {
    background: var(--button-press-color) !important;
    transform: scale(0.95) !important;
}

.footer-section h4 {
    font-size: 20px;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 12px;
    color: white;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 2px;
    background: var(--secondary-color);
}

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

.footer-section ul li {
    margin-bottom: 15px;
}

.footer-section ul li a {
    color: #ddd;
    text-decoration: none;
    transition: var(--transition);
    display: block;
    padding: 5px 0;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
    padding-right: 10px;
}

.footer-section ul li a:active {
    color: var(--button-press-color) !important;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.contact-info li i {
    color: var(--secondary-color);
    margin-top: 3px;
}

.footer-bottom {
    text-align: center;
    padding: 25px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: #aaa;
}

/* النوافذ المنبثقة */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1002;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    max-width: 480px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wide-modal {
    max-width: 700px;
}

.small-modal {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-color);
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    font-size: 24px;
    color: var(--primary-color);
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-color);
    cursor: pointer;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-modal:hover {
    background: var(--light-color);
    color: var(--danger-color);
}

.close-modal:active {
    background: var(--button-press-color) !important;
    color: white !important;
    transform: scale(0.95) !important;
}

.modal-body {
    padding: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 576px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 25px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
}

.modal-footer {
    display: flex;
    gap: 15px;
    padding: 25px;
    border-top: 1px solid var(--border-color);
    background: var(--light-color);
    border-radius: 0 0 20px 20px;
}

.btn-primary, .btn-secondary, .btn-danger {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #444444;
    transform: translateY(-2px);
}

.btn-primary:active {
    background: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

.btn-secondary {
    background: var(--light-color);
    color: var(--dark-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e8e6e3;
    transform: translateY(-2px);
}

.btn-secondary:active {
    background: var(--button-press-color) !important;
    color: white !important;
    border-color: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-danger:active {
    background: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

.success-icon {
    font-size: 60px;
    color: var(--success-color);
    margin-bottom: 20px;
    text-align: center;
    display: block;
}

.warning-icon {
    font-size: 60px;
    color: var(--warning-color);
    margin-bottom: 20px;
}

/* نافذة تحديد الكمية */
.quantity-selector {
    text-align: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--light-color);
    border-radius: 15px;
}

#selectedQuantity {
    width: 80px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    font-family: 'Cairo';
    color: var(--primary-color);
    background: white;
}

#selectedQuantity:focus {
    outline: none;
    border-color: var(--primary-color);
}

.quantity-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* الإشعارات */
#toastContainer {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1003;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 18px 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideIn 0.3s ease;
    max-width: 350px;
    border-right: 5px solid;
    transition: transform 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-right-color: var(--success-color);
}

.toast.error {
    border-right-color: var(--danger-color);
}

.toast.warning {
    border-right-color: var(--warning-color);
}

.toast.info {
    border-right-color: var(--secondary-color);
}

/* التحميل */
.products-loading {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-products {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-color);
    font-size: 18px;
    grid-column: 1 / -1;
    background: var(--light-color);
    border-radius: 15px;
    border: 2px dashed var(--border-color);
}

/* الاستجابة */
@media (max-width: 768px) {
    .header-content {
        padding: 8px 10px;
    }
    
    .search-container {
        max-width: 150px;
    }
    
    .search-container input {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .search-container button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .logo h1 {
        font-size: 16px;
    }
    
    .logo img {
        width: 30px;
        height: 30px;
    }
    
    .menu-toggle, .nav-icon, #backBtn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    /* تعديل صور المنتجات للشاشات الصغيرة */
    .product-image {
        aspect-ratio: 1 / 1;
    }
    
    @supports not (aspect-ratio: 1 / 1) {
        .product-image {
            height: 200px;
        }
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .feature {
        padding: 25px 15px;
    }
    
    .feature h3 {
        font-size: 18px;
    }
    
    .footer-content {
        gap: 30px;
    }
}

@media (max-width: 576px) {
    .auth-container {
        padding: 25px 20px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    /* تعديل صور المنتجات للشاشات الصغيرة جداً */
    .product-image {
        aspect-ratio: 1 / 1;
    }
    
    @supports not (aspect-ratio: 1 / 1) {
        .product-image {
            height: 180px;
        }
    }
    
    .cart-item {
        padding: 15px;
    }
    
    .cart-item-image {
        width: 100px;
        height: 100px;
    }
    
    .profile-container {
        padding: 20px;
    }
    
    .profile-section {
        padding: 20px;
    }
    
    .modal {
        padding: 15px;
    }
    
    .modal-content {
        border-radius: 15px;
    }
    
    .header-content {
        padding: 8px 10px;
    }
    
    .logo h1 {
        font-size: 14px;
    }
    
    .search-container {
        max-width: 130px;
    }
    
    .search-container input {
        font-size: 12px;
        padding: 6px 8px;
    }
}

@media (min-width: 768px) {
    .search-container {
        max-width: 250px;
    }
}

/* تحسينات خاصة بالجوال */
@media (max-width: 480px) {
    .header-content {
        gap: 5px;
    }
    
    .logo h1 {
        font-size: 12px;
    }
    
    .search-container {
        max-width: 120px;
    }
    
    .search-container input {
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .search-container button {
        padding: 5px 8px;
        font-size: 11px;
        min-width: 36px;
        min-height: 36px;
    }
    
    .mobile-nav {
        width: 260px;
    }
    
    .auth-btn {
        padding: 14px;
        font-size: 15px;
    }
    
    .feature {
        padding: 20px 15px;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .favorite-btn {
        width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 15px 30px;
    }
    
    /* تعديل نهائي لصور المنتجات على الشاشات الصغيرة جداً */
    .product-image {
        aspect-ratio: 1 / 1;
    }
    
    @supports not (aspect-ratio: 1 / 1) {
        .product-image {
            height: 160px;
        }
    }
}

/* حالة عدم التفعيل */
.disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* تخصيص شريط التمرير */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444444;
}

/* تحسينات عامة */
input, textarea, select, button {
    font-family: 'Cairo', sans-serif;
}

*:focus {
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* تحسينات للمنتجات */
.product-image {
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 70%, rgba(0,0,0,0.1));
    pointer-events: none;
    z-index: 1;
}

/* تأثيرات عند التمرير */
@media (prefers-reduced-motion: no-preference) {
    .product-card, .feature, .stat-card {
        animation: fadeInUp 0.6s ease-out;
        animation-fill-mode: both;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* تحسين النصوص العربية */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
}

p {
    line-height: 1.6;
}

/* تحسين الأزرار */
button {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* تحسينات للشحن */
.shipping-note i {
    color: var(--secondary-color);
    font-size: 18px;
}

/* تحسينات للكمية */
.quantity-selector {
    padding: 10px 0;
}

#selectedQuantity {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

/* تحسينات للواتساب */
.checkout-btn i {
    font-size: 22px;
}

/* تحسينات للصور */
.product-image img, .cart-item-image img {
    transition: transform 0.5s ease;
}

/* تحسينات للفلاتر */
.filter-buttons {
    justify-content: center;
}

@media (min-width: 768px) {
    .filter-buttons {
        justify-content: flex-start;
    }
}

/* تحسين شاشة المصادقة للجوال */
@media (max-height: 700px) {
    .auth-container {
        padding: 20px;
        max-height: 95vh;
    }
    
    .auth-btn {
        padding: 12px;
    }
    
    .submit-btn {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
    }
}

/* ضبط الحاويات */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* تحسين عرض المنتجات على الشاشات الصغيرة */
@media (max-width: 576px) {
    .main-content {
        padding: 15px 10px !important;
    }
    
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* محاذاة النصوص للغة العربية */
[dir="rtl"] .text-left {
    text-align: right !important;
}

[dir="rtl"] .text-right {
    text-align: left !important;
}

[dir="rtl"] .mr-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .ml-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

/* إصلاحات للهوامش والحواف */
.m-0 {
    margin: 0 !important;
}

.p-0 {
    padding: 0 !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

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

/* تحسين عرض الصور */
.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-thumbnail {
    padding: 0.25rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    max-width: 100%;
    height: auto;
}

/* === تحسينات إضافية لصور المنتجات المربعة === */

/* تحسين تأثير الزوم على الصور المربعة */
.product-card:hover .product-image img {
    transform: scale(1.08);
}

/* تحسين ظل الصورة المربعة */
.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0,0,0,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.product-card:hover .product-image::before {
    opacity: 1;
}

/* تحسين وضع الشارات على الصور المربعة */
.badge {
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    z-index: 2;
}

/* تحسينات للصور في المنتجات المميزة والمفضلة */
.featured-products .product-image,
.favorites-grid .product-image {
    aspect-ratio: 1 / 1;
}

@supports not (aspect-ratio: 1 / 1) {
    .featured-products .product-image,
    .favorites-grid .product-image {
        height: 220px;
    }
}

/* تحسينات إضافية للاستجابة */
@media (max-width: 768px) {
    @supports not (aspect-ratio: 1 / 1) {
        .featured-products .product-image,
        .favorites-grid .product-image {
            height: 200px;
        }
    }
}

@media (max-width: 480px) {
    @supports not (aspect-ratio: 1 / 1) {
        .featured-products .product-image,
        .favorites-grid .product-image {
            height: 180px;
        }
    }
}

/* تحسينات أخيرة للصور المربعة */
.product-image {
    background-color: #f8f9fa;
    background-image: linear-gradient(45deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%, #f5f5f5),
                      linear-gradient(45deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%, #f5f5f5);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

.product-image img {
    background-color: white;
}

/* تأثير تحميل للصور */
.product-image.loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.8; }
    100% { opacity: 0.6; }
}

/* === نهاية التعديلات === */

/* نظام الطلبات الجديد */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.order-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.order-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}

.order-id {
    font-weight: 700;
    color: var(--primary-color);
}

.order-status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-paid { background: #d1ecf1; color: #0c5460; }
.status-processing { background: #d4edda; color: #155724; }
.status-shipped { background: #cce5ff; color: #004085; }
.status-delivered { background: #d4edda; color: #155724; }

.order-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-items-summary {
    font-size: 14px;
    color: var(--gray-color);
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-weight: 700;
    font-size: 16px;
}

/* نظام تتبع الطلبات */
.order-tracking {
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.tracking-steps {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    position: relative;
    margin-bottom: 10px;
}

.tracking-steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 3px;
    background: #e0e0e0;
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 20%;
}

.step-icon {
    width: 30px;
    height: 30px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 10px;
    color: #999;
    font-weight: 600;
    text-align: center;
}

.step.active .step-icon {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
    color: white;
}

.step.active .step-label {
    color: var(--secondary-color);
}

.step.completed .step-icon {
    border-color: var(--success-color);
    background: var(--success-color);
    color: white;
}

.step.completed .step-label {
    color: var(--success-color);
}

.tracking-line-fill {
    position: absolute;
    top: 15px;
    right: 0;
    height: 3px;
    background: var(--success-color);
    z-index: 1;
    transition: width 0.5s ease;
}

/* نافذة إتمام الطلب */
.bank-info-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    border-right: 4px solid var(--secondary-color);
}

.bank-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.order-total-display {
    text-align: center;
    padding: 15px;
    background: var(--light-color);
    border-radius: 10px;
    margin-bottom: 20px;
}

.order-total-display h3 {
    color: var(--secondary-color);
    font-size: 24px;
    margin-top: 5px;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-color);
}

.upload-label:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: rgba(85, 85, 85, 0.05);
}

.upload-label i {
    font-size: 40px;
    margin-bottom: 10px;
}

.receipt-preview img {
    max-height: 300px;
    object-fit: contain;
}

/* لوحة تحكم الإدارة - الطلبات */
.admin-order-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.status-select {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-family: 'Cairo';
}

.view-receipt-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cairo';
}

.view-receipt-btn:active {
    background: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

/* أنماط لون الأزرار عند الضغط - تم تحديثها إلى الرمادي الداكن */

/* معاينة الألوان في لوحة التحكم */
.preview-elements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.preview-element {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    color: white;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-element:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.preview-primary {
    background: var(--primary-color);
}

.preview-secondary {
    background: var(--secondary-color);
}

.preview-success {
    background: var(--success-color);
}

.preview-danger {
    background: var(--danger-color);
}

.preview-warning {
    background: var(--warning-color);
}

.preview-light {
    background: var(--light-color);
    color: var(--dark-color);
    border: 2px solid var(--border-color);
}

.preview-button-press {
    background: var(--button-press-color);
    cursor: pointer;
    border: none;
}

.preview-button-press:active {
    transform: scale(0.95);
    background: var(--button-press-color);
}

/* مجموعة إدخال الألوان */
.color-input-group {
    display: grid;
    grid-template-columns: 80px 1fr 1fr;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: var(--light-color);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.color-preview {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
}

.color-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-inputs label {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
}

.color-inputs input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}

.color-inputs input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.color-info {
    text-align: right;
}

.color-info h5 {
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.color-info p {
    font-size: 13px;
    color: var(--gray-color);
    line-height: 1.4;
}

.preview-section {
    background: var(--light-color);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-top: 20px;
}

.preview-section h4 {
    margin-bottom: 15px;
    color: var(--dark-color);
    font-size: 18px;
}

/* استجابة الهاتف المحمول */
@media (max-width: 768px) {
    .color-input-group {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .color-preview {
        width: 100%;
        height: 60px;
    }
    
    .preview-elements {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* أنماط جديدة للصور والإيصالات */
.receipt-section {
    margin: 20px 0;
    padding: 20px;
    background: var(--light-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.receipt-section h5 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.receipt-section img {
    transition: transform 0.3s ease;
    border: 2px solid transparent;
}

.receipt-section img:hover {
    transform: scale(1.05);
    border-color: var(--secondary-color);
}

.view-receipt-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cairo';
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.view-receipt-btn:hover {
    background: #444444;
    transform: translateY(-2px);
}

.view-receipt-btn:active {
    background: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--light-color);
    text-align: center;
}

.upload-label:hover {
    border-color: var(--secondary-color);
    background: rgba(85, 85, 85, 0.05);
}

.upload-label i {
    font-size: 40px;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.upload-label span {
    color: var(--dark-color);
    font-weight: 600;
}

.order-status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-paid {
    background: #d4edda;
    color: #155724;
}

.status-processing {
    background: #cce5ff;
    color: #004085;
}

.status-shipped {
    background: #d1ecf1;
    color: #0c5460;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* معاينة الصورة */
#receiptPreviewContainer {
    animation: fadeIn 0.3s ease;
}

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

/* زر الإيصال */
.btn-receipt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--light-color);
    color: var(--dark-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Cairo';
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-receipt:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.btn-receipt:active {
    background: var(--button-press-color) !important;
    border-color: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

/* رسالة النجاح */
.success-message {
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* أنماط مراقب التمرير */
.scroll-sentinel {
    height: 50px;
    width: 100%;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    clear: both;
}

/* تحسين التجاوب */
@media (max-width: 768px) {
    .receipt-section img {
        max-width: 150px;
    }
    
    .upload-label {
        padding: 20px;
    }
    
    .order-status-badge {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* ==================== أنماط نظام الإشعارات ==================== */

/* زر الإشعارات في الهيدر */
.notification-icon {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.notification-icon:hover {
    background: var(--light-color);
    color: var(--secondary-color);
}

.notification-icon:active {
    background: var(--button-press-color) !important;
    color: white !important;
    transform: scale(0.95) !important;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
    border: 2px solid white;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* لوحة الإشعارات */
.notification-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 10001;
    display: none;
    flex-direction: column;
    animation: slideDown 0.3s ease;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.notification-panel.active {
    display: flex;
}

.notification-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light-color);
}

.notification-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-actions {
    display: flex;
    gap: 8px;
}

.notification-actions button {
    width: 32px;
    height: 32px;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--gray-color);
    cursor: pointer;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-actions button:hover {
    background: var(--light-color);
    color: var(--primary-color);
    border-color: var(--secondary-color);
}

.notification-actions button:active {
    background: var(--button-press-color) !important;
    color: white !important;
    border-color: var(--button-press-color) !important;
    transform: scale(0.95) !important;
}

.notification-tabs {
    display: flex;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 5px;
    background: var(--light-color);
}

.notification-tab {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--gray-color);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.notification-tab:hover {
    border-color: var(--secondary-color);
    color: var(--primary-color);
}

.notification-tab:active {
    background: var(--button-press-color) !important;
    border-color: var(--button-press-color) !important;
    color: white !important;
    transform: scale(0.95) !important;
}

.notification-tab.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    max-height: 350px;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.3s;
}

.notification-item:hover {
    background: var(--light-color);
}

.notification-item.unread {
    background: #f0f7ff;
    border-right: 3px solid var(--secondary-color);
}

.notification-content {
    display: flex;
    gap: 12px;
}

.notification-icon-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-details {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-size: 14px;
    line-height: 1.3;
}

.notification-message {
    font-size: 13px;
    color: var(--gray-color);
    margin-bottom: 8px;
    line-height: 1.4;
    word-break: break-word;
}

.notification-time {
    font-size: 11px;
    color: var(--gray-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification-badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--secondary-color);
    color: white;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
}

.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-color);
}

.notification-empty i {
    font-size: 40px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.notification-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.notification-footer button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cairo';
    font-weight: 600;
    transition: background 0.3s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.notification-footer button:hover {
    background: #444444;
}

.notification-footer button:active {
    background: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

.notification-actions-mini {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.notification-actions-mini button {
    padding: 4px 10px;
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 11px;
    color: var(--gray-color);
    cursor: pointer;
    transition: all 0.2s;
}

.notification-actions-mini button:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.notification-actions-mini button:active {
    background: var(--button-press-color) !important;
    color: white !important;
    border-color: var(--button-press-color) !important;
    transform: scale(0.95) !important;
}

/* الإشعارات الفورية */
.instant-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 99999;
    width: 320px;
    max-width: calc(100vw - 40px);
    animation: slideInRight 0.3s ease;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.instant-notification:active {
    transform: scale(0.98) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}

/* تخصيص شريط التمرير */
.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.notification-list::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: #444444;
}

/* إشعارات الهاتف */
@media (max-width: 768px) {
    .notification-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        top: 60px;
        max-height: 70vh;
    }
    
    .notification-icon {
        padding: 8px;
        font-size: 18px;
    }
    
    .instant-notification {
        width: calc(100% - 40px) !important;
        right: 20px !important;
        left: 20px !important;
    }
}

@media (max-width: 480px) {
    .notification-panel {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
    }
    
    .notification-header h3 {
        font-size: 14px;
    }
    
    .notification-tab {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ==================== تأثير الضغط على جميع الأزرار ==================== */

/* تأثير الضغط الشامل - الرمادي الداكن */
button:active,
.auth-btn:active,
.filter-btn:active,
.quantity-btn:active,
.action-btn:active,
.nav-icon:active,
.menu-toggle:active,
.close-menu:active,
.logout-btn:active,
.edit-image-btn:active,
.edit-profile-btn:active,
.remove-item-btn:active,
.checkout-btn:not(:disabled):active,
.btn-primary:active,
.btn-secondary:active,
.btn-danger:active,
.notification-icon:active,
.notification-actions button:active,
.notification-tab:active,
.view-receipt-btn:active,
.btn-receipt:active,
.notification-actions-mini button:active,
.notification-footer button:active {
    background-color: var(--button-press-color) !important;
    color: white !important;
    border-color: var(--button-press-color) !important;
    transform: scale(0.98) !important;
}

/* استثناءات للأزرار التي يجب أن تحتفظ بلونها عند الضغط */
.favorite-btn.active:active {
    background-color: var(--button-press-color) !important;
    border-color: var(--button-press-color) !important;
    color: white !important;
}

/* ==================== نهاية تأثير الضغط ==================== */

/* أضف هذه الأنماط إلى ملف style.css الخاص بك */

/* شريط تقدم الرفع */
.upload-progress {
    display: none;
    margin-top: 15px;
}

.progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--secondary-color);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    margin-top: 5px;
    font-size: 12px;
    color: var(--gray-color);
}

/* تحسينات للصور */
.receipt-preview {
    max-width: 300px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: block;
    margin: 0 auto;
}

/* تحسينات للجوال */
@media (max-width: 768px) {
    .upload-progress {
        margin-top: 10px;
    }
    
    .receipt-preview {
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .receipt-preview {
        max-width: 200px;
    }
}

/* تحسينات الأزرار العصرية - نافذة إتمام الطلب */
#confirmOrderBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #333 0%, #555 100%) !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2) !important;
}

#confirmOrderBtn:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
}

#confirmOrderBtn:disabled {
    background: #e0e0e0 !important;
    color: #999 !important;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

#cancelCheckoutBtn:hover {
    background: #f5f5f5 !important;
    border-color: #ccc !important;
    color: #333 !important;
}

.modal-footer button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* تحسينات PWA والجوال */
@media (max-width: 768px) {
    html, body {
        height: 100vh;
        width: 100vw;
        margin: 0;
        padding: 0;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        position: fixed;
        top: 0;
        left: 0;
    }
    
    #appContainer {
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* تحسين الأزرار للمس */
    button, .btn, a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* إخفاء شريط التمرير في WebView */
::-webkit-scrollbar {
    display: none;
}

/* دعم الشاشات ذات النتوء (Notch) */
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* ======================== شاشة الدفع ======================== */

.checkout-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 15px;
}

/* تصميم بطاقات المنتجات في الدفع لتكون نحيفة جداً */
.checkout-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 10px;
    gap: 15px;
}

.checkout-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.checkout-item-info {
    flex: 1;
}

.checkout-item-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    display: block;
}

.checkout-item-price {
    color: var(--gray-color);
    font-size: 13px;
}

.checkout-item-qty-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.checkout-item-qty-btn {
    background: #f8f8f8;
    border: none;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
}

.checkout-item-qty-val {
    width: 30px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

/* ملخص الفاتورة الجديد */
.checkout-summary {
    background: #fdfdfd;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #eee;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.summary-row.total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-color);
}

.submit-order-btn-container {
    margin-top: 20px;
}

.btn-confirm-order {
    width: 100%;
    background: #2ecc71;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.2);
}

.btn-confirm-order .price-tag {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.checkout-form {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.form-section {
    margin-bottom: 25px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3 i {
    color: var(--secondary-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.form-group small {
    color: #999;
    font-weight: 400;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(201, 162, 77, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 70px;
}

.bank-info-card {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    margin-bottom: 15px;
}

.bank-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.bank-row:last-child {
    border-bottom: none;
}

.bank-row span {
    color: #666;
    font-weight: 500;
}

.bank-row strong {
    color: var(--primary-color);
    font-weight: 700;
}

.receipt-upload-wrapper {
    width: 100%;
}

.receipt-upload-container {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fdfdfd;
    display: block;
    position: relative;
    overflow: hidden;
}

.receipt-upload-container:active {
    transform: scale(0.98);
    background: #f0f0f0;
}

.receipt-upload-container:hover {
    border-color: var(--secondary-color);
    background: #fafafa;
}

.receipt-upload-container i {
    font-size: 35px;
    color: var(--secondary-color);
    margin-bottom: 12px;
    display: block;
}

.receipt-upload-container h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.receipt-upload-container p {
    font-size: 12px;
    color: #999;
}

.checkout-summary {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
}

@media (max-width: 768px) {
    .checkout-summary {
        position: static;
    }
}

.checkout-summary h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.checkout-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-color);
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 8px 0;
    color: #666;
}

.summary-divider {
    height: 1px;
    background: var(--light-color);
    margin: 15px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 10px 0;
    color: #666;
}

.summary-row.total {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
    padding-top: 12px;
    border-top: 2px solid var(--light-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #444 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #555;
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--light-color);
}

.status-pending { background: #fff3cd; color: #856404; }
.status-paid { background: #e3f2fd; color: #0d47a1; }
.status-processing { background: #cce5ff; color: #004085; }
.status-shipped { background: #e1f5fe; color: #01579b; }
.status-delivered { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }

.cancelled-order {
    opacity: 0.8;
    border-right: 4px solid var(--danger-color) !important;
}

.cancelled-message {
    background: #fff5f5;
    color: var(--danger-color);
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* تحسين بطاقات السلة - التصميم الجديد المدمج */
.cart-item-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    position: relative;
}

.cart-item-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.cart-item-image-compact {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
    flex-shrink: 0;
}

.cart-item-image-compact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-title-compact {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.cart-item-price-compact {
    font-size: 13px;
    color: var(--secondary-color);
    font-weight: 600;
    margin: 0;
}

.cart-item-left {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.quantity-controls-compact {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.qty-btn-compact {
    width: 28px;
    height: 28px;
    border: none;
    background: #fff;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.qty-btn-compact:hover {
    background: #f5f5f5;
}

.qty-val-compact {
    width: 30px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.cart-item-total-compact {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
}

.remove-item-btn-compact {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 22px;
    height: 22px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1;
}

/* ============== أنماط التعليقات والآراء المحسّنة ============== */

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.review-item:hover {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #ddd;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.review-author {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.review-rating {
    display: flex;
    gap: 2px;
    color: #f39c12;
    font-size: 14px;
}

.review-date {
    font-size: 12px;
    color: #999;
}

.review-text {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.review-image {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    margin-top: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.review-image:hover {
    transform: scale(1.05);
}

.review-form {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 20px;
}

.review-form h4 {
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 15px;
}

.rating-input {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
}

.rating-input i {
    transition: all 0.2s ease;
}

.rating-input i:hover,
.rating-input i.active {
    color: #f39c12;
    transform: scale(1.1);
}

#reviewComment {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    resize: vertical;
}

#reviewComment:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(85, 85, 85, 0.1);
}

.review-image-upload {
    margin: 12px 0;
}

.review-image-upload label {
    cursor: pointer;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.review-image-upload label:hover {
    color: var(--primary-color);
}

.submit-review-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.submit-review-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.submit-review-btn:active {
    transform: translateY(0);
}

.product-reviews-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.product-reviews-section h3 {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.add-review-btn {
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid var(--secondary-color);
    background: white;
    color: var(--secondary-color);
    font-weight: 600;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    transition: all 0.3s ease;
}

.add-review-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.product-rating-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    font-size: 14px;
}

.product-rating-summary .stars {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #f39c12;
}

.rating-count {
    color: #999;
    font-size: 13px;
}

/* استجابة الجوال */
@media (max-width: 768px) {
    .review-item {
        padding: 12px;
    }
    
    .review-image {
        max-width: 120px;
        max-height: 120px;
    }
    
    .review-form {
        padding: 12px;
    }
}


/* ======================== تحسينات متقدمة للمنتجات والواجهة ======================== */

/* تأثير الظهور التدريجي للمنتجات */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تأثير التحميل الهيكلي (Skeleton Loading) */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
}

/* تحسين بطاقة المنتج */
.product-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: white;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-color: var(--secondary-color);
}

/* تحسين صورة المنتج */
.product-image {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    cursor: pointer;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

/* تأثير الصورة عند الضغط */
.product-image:active img {
    transform: scale(0.98);
}

/* تحسين الشارات (Badges) */
.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.badge.new {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.badge.sale {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.badge.best {
    background: linear-gradient(135deg, #555555, #333333);
}

/* تحسين معلومات المنتج */
.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-info h3 {
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-category-tag {
    font-size: 11px;
    color: var(--secondary-color);
    background: rgba(85, 85, 85, 0.08);
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    display: inline-block;
    font-weight: 600;
}

/* تحسين السعر */
.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--secondary-color);
}

.original-price {
    font-size: 12px;
    color: var(--gray-color);
    text-decoration: line-through;
}

/* تحسين أزرار الإجراءات */
.product-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    align-items: center;
    justify-content: center;
}

.add-to-cart-btn {
    flex: 1;
    padding: 10px 12px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: #444444;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(85, 85, 85, 0.3);
}

.add-to-cart-btn:active:not(:disabled) {
    background: var(--button-press-color) !important;
    transform: scale(0.95) !important;
}

.add-to-cart-btn:disabled {
    background: var(--gray-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.favorite-btn {
    background: transparent;
    color: var(--gray-color);
    border: none;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.favorite-btn.active {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.15);
}

.favorite-btn:active {
    transform: scale(0.9);
}

/* حالة نفد المخزون */
.product-card.out-of-stock {
    opacity: 0.8;
}

.out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    z-index: 1;
    border-radius: 8px;
}

/* ======================== تحسينات الأقسام ======================== */

.categories-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 15px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.categories-container::-webkit-scrollbar {
    height: 4px;
}

.categories-container::-webkit-scrollbar-track {
    background: transparent;
}

.categories-container::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 2px;
}

.category-btn {
    padding: 10px 16px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--primary-color);
}

.category-btn:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: rgba(85, 85, 85, 0.05);
}

.category-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(85, 85, 85, 0.3);
}

/* ======================== زر تحميل المزيد ======================== */

#loadMoreProductsBtn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 30px auto;
    padding: 14px 28px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
}

#loadMoreProductsBtn:hover:not(:disabled) {
    background: #444444;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(85, 85, 85, 0.3);
}

#loadMoreProductsBtn:active:not(:disabled) {
    background: var(--button-press-color) !important;
    transform: scale(0.95) !important;
}

#loadMoreProductsBtn:disabled {
    background: var(--gray-color);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ======================== شبكة المنتجات ======================== */

#productsGrid, #homeProductsGrid, #favoritesGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    width: 100%;
}

/* تحسين الاستجابة */
@media (max-width: 768px) {
    #productsGrid, #homeProductsGrid, #favoritesGrid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-info h3 {
        font-size: 13px;
    }
    
    .current-price {
        font-size: 14px;
    }
    
    .add-to-cart-btn {
        font-size: 12px;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    #productsGrid, #homeProductsGrid, #favoritesGrid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .badge {
        top: 8px;
        right: 8px;
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .product-info h3 {
        font-size: 12px;
    }
    
    .current-price {
        font-size: 13px;
    }
}

/* ======================== تحسينات الجوال ======================== */

@media (hover: none) and (pointer: coarse) {
    .product-card:hover {
        transform: none;
    }
    
    .add-to-cart-btn:hover {
        transform: none;
    }
    
    #loadMoreProductsBtn:hover {
        transform: none;
    }
}


/* ======================== نافذة معاينة الصور ======================== */

.image-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-viewer-modal.active {
    opacity: 1;
    visibility: visible;
}

.image-viewer-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-viewer-content {
    position: relative;
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.image-viewer-content img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

.image-viewer-info {
    padding: 15px;
    background: white;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.image-viewer-info p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.close-viewer {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-viewer:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.prev-image, .next-image {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.prev-image:hover, .next-image:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.prev-image {
    right: -60px;
}

.next-image {
    left: -60px;
}

/* تحسين الاستجابة لمعاينة الصور */
@media (max-width: 768px) {
    .image-viewer-container {
        width: 95%;
    }
    
    .image-viewer-content img {
        max-height: 70vh;
    }
    
    .prev-image, .next-image {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .prev-image {
        right: -50px;
    }
    
    .next-image {
        left: -50px;
    }
    
    .close-viewer {
        top: -35px;
        font-size: 24px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .image-viewer-container {
        width: 100%;
    }
    
    .image-viewer-content img {
        max-height: 60vh;
    }
    
    .prev-image, .next-image {
        display: none;
    }
    
    .close-viewer {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.5);
    }
}

/* ======================== تحسينات إضافية ======================== */

/* تأثير الظهور للعناصر */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* تحسين الاستجابة العامة */
@media (max-width: 768px) {
    .product-card {
        border-radius: 10px;
    }
    
    .badge {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .add-to-cart-btn {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .product-card {
        border-radius: 8px;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .add-to-cart-btn {
        font-size: 11px;
        padding: 8px 10px;
    }
    
    .favorite-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* دعم الوضع الليلي (للمستقبل) */
@media (prefers-color-scheme: dark) {
    .image-viewer-content {
        background: #222;
    }
    
    .image-viewer-info {
        background: #222;
        border-top-color: #444;
    }
    
    .image-viewer-info p {
        color: #eee;
    }
}

/* شريط التنقل السفلي (Bottom Navigation) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    border-top: 1px solid #eee;
    height: 65px; /* تحديد ارتفاع ثابت */
}

/* إضافة مساحة سفلية للمحتوى الرئيسي لمنع التداخل مع الشريط السفلي */
@media (max-width: 767px) {
    .main-content {
        padding-bottom: 80px !important; /* مساحة كافية فوق الشريط السفلي */
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #888;
    font-size: 12px;
    position: relative;
    flex: 1;
    transition: all 0.3s ease;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item .cart-count {
    position: absolute;
    top: -5px;
    right: 20%;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
    .footer {
        padding-bottom: 20px !important;
    }
}
