/* =================================
   1. المتغيرات والأساسيات (Variables & Base)
   ================================= */
:root {
    --color-primary: #121212;         /* خلفية داكنة جداً (رئيسي) */
    --color-secondary: #e0e0e0;       /* لون النص الفاتح (ثانوي) */
    --color-surface: #1e1e1e;       /* خلفية البطاقات والأقسام (أفتح من الرئيسي) */
    --color-border: #333333;        /* لون الحدود الخافت */
    
    --color-gold: #d4af37;
    --color-gold-light: #f4e4bc;
    --color-gold-dark: #b8941f;
    
    --color-text: #e0e0e0;           /* لون النص الأساسي */
    --color-text-light: #9a9a9a;      /* لون النص الثانوي (أخفت) */
    
    --color-bg: #121212;
    --color-bg-dark: #101010;
    
    --shadow-sm: 0 4px 15px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.4);
    --shadow-lg: 0 15px 50px rgba(0,0,0,0.5);
    
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Tajawal', sans-serif; /* الخط الجديد */
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

/* خلفية متحركة (معدلة للوضع الداكن) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* =================================
   2. شاشة التحميل (Loader)
   ================================= */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg); /* استخدام الخلفية الداكنة */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    font-weight: 800;
    color: var(--color-secondary); /* لون النص الفاتح */
    letter-spacing: 8px;
    margin-bottom: 2rem;
    animation: logoGlow 2s ease-in-out infinite;
}

.loader-logo span {
    color: var(--color-gold);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}

@keyframes logoGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(212, 175, 55, 0.3); }
    50% { text-shadow: 0 0 40px rgba(212, 175, 55, 0.6); }
}

.luxury-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1); /* تعديل الشفافية */
    border-top: 3px solid var(--color-gold);
    border-radius: 50%;
    animation: luxurySpinAnimation 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes luxurySpinAnimation {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* =================================
   3. الهيدر (Header)
   ================================= */
header {
    background: var(--color-surface); /* استخدام خلفية السطح */
    color: var(--color-secondary);
    padding: 2.5rem 0 2rem; /* تقليل الحشو */
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3); /* ظل مناسب للداكن */
    border-bottom: 1px solid var(--color-border);
}

/* إزالة الوهج الكبير، الاعتماد على الظل والحدود */
header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 40%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.04) 0%, transparent 70%);
    animation: headerGlow 8s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    50% { transform: translate(-20px, 20px) scale(1.1); opacity: 0.7; }
}

.logo-container {
    position: relative;
    z-index: 2;
    text-align: center;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: 12px;
    margin: 0;
    text-transform: uppercase;
    color: var(--color-secondary); /* لون نص فاتح */
    /* إزالة الخلفية المتدرجة للنص */
    position: relative;
    display: inline-block;
}

.logo span {
    color: var(--color-gold);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
    display: inline-block;
    animation: luxeFloat 3s ease-in-out infinite;
}

.logo .luxe-red {
    color: #dc3545;
    text-shadow: 0 0 30px rgba(220, 53, 69, 0.5);
}

@keyframes luxeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo-icon {
    position: absolute;
    top: -15px;
    right: -30px;
    font-size: 1.5rem;
    color: var(--color-gold);
    animation: iconRotate 4s linear infinite;
}

@keyframes iconRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tagline {
    font-family: 'Tajawal', sans-serif; /* الخط الجديد */
    font-size: 1.2rem;
    font-weight: 300; /* وزن أخف */
    font-style: italic; /* لمسة أنيقة */
    color: var(--color-gold-light);
    margin-top: 1rem;
    letter-spacing: 3px;
    opacity: 0.9;
}

/* =================================
   4. شريط الأقسام (Categories Nav)
   ================================= */
#categories-nav {
    background: rgba(30, 30, 30, 0.95); /* خلفية السطح مع شفافية */
    backdrop-filter: blur(10px);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    border-bottom: 2px solid var(--color-gold);
}

/* Search Bar Styles */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-wrapper {
    position: relative;
    max-width: 500px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--color-border);
    border-radius: 50px;
    color: var(--color-text);
    outline: none;
    transition: var(--transition);
    text-align: right;
}

.search-input::placeholder {
    color: var(--color-text-light);
    font-weight: 400;
}

.search-input:focus {
    border-color: var(--color-gold);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.15);
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    font-size: 1.1rem;
    pointer-events: none;
    transition: var(--transition);
}

.search-input:focus + .search-icon {
    color: var(--color-gold);
}

.clear-search-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50%;
    transition: var(--transition);
}

.clear-search-btn:hover {
    color: var(--color-gold);
    background: rgba(212, 175, 55, 0.1);
}

.category-btn {
    font-family: 'Tajawal', sans-serif; /* الخط الجديد */
    font-size: 1rem;
    font-weight: 600;
    padding: 0.8rem 2rem;
    margin: 0.3rem;
    border: 2px solid var(--color-border); /* لون الحد الخافت */
    background: transparent; /* خلفية شفافة */
    color: var(--color-text-light); /* لون نص خافت */
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-transform: capitalize;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    z-index: 0;
}

.category-btn span {
    position: relative;
    z-index: 1;
}

.category-btn:hover {
    border-color: var(--color-gold);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.2); /* ظل أخف */
}

.category-btn:hover::before {
    width: 300px;
    height: 300px;
}

.category-btn:hover span {
    color: var(--color-primary); /* نص داكن عند التمرير فوق الذهبي */
}

.category-btn.active {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: var(--color-primary); /* نص داكن عند الاختيار */
    border-color: var(--color-gold-dark);
    box-shadow: 0 5px 25px rgba(212, 175, 55, 0.3); /* ظل أخف */
    transform: translateY(-2px);
}

.category-btn.active::before {
    width: 300px;
    height: 300px;
}

/* =================================
   5. قسم المنتجات (Products)
   ================================= */
#products {
    padding: 4rem 0;
    position: relative;
    z-index: 1;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--color-secondary); /* لون نص فاتح */
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

/* بطاقة المنتج (مُعاد تصميمها) */
.product-card {
    background: var(--color-surface); /* خلفية السطح */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    height: 100%;
    border: 1px solid var(--color-border); /* حد خافت */
}

/* إزالة الوهج عند التمرير، الاعتماد على الظل والحد */
.product-card:hover {
    transform: translateY(-12px) scale(1.02); /* تأثير رفع أنعم */
    box-shadow: var(--shadow-lg);
    border-color: var(--color-gold); /* إبراز الحد بالذهبي */
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 350px;
    background: var(--color-bg-dark);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:hover .product-image {
    transform: scale(1.1); /* تأثير تقريب أنعم (بدون دوران) */
}

.product-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: var(--color-primary); /* نص داكن */
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    z-index: 2;
}

.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    transition: height 0.4s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem;
    z-index: 2;
}

.product-card:hover .product-overlay {
    height: 100%;
}

.quick-view-btn {
    background: var(--color-gold);
    color: var(--color-primary); /* نص داكن */
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateY(20px);
}

.product-card:hover .quick-view-btn {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.quick-view-btn:hover {
    background: var(--color-secondary); /* خلفية فاتحة عند التمرير */
    color: var(--color-gold); /* نص ذهبي */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.product-info {
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.product-category {
    font-size: 0.85rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.product-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-secondary); /* نص فاتح */
    margin-bottom: 1rem;
    line-height: 1.4;
}

.product-price-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.product-price {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.currency {
    font-size: 1rem;
    color: var(--color-text-light);
    font-weight: 600;
}

.product-rating {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.product-rating i {
    color: var(--color-gold);
    font-size: 0.9rem;
}

/* زر "أضف للسلة" (مُعاد تصميمه) */
.add-to-cart-btn {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: var(--color-primary); /* نص داكن */
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* إزالة تأثير التعبئة، استخدام تغيير لون بسيط وظل */
.add-to-cart-btn:hover {
    background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

/* =================================
   6. الفوتر (Footer)
   ================================= */
footer {
    background: var(--color-surface); /* خلفية السطح */
    color: var(--color-secondary);
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

.footer-content {
    text-align: center;
}

.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 8px;
    margin-bottom: 1rem;
    color: var(--color-secondary);
}

.footer-logo span {
    color: var(--color-gold);
}

.footer-tagline {
    font-family: 'Tajawal', sans-serif; /* الخط الجديد */
    font-weight: 300;
    font-style: italic;
    font-size: 1rem;
    color: var(--color-gold-light);
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05); /* خلفية خافتة */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary);
    font-size: 1.2rem;
    transition: var(--transition);
    border: 2px solid var(--color-border); /* حد خافت */
}

.social-link:hover {
    background: var(--color-gold);
    color: var(--color-primary); /* نص داكن */
    border-color: var(--color-gold);
    transform: translateY(-5px) rotate(360deg);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3); /* ظل أخف */
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border); /* حد خافت */
    text-align: center;
    color: rgba(255, 255, 255, 0.5); /* نص شفاف */
    font-size: 0.9rem;
}

/* =================================
   7. أنيميشن (Animation)
   ================================= */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
}

/* =================================
   8. الاستجابة (Responsive)
   ================================= */
@media (max-width: 992px) {
    .product-image-wrapper {
        height: 300px; /* تقليل ارتفاع الصورة للأجهزة اللوحية */
    }
    .product-name {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 3rem; /* تصغير الشعار */
        letter-spacing: 6px;
    }
    .loader-logo {
        font-size: 3rem;
    }
    .section-title {
        font-size: 2.2rem;
    }
    .product-image-wrapper {
        height: 250px; /* تقليل ارتفاع الصورة للجوال */
    }
    .category-btn {
        padding: 0.7rem 1.4rem;
        font-size: 0.9rem;
        margin: 0.2rem; /* تقليل الهوامش */
    }
    #categories-container {
        justify-content: center !important;
    }
}

@media (max-width: 576px) {
    .logo {
        font-size: 2.5rem; /* تصغير إضافي */
        letter-spacing: 4px;
    }
    .tagline {
        font-size: 1rem;
        letter-spacing: 2px;
    }
    .product-info {
        padding: 1.5rem; /* تقليل الحشو الداخلي للبطاقة */
    }
    .add-to-cart-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    .footer-logo {
        font-size: 2rem;
    }
    .social-link {
        width: 45px;
        height: 45px;
    }
}

/* تحسين الأداء */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== ANNOUNCEMENT TICKER STYLES ==================== */
#announcement-ticker {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    font-family: 'Tajawal', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.8rem 0;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3);
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-item {
    position: absolute;
    width: 100%;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s;
    line-height: 1.4;
    padding: 0 1rem;
}

.announcement-item.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive adjustments for ticker */
@media (max-width: 768px) {
    #announcement-ticker {
        font-size: 0.9rem;
        padding: 0.6rem 0;
        min-height: 2.5rem;
    }
}

@media (max-width: 576px) {
    #announcement-ticker {
        font-size: 0.8rem;
        padding: 0.5rem 0;
        min-height: 2rem;
    }
    
    .announcement-item {
        padding: 0 0.5rem;
    }
}
.free-delivery-banner {
    color: #d32f2f;
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1.4;
    margin-top: 6px;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 0 rgba(0,0,0,0.25);
    display: block;
}

@media (max-width: 576px) {
    .free-delivery-banner {
        font-size: 1.2rem;
    }
}