/* 1. الإعدادات العامة والخطوط */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

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

:root {
    --brand-orange: #f28a36;
    --deep-black: #000000;
    --card-gray: #ffffff;
    --text-white: #ffffff;
    --status-green: #2ecc71;
    --status-red: #e74c3c;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    font-family: 'Cairo', sans-serif;
    background-color: var(--deep-black);
    color: var(--text-white);
    direction: rtl;
}

/* شريط العرض الثابت والمتحرك */
.promo-banner {
    background: linear-gradient(90deg, #f78a3e, #ff5722);
    color: white;
    padding: 10px 0;
    font-weight: bold;
    font-size: 1.1rem;
    
    /* هذي الأسطر الثلاثة هي السر في بقائه فوق دائماً */
    position: fixed; /* تم تغييره من sticky إلى fixed لضمان الثبات المطلق */
    top: 0;
    left: 0;
    width: 100%;
    
    z-index: 3000; /* رفع الرقم ليكون فوق الهيدر واللوجو */
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    overflow: hidden;
    white-space: nowrap;
}

/* إضافة مساحة في أعلى الصفحة لكي لا يغطي الشريط الشعار */
body {
    padding-top: 45px; /* نفس ارتفاع شريط العرض تقريباً */
}

/* حركة النص (نفس الكود السابق مع التأكد من سلاسته) */
.marquee-text {
    display: inline-block;
    animation: marquee-rtl 17s linear infinite;
}

@keyframes marquee-rtl {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* 3. الهيدر والشعار الرئيسي */
.main-header {
    background: linear-gradient(135deg, #f28a36 0%, #d46e1c 100%);
    padding: 40px 20px 80px 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(242, 138, 54, 0.3);
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.logo {
    width: 300px; 
    max-width: 85%;
    height: auto;
    display: block;
    margin: 0 auto;
    /* ظل أسود يعمل كإطار للشعار ليبرز فوق البرتقالي */
    filter: drop-shadow(2px 2px 0px #000) 
            drop-shadow(-2px -2px 0px #000) 
            drop-shadow(2px -2px 0px #000) 
            drop-shadow(-2px 2px 0px #000)
            drop-shadow(0px 10px 20px rgba(0,0,0,0.8));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7), -1px -1px 0px rgba(0,0,0,0.3);
}

/* 4. خانة البحث الاحترافية (أسود وبرتقالي) */
.search-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 15px; /* وضعها تحت العنوان مباشرة داخل الهيدر */
    padding: 0 20px;
    position: relative;
    z-index: 100;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-box input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    background: rgba(0, 0, 0, 0.9); /* أسود داكن */
    border: 2px solid var(--brand-orange); /* حدود برتقالية */
    border-radius: 50px;
    color: #ffffff;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    outline: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease-in-out;
    text-align: center;
}

.search-box input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(242, 138, 54, 0.6);
    transform: scale(1.02);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-style: normal;
    color: var(--brand-orange);
    font-size: 1.2rem;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* 5. شبكة البطاقات (Flavor Grid) */
#flavorGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    padding: 50px 20px 20px;
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--deep-black);
}

.flavor-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 250px;
    border: 1px solid transparent;
}

.flavor-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(242, 138, 54, 0.2);
    border: 1px solid var(--brand-orange);
}

.flavor-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 15px;
}

.flavor-label {
    font-size: 1.2rem;
    color: #333;
    font-weight: bold;
    margin-bottom: 10px;
}

.flavor-status {
    font-size: 0.85rem;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 600;
}

.available .flavor-status { background: #e8f5e9; color: var(--status-green); }
.unavailable .flavor-status { background: #ffebee; color: var(--status-red); }

.flavor-card.unavailable {
    filter: grayscale(1);
    opacity: 0.6;
}

/* 6. شاشة التحميل */
.loader-wrapper {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    z-index: 9999;
}

.loader-logo { width: 150px; animation: pulse 1.5s infinite ease-in-out; }
.loader-spinner {
    width: 50px; height: 50px;
    border: 5px solid #333;
    border-top: 5px solid var(--brand-orange);
    border-radius: 50%;
    margin-top: 20px;
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* 7. توافق الجوال */
@media (max-width: 600px) {
    .logo { width: 220px; }
    h1 { font-size: 1.3rem; }
    #flavorGrid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 20px 10px; }
    .flavor-card { padding: 10px; min-height: 200px; }
    .flavor-image { width: 90px; height: 90px; }
}

/* تنسيق أزرار اختيار الفرع */
.branch-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.branch-btn {
    padding: 10px 25px;
    border: 2px solid #fff;
    background: transparent;
    color: white;
    border-radius: 50px;
    font-family: 'Cairo', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.branch-btn.active {
    background: white;
    color: #f28a36; /* برتقالي الهوية */
}

.branch-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}


/* تنسيق نافذة اختيار الفرع */
.branch-modal {
    display: none; /* مخفية افتراضياً */
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid #f28a36;
    max-width: 400px;
    width: 90%;
}

.modal-logo {
    width: 120px;
    margin-bottom: 20px;
}

.modal-content h2 {
    color: #fff;
    margin-bottom: 10px;
}

.modal-content p {
    color: #ccc;
    margin-bottom: 30px;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-buttons button {
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: #f28a36;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.modal-buttons button:hover {
    background: #ff9f4d;
    transform: translateY(-3px);
}

.filter-options {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 50px;
    border: 1px solid rgba(242, 138, 54, 0.3);
}

.switch-container input {
    display: none;
}

.slider {
    width: 40px;
    height: 20px;
    background-color: #444;
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}

.slider:before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background-color: #27ae60; /* لون أخضر عند التفعيل */
}

input:checked + .slider:before {
    transform: translateX(20px);
}


/* تنسيق الزر الأساسي (ليشبه زر 'تعرف على المنتج' الأزرق أو البرتقالي) */
.open-btn {
    padding: 12px 25px;
    background-color: #f37021; /* يمكنك تغييره للبرتقالي #f37021 إذا فضلت */
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 50px; /* حواف دائرية كاملة مثل زر البحث */
    font-weight: bold;
    font-family: 'Cairo', sans-serif; /* تأكد من استخدام نفس خط الموقع */
    transition: 0.3s ease;
}

.open-btn:hover {
    transform: scale(1.05);
    background-color: #f37021;
}

/* الخلفية الشفافة */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* سواد أغمق ليعطي فخامة */
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* تغبيش إضافي للخلفية نفسها */
}

/* المربع التعريفي (التنسيق المتوافق مع الكروت بالأسفل) */
.popup-content {
    background: white;
    padding: 40px;
    border-radius: 20px; /* نفس انحناء كروت المنتجات */
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    border-top: 5px solid #f37021; /* خط برتقالي علوي ليميز الهوية */
}

.popup-content h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.popup-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* زر الإغلاق */
.close-btn {
    padding: 10px 30px;
    background: #333; /* لون أسود ليناسب شعار دكتور بروتين */
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.close-btn:hover {
    background: #f37021; /* يقلب برتقالي عند التمرير */
}

/* تأثير التغبيش للمحتوى الأساسي */
.blur-effect {
    filter: blur(10px);
    pointer-events: none; /* لمنع الضغط على أي شيء بالخلفية */
    user-select: none;
}


