/* Professional Arabic font for all elements */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&display=swap');
body {
    font-family: 'Cairo', sans-serif;
    /* تحديد لون خلفية البيج */
    background-color: #e6ebb6; 
}

/* --- N.V CAFE Brand Identity Colors (Changed Green to Black/Dark Neutral) --- */
.color-primary {
    background-color: #171717; /* Dark Black */
}
.text-primary {
    color: #171717;
}
.bg-accent {
    background-color: #d7600a; /* Amber/Accent */
}
.text-accent {
    color: #f97316;
}

/* --- Logo Welcome Animation (More dramatic) --- */
.welcome-animation {
    animation: bounce-in 2.5s ease-out forwards;
}
@keyframes bounce-in {
    0% { transform: scale(0.1) rotate(0deg); opacity: 0; }
    40% { transform: scale(1.2) rotate(30deg); opacity: 1; }
    70% { transform: scale(0.95) rotate(-10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Product Card Hover and Fade-in Animation */
.product-card {
    transition: all 0.3s ease-in-out;
    animation: fadeIn 0.5s ease-out;
}
.product-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 15px 25px rgba(46, 119, 187, 0.2); /* Shadow based on new primary color */
}
/* Fade-in Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Category Icons Animation (Glow and Scale) */
.category-btn .icon-container {
    transition: all 0.3s ease-in-out;
}
.category-btn.active .icon-container {
    border: 3px solid #f97316;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.8); /* Stronger glow */
    transform: scale(1.15);
}
.category-btn:hover .icon-container:not(.active) {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
}

/* Social Icons Animation */
.social-link {
    transition: transform 0.2s ease-in-out;
}
.social-link:hover {
    transform: translateY(-3px);
    color: #f97316; /* Accent color on hover */
}

/* Tooltip style for Social Icons */
.tooltip-container { position: relative; display: inline-block; }
.tooltip { visibility: hidden; background-color: #171717; color: #fff; text-align: center; border-radius: 6px; padding: 5px 8px; position: absolute; z-index: 10; bottom: 125%; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.3s; white-space: nowrap; font-size: 12px; }
.tooltip-container:hover .tooltip { visibility: visible; opacity: 1; }

/* Modal Styles */
.modal { display: none; }
#modal-content-wrapper::-webkit-scrollbar, #allergen-modal-content-wrapper::-webkit-scrollbar { width: 8px; }
#modal-content-wrapper::-webkit-scrollbar-thumb, #allergen-modal-content-wrapper::-webkit-scrollbar-thumb { background: #171717; border-radius: 10px; } /* Updated scrollbar color */
#modal-content-wrapper::-webkit-scrollbar-track, #allergen-modal-content-wrapper::-webkit-scrollbar-track { background: #f1f1f1; }

/* Language Toggle Styles */
.language-toggle-group {
    display: flex; border-radius: 9999px; overflow: hidden;
    border: 2px solid #171717; /* Updated border color */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.lang-btn {
    padding: 0.5rem 1rem; font-weight: 700; font-size: 0.875rem;
    transition: all 0.3s ease; cursor: pointer;
}
.lang-btn.active { background-color: #171717; color: white; } /* Updated active color */
.lang-btn:not(.active) { background-color: white; color: #171717; } /* Updated inactive color */

/* Allergen Icons */
.allergen-icon {
    width: 32px; height: 32px; background-color: #f0fdf4;
    color: #15803d; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
/* Enhanced Allergen Icon for Footer Modal */
.allergen-icon-full {
    width: 50px; /* Bigger icon */
    height: 50px;
    background-color: #e86100; /* Accent color */
    color: white; 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px; /* Larger icon size */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6); /* Strong shadow */
}

/* New Footer Layout Styles */
.footer-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}
.footer-logo {
     width: 60px;
     height: 60px;
     padding: 5px;
     border-radius: 50%;
     background-color: white;
}
.footer-logo span {
     font-size: 30px;
     font-weight: 900;
     color: #171717; /* Logo text color */
}
/* Price Display Adjustment in Product Card for Mobile */
.product-price-container {
    white-space: nowrap; /* Prevent price from wrapping */
    text-align: center;
}
/* Style for the 'R.S' part of the price in the card */
.price-currency {
    font-size: 14px; /* Smaller font for currency */
    font-weight: 700;
    color: #f97316; /* Accent color for currency */
    display: block; 
}
/* Style for the numerical price part */
.price-value {
    font-size: 20px; /* Larger font for value */
    font-weight: 900;
    color: #171717; /* Updated price value color */
    display: block;
    margin-top: -5px; /* Adjust spacing between value and currency */
}

/* --- تعديل شريط الأقسام المطور للموبايل --- */
nav > .flex {
    /* السماح بالتمرير الأفقي ومنع التفاف العناصر */
    display: flex;
    flex-wrap: nowrap; 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
    
    /* إضافة مساحة جانبية (Padding) تمنع التصاق أول عنصر بالحافة */
    padding-right: 20px;
    padding-left: 20px;
    
    /* حشو علوي وسفلي لمنع قص الظلال (Glow) */
    padding-top: 15px; 
    padding-bottom: 20px; 

    /* ضمان توزيع العناصر بمسافات متساوية */
    gap: 25px; 
    
    /* لإزالة أي إزاحة غير مرغوبة */
    margin: 0 auto;
    justify-content: flex-start; /* يبدأ من اليمين في العربي */
}

/* تحسين شكل أزرار الأقسام لضمان عدم انضغاطها */
.category-btn {
    flex: 0 0 auto; /* منع تصغير حجم الزر */
    min-width: 80px; /* ضمان عرض أدنى للزر */
}

/* إخفاء شريط التمرير (Scrollbar) تماماً */
nav > .flex::-webkit-scrollbar {
    display: none;
}
nav > .flex {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* لمسة احترافية: إضافة تلاشي بسيط عند الأطراف ليعرف المستخدم أن هناك المزيد */
nav {
    position: relative;
}
nav::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, #f5f5dc, transparent);
    pointer-events: none;
    z-index: 5;
}
/* حاوية الزينة الرمضانية */
.ramadan-decor-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px; /* مساحة كافية للفوانيس الطويلة */
    pointer-events: none;
    z-index: 1000;
}

/* تغليف الفانوس والخيط */
.lantern-wrapper {
    position: absolute;
    top: -10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: top center;
    animation: luxury-sway 5s ease-in-out infinite;
}

/* الخيط الذهبي النحيف */
.lantern-line {
    width: 1.5px;
    background: linear-gradient(to bottom, #d7600a, #f97316);
    box-shadow: 0 0 5px rgba(215, 96, 10, 0.4);
}

/* جسم الفانوس المطور */
.lantern-body {
    width: 45px;
    height: 65px;
    margin-top: -2px;
    filter: drop-shadow(0 0 12px rgba(215, 96, 10, 0.7)); /* توهج قوي وفخم */
    transition: filter 0.3s ease;
}

/* حركة التأرجح "الفخمة" بطيئة ومنتظمة */
@keyframes luxury-sway {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

/* تأثير الإضاءة الخفيفة المنعكسة على أعلى الشاشة */
.ramadan-decor-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: radial-gradient(50% 100% at 50% 0%, rgba(215, 96, 10, 0.15), transparent);
}
@keyframes snowflakes-fall {
    0% { top: -10%; }
    100% { top: 100%; }
}

@keyframes snowflakes-shake {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(80px); }
}
/* تصميم احترافي لحالة نفاذ الكمية */
.product-card.is-sold-out { filter: grayscale(0.7); opacity: 0.8; pointer-events: none; }
.sold-out-overlay { background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sold-out-badge { 
    background: #171717; color: #fff; padding: 6px 18px; border-radius: 50px; 
    border: 2px solid #d7600a; font-weight: 900; font-size: 11px; 
    transform: rotate(-5deg); box-shadow: 0 8px 20px rgba(0,0,0,0.4); 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
/* تنسيق ملصق "جديد" */
.bg-accent {
    background-color: #d7600a; /* لون الهوية البرتقالي */
}

/* حركة نبض خفيفة للمنتج الجديد لفت الانتباه */
.product-card .bg-accent {
    animation: pulse-new 2s infinite;
}

@keyframes pulse-new {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
/* --- تصميم الكارت الجديد الاحترافي --- */
.product-card-modern {
    display: flex;
    background-color: #ffffff;
    border-radius: 20px; /* حواف دائرية ناعمة */
    padding: 12px;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); /* ظل ناعم جداً */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    align-items: center; /* محاذاة العناصر في المنتصف عمودياً */
}

.product-card-modern:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 15px 35px rgba(215, 96, 10, 0.15); /* ظل برتقالي خفيف عند التحويم */
    border-color: rgba(215, 96, 10, 0.2);
}

/* الصورة */
.card-image-wrapper {
    flex-shrink: 0;
    width: 95px;
    height: 95px;
    border-radius: 16px;
    overflow: hidden;
    margin-left: 15px; /* مسافة لليسار في النسخة العربية */
}
/* عكس الاتجاه للغة الإنجليزية */
html[dir="ltr"] .card-image-wrapper {
    margin-left: 0;
    margin-right: 15px;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card-modern:hover .card-image-wrapper img {
    transform: scale(1.1); /* تكبير الصورة قليلاً عند التحويم */
}

/* تفاصيل البطاقة */
.card-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* لمنع النص من الخروج */
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #171717;
    margin: 0;
    line-height: 1.3;
}

.card-calories {
    font-size: 0.7rem;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.card-description {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 12px;
    line-height: 1.4;
    
    /* الإعدادات لقص النص */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* للمتصفحات الحالية */
    line-clamp: 2;         /* أضفنا هذا السطر لإسكات التحذير */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* الجزء السفلي (السعر والزر) */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-pill {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: #d7600a; /* لون الهوية */
}

.price-pill .curr {
    font-size: 0.8rem;
    font-weight: 600;
}

.price-pill .val {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.add-icon {
    width: 32px;
    height: 32px;
    background-color: #171717;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.product-card-modern:hover .add-icon {
    background-color: #d7600a; /* يتغير للون البرتقالي عند التحويم */
    transform: rotate(90deg); /* حركة دورانية جمالية */
}

/* بادج الجديد */
.badge-new {
    position: absolute;
    top: 10px;
    right: 10px; /* لليسار في الإنجليزي */
    background: #d7600a;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 20px;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(215, 96, 10, 0.4);
}
html[dir="ltr"] .badge-new {
    right: auto;
    left: 10px;
}

/* حالة نفاذ الكمية */
.product-card-modern.is-sold-out {
    opacity: 0.6;
    filter: grayscale(100%);
    pointer-events: none;
}
.overlay-sold-out {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.4);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.overlay-sold-out span {
    background: #000;
    color: #fff;
    padding: 5px 15px;
    border-radius: 8px;
    font-weight: bold;
    transform: rotate(-10deg);
}
/* --- تصميم ودجت المساعد الذكي الاحترافي (ألوان الهوية) --- */
:root {
    --theme-orange: #d7600a; /* لون الهوية الرئيسي */
    --theme-dark: #171717;   /* لون النصوص الغامق */
}

#wa-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Cairo', sans-serif;
}

/* الزر العائم الجديد */
.wa-float-btn {
    width: 65px;
    height: 65px;
    background: var(--theme-orange); /* استخدام لون الهوية البرتقالي */
    color: white;
    border-radius: 50%;
    border: none;
    box-shadow: 0 8px 20px rgba(215, 96, 10, 0.4); /* ظل برتقالي */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.wa-float-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 25px rgba(215, 96, 10, 0.5);
}

/* صندوق الدردشة */
#wa-chat-box {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 340px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0,0,0,0.05);
}

#wa-chat-box.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* رأس الصندوق */
.wa-header {
    background: var(--theme-orange); /* خلفية برتقالية */
    background: linear-gradient(135deg, var(--theme-orange), #f58220); /* تدرج لوني فخم */
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wa-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.3);
}

.wa-header-info h3 { margin: 0; font-size: 18px; font-weight: 800; }
.wa-header-info { font-size: 13px; opacity: 0.95; }
.status-dot { display: inline-block; width: 8px; height: 8px; background: white; border-radius: 50%; margin-left: 4px; box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }

.wa-close-btn { margin-right: auto; background: rgba(255,255,255,0.1); border-radius: 50%; width: 32px; height: 32px; display:flex; align-items:center; justify-content:center; border: none; color: white; cursor: pointer; transition: background 0.3s; }
.wa-close-btn:hover { background: rgba(255,255,255,0.3); }

/* جسم المحادثة */
.wa-body {
    height: 280px;
    background-color: #f9fafb; /* لون خلفية نظيف */
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* الرسالة */
.msg-bubble {
    background: white;
    padding: 12px 18px;
    border-radius: 4px 20px 20px 20px;
    max-width: 85%;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    animation: popIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: var(--theme-dark);
    font-weight: 600;
    border-left: 4px solid var(--theme-orange); /* خط برتقالي جمالي */
}
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* مؤشر الكتابة */
.typing-indicator {
    background: rgba(215, 96, 10, 0.1); /* خلفية برتقالية فاتحة جداً */
    padding: 12px 18px;
    border-radius: 20px;
    width: fit-content;
    display: flex;
    gap: 5px;
    align-items: center;
}
.typing-dot {
    width: 8px; height: 8px; background: var(--theme-orange); /* نقاط برتقالية */
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing { 0%, 80%, 100% { transform: scale(0); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

/* ذيل الرسالة (Footer) */
.wa-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    align-items: center;
}
#wa-input-msg {
    flex: 1;
    border: 2px solid #f3f4f6;
    border-radius: 12px;
    padding: 12px 15px;
    outline: none;
    transition: border-color 0.3s;
    font-family: 'Cairo', sans-serif;
}
#wa-input-msg:focus { border-color: var(--theme-orange); }

.wa-send-btn {
    background: var(--theme-orange); /* زر إرسال برتقالي */
    color: white;
    border: none;
    width: 45px; height: 45px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(215, 96, 10, 0.3);
}
.wa-send-btn:hover { background: #bc5308; transform: scale(1.05); }

/* تأثير النبض للزر العائم */
.wa-pulse {
    position: absolute; width: 100%; height: 100%;
    border-radius: 50%; border: 2px solid var(--theme-orange); /* نبض برتقالي */
    animation: pulse-ring 2s infinite;
    opacity: 0;
}
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.7); opacity: 0; }
}