/* تحسينات إضافية للواجهة */

/* تحسين الخطوط */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

/* تحسينات عامة */
* {
    scroll-behavior: smooth;
}

body {
    font-smoothing: antialiased;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* تحسينات الهيدر */
.header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.logo h1 {
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* تحسينات البحث */
.search-section {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.search-bar {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* تحسينات المنتجات */
.product-card {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.product-card:hover {
    border-color: rgba(139, 69, 19, 0.3);
}

/* تحسينات الأزرار */
.whatsapp-btn, .cart-btn, .add-to-cart-btn {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* تحسينات السلة */
.cart {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-overlay {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* تحسينات النوافذ المنبثقة */
.modal-content {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* تأثيرات التمرير */
.scroll-smooth {
    scroll-behavior: smooth;
}

/* تحسينات النص */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* تأثيرات الإضاءة */
.glow-effect {
    box-shadow: 0 0 20px rgba(139, 69, 19, 0.3);
}

.glow-effect:hover {
    box-shadow: 0 0 30px rgba(139, 69, 19, 0.5);
}

/* تأثيرات الحدود */
.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) 1;
}

/* تحسينات الاستجابة */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .logo h1 {
        font-size: 2.2rem;
    }
    
    .search-content h2 {
        font-size: 2.2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }
    
    .category-btn {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .search-content h2 {
        font-size: 1.8rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .whatsapp-btn, .cart-btn {
        font-size: 1rem;
        padding: 12px 20px;
    }
}

/* تحسينات الأداء */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* تأثيرات التحميل */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* تأثيرات النص المتحرك */
.marquee {
    white-space: nowrap;
    overflow: hidden;
    animation: marquee 20s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* تأثيرات التموج */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* تأثيرات الظلال المتحركة */
.floating-shadow {
    animation: floatingShadow 3s ease-in-out infinite;
}

@keyframes floatingShadow {
    0%, 100% {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    }
}

/* تأثيرات التدرج المتحرك */
.animated-gradient {
    background: linear-gradient(-45deg, #8B4513, #A0522D, #CD853F, #DEB887);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
}

/* تأثيرات النص المتوهج */
.text-glow-animated {
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from {
        text-shadow: 0 0 5px rgba(139, 69, 19, 0.5);
    }
    to {
        text-shadow: 0 0 20px rgba(139, 69, 19, 0.8);
    }
}

/* تحسينات الوصولية */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* تحسينات الطباعة */
@media print {
    .header, .search-section, .cart, .cart-overlay {
        display: none;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* تحسينات الوضع المظلم */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f8f9fa;
        --text-light: #adb5bd;
        --light-bg: #343a40;
    }
    
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .product-card {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* تحسينات الحركة المقللة */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
