:root {
    /* المظهر العام - افتراضي محايد لمنع الوميض البرتقالي */
    --primary-bg: #000000;
    --text-white: #ffffff;
    --accent-green: #1B4332;

    /* أزرار الهيدر والـ Bottom Sheet */
    --header-btn-bg: rgba(255, 255, 255, 0.1);
    --header-btn-text: #ffffff;

    /* بطاقات الأقسام */
    --cat-card-bg: transparent;
    --cat-card-text: #ffffff;
    --cat-img-bg: rgba(255, 255, 255, 0.05);

    /* بطاقات المنتجات */
    --prod-card-bg: #1a1a1a;
    --prod-name-color: #ffffff;
    --prod-price-color: #ffffff;
    --prod-border-color: rgba(255, 255, 255, 0.15);

    /* عناوين الأقسام */
    --section-title-color: #ffffff;
    --section-line-color: rgba(255, 255, 255, 0.2);

    /* الفوتر */
    --footer-bg: #000000;
    --footer-text: #ffffff;

    /* إعدادات القائمة السفلية (Bottom Sheet) */
    --sheet-bg: #000000;
    --sheet-text: #ffffff;
    --sheet-icon-bg: rgba(255, 255, 255, 0.05);
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    /* لمنع التمرير المزدوج والعرضي */
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--main-font, 'Tajawal', sans-serif);
    background-color: var(--primary-bg);
    color: var(--text-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    width: 100%;
    overflow: hidden;
    overflow-x: hidden;
    position: fixed;
    direction: inherit;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    /* يسمح فقط بالسكرول العمودي، يمنع السحب الجانبي للمتصفح */
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* إلغاء تأثير اللمس الأسود المزعج على الهواتف */
    font-family: inherit;
}

input,
button,
select,
textarea {
    font-family: var(--main-font, 'Tajawal', sans-serif);
}

/* Make the app container fill the screen */
#app {
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    overflow-x: hidden;
    position: relative;
    overscroll-behavior: contain;
    overscroll-behavior-x: none;
    background-color: var(--primary-bg);
}

/* Utility classes */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    /* حل مشكلة خروج التأثير عن الحواف في آيفون */
    transform: translateZ(0);
    /* تعزيز الأداء والعزل */
}

.icon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.15);
    /* تعبئة شفافة */
    transform: translateX(-50%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    opacity: 0;
}

.icon-btn:hover::before {
    width: 100%;
    opacity: 0.2;
}

.icon-btn.active::before {
    width: 100%;
    opacity: 1;
    background-color: var(--accent-green);
}

.icon-btn i {
    position: relative;
    z-index: 2;
}

/* Header */
header {
    display: flex;
    flex-direction: column;
    padding: 0;
    /* Remove general padding to allow full-width elements */
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--primary-bg);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 20px;
}

.header-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    padding: 0 20px 10px;
    /* Added horizontal and bottom padding */
    transition: all 0.3s ease;
}

/* تنسيق الهيدر عندما يحتوي على زر واحد فقط (عند إخفاء زر اللغة) */
.header-bottom.single-button {
    display: flex;
    justify-content: center;
    width: 100%;
}

.header-bottom.single-button .card-icon-btn {
    min-width: 150px;
    /* عرض مناسب للحفاظ على شكل الزر */
    /* يحافظ على نفس التصميم الأساسي من .card-icon-btn بدون أي تغييرات إضافية */
}

.card-icon-btn {
    background-color: var(--header-btn-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    height: 52px;
    width: 100%;
    color: var(--header-btn-text);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    /* حل مشكلة خروج التأثير عن الحواف في آيفون */
    transform: translateZ(0);
    /* تعزيز الأداء والعزل */
}

.card-icon-btn i {
    position: relative;
    z-index: 2;
    font-size: 1.3rem;
}

.card-icon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    /* تعبئة شفافة هادئة */
    transform: translateX(-50%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    opacity: 0;
}

.card-icon-btn:hover::before {
    width: 100%;
    /* ملء كامل عند الحوم */
    opacity: 0.3;
}

.card-icon-btn.active::before {
    width: 100%;
    opacity: 1;
    background-color: var(--accent-green);
}

.card-icon-btn:hover {
    background-color: var(--header-btn-bg);
    /* منع تغيير الخلفية الأساسية */
}

/* ملء الزر عند الضغط */


.header-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-white);
    flex-grow: 1;
    text-align: center;
    margin-inline: 10px;
}

/* Categories Section (Scrollable) */
.categories-wrapper {
    background-color: var(--primary-bg);
    padding: 15px 0;
    width: 100%;
}

.categories {
    display: flex;
    gap: 15px;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-x;
    /* التأكد من أن سحب الأقسام لليمين واليسار لا يزال يعمل */
}

.categories::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome, Safari, Opera */
}

.category-card {
    /* حساب العرض لإظهار 3 بطاقات بالضبط مع احتساب الفواصل (15px) */
    flex: 0 0 calc((100% - 30px) / 3);
    width: calc((100% - 30px) / 3);
    height: auto;
    background-color: transparent;
    border-radius: 18px;
    padding: 10px 5px;
    text-align: center;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    color: var(--text-white);
    cursor: pointer;
    scroll-snap-align: center;
    /* لجعل البطاقة تتوسط الشاشة عند التمرير */
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}









.category-card:hover {
    background-color: transparent;
}

.category-name {
    white-space: normal;
    /* السماح للنص بالنزول لسطر جديد */
    width: 100%;
    font-size: 0.8rem;
    /* تصغير الخط ليتناسب مع سطرين */
    line-height: 1.3;
    /* تحسين تباعد الأسطر لجعلها مرتبة */
    height: 34px;
    /* ارتفاع ثابت ومناسب لسطرين لضمان تساوي جميع البطاقات */
    /* تم إزالة الفليكس بوكس لأنه قد يمنع التفاف النص بشكل صحيح */
    text-align: center;
    /* الاعتماد على توسيط النص القياسي */
    overflow: hidden;
    /* إخفاء أي نص زائد عن السطرين */
    padding-top: 2px;
    /* مسافة صغيرة علوية لتحسين المظهر ومنع الالتصاق بالحافة */
    word-break: break-word;
    /* ضمان تقسيم الكلمات الطويلة جداً إذا لزم الأمر */
}

.category-card img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 8px;
    filter: none;
    background-color: var(--cat-img-bg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Hero Banner Slider */
.hero-banner-container {
    width: 95%;
    margin: 15px auto;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    /* تمت إزالة الـ transition لتجنب التعارض مع الجافاسكربت في الـ Parallax */
    will-change: transform, opacity;
}


.hero-slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
    /* Ensure slider takes full width */
}

.hero-slide {
    min-width: 100%;
    /* Each slide takes full container width */
    box-sizing: border-box;
}

.hero-slide img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    /* نسبة عرض إلى ارتفاع متجاوبة */
    object-fit: cover;
    display: block;
}

.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: var(--text-white);
}

/* Products Area Container */
.products-area {
    padding: 10px 15px 100px;
    /* Increased bottom padding for footer safety */
}

.skeleton-container {
    padding: 0;
}

/* Section Title inside Products Area */
.section-title {
    /* --- تصميم جديد لعنوان القسم --- */
    display: flex;
    align-items: center;
    gap: 15px;
    /* مسافة بين الخط والنص */
    padding: 20px 15px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--section-title-color);
    /* لون أبيض مرتب */
    margin-bottom: 15px;
}

.section-title::before,
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--section-line-color, rgba(255, 255, 255, 0.3));
    opacity: 0.6;
}

.section-title.has-toggle {
    justify-content: center;
    position: relative;
    padding-inline: 60px;
}

.section-title.has-toggle::before,
.section-title.has-toggle::after {
    display: block;
    flex: 0 0 30px;
}



.section-title.has-toggle .title-text {
    flex: 0 1 auto;
    max-width: 100%;
    text-align: center;
}

.section-title.has-toggle .view-toggle-btn {
    position: absolute;
    inset-inline-start: 15px;
    top: 50%;
    transform: translateY(-50%);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Two columns */
    gap: 15px;
    padding: 0 15px 20px;
    /* Add padding to bottom */
}

.product-card {
    background-color: var(--prod-card-bg, #ffffff);
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: none;
    /* إزالة الحركات لظهور فوري */
    display: flex;
    flex-direction: column;
    content-visibility: auto;
    contain-intrinsic-size: 0 280px;
}

.product-card:hover {
    transform: none;
}

.product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* جعل الصورة مربعة لتوحيد الشكل */
    object-fit: cover;
    display: block;
    /* منع الفجوات في الأسفل */
    background: rgba(255, 255, 255, 0.05);
}

.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent;
}

.product-name {
    font-size: 0.9rem;
    font-weight: bold;
    width: 100%;
    border-bottom: 1px solid var(--prod-card-divider-color, var(--prod-border-color));
    opacity: 1;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.product-price {
    font-size: 0.8rem;
    color: var(--prod-price-color);
    opacity: 0.9;
    font-weight: 500;
}

/* تنسيق عرض الأحجام في البطاقة الرئيسية */
.product-sizes-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.product-sizes-tags span {
    background-color: transparent;
    /* إلغاء البطاقة الزجاجية */
    border: none;
    /* إزالة الحدود */
    padding: 0;
    margin-inline-end: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
}


/* 404 Error Page Styles */
#error-page {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    background-color: var(--primary-bg);
    position: fixed;
    inset: 0;
    z-index: 2000;
}

#main-content {
    flex-grow: 1;
    overflow-y: auto;
    /* منطقة التمرير الحقيقية */
    overflow-x: hidden;
    transition: opacity 0.3s ease;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
    will-change: scroll-position;
    contain: layout style;
    /* تمت إزالة size لمنع تقطع التمرير */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-green) transparent;
    overscroll-behavior: contain;

    /* تسريع عتادي (GPU Acceleration) لتمرير صاروخي */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    overscroll-behavior-x: none;
    touch-action: pan-y;
}

/* حل نهائي لظهور مؤشر التمرير في iPhone (Safari & Chrome) */
#main-content::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 4px !important;
    height: 4px !important;
}

#main-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

#main-content::-webkit-scrollbar-thumb {
    background-color: #FF751F !important;
    border-radius: 10px;
    /* الطول يتم التحكم به عبر المسافة الشفافة */
    border: 1px solid transparent;
    background-clip: content-box;
}

/* مؤشر تمرير مخصص (الحل النهائي للأيفون) */
.custom-scrollbar-vip {
    position: fixed;
    right: 0px;
    /* لصقها باليمين لسهولة السحب */
    top: 310px;
    /* يبدأ بضبط مع بداية بطاقة السلايدر */
    bottom: 45px;
    /* ينتهي عند الفوتر الصغير */
    width: 25px;
    /* منطقة لمس أوسع */
    z-index: 9999;
    pointer-events: auto;
    /* تفعيل التفاعل */
    background: transparent;
    display: none;
    /* يتم التحكم به عبر JS */
    border-radius: 10px;
    justify-content: center;
    cursor: grab;
}

.custom-scrollbar-vip:active {
    cursor: grabbing;
}

.scroll-thumb-vip {
    width: 4px;
    /* المؤشر نفسه يبقى نحيفاً */
    height: 40px;
    background: var(--scroll-indicator-color, #FF751F);
    border-radius: 10px;
    transition: transform 0.1s linear;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* خاص بالأيفون لإجبار الظهور */
#main-content {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#main-content::-webkit-scrollbar {
    display: none;
}

/* تحسين أداء عرض المنتجات عند التمرير السريع */
.products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 0 15px 20px;
}

.product-card {
    contain: content;
}




/* Bottom Sheet Styles (لوحة الأقسام السفلية) */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    /* إلغاء التغطية المعتمة بناءً على طلبك */
    z-index: 1999;
    visibility: hidden;
}

.bottom-sheet-overlay.active {
    visibility: visible;
    touch-action: none;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    height: calc(100vh - 245px);
    /* نفس طول بطاقة اختيار اللغات ليبدأ من نهاية قسم الأقسام */
    background-color: var(--sheet-bg);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    z-index: 2000;
    display: none;
    /* مخفي افتراضياً */
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.bottom-sheet.active {
    display: flex;
    /* يظهر عند التفعيل */
}

/* إغلاق فوري بدون حركات */

/* Global Sheet Handle Trigger */
.sheet-handle-trigger {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    z-index: 10;
}



.sheet-header {
    padding: 35px 20px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sheet-header h3 {
    margin: 0;
    color: var(--sheet-text);
    font-size: 1.3rem;
    font-weight: 700;
}

.sheet-content {

    padding: 20px;
    padding-bottom: 40px;
    /* مساحة إضافية في الأسفل لراحة العين والإصبع */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* لجعل التمرير أكثر سلاسة على أجهزة iOS */
    overscroll-behavior: contain;
    /* عزل التمرير تماماً داخل القائمة */

    flex-grow: 1;
    /* السماح للمحتوى بالتمدد والتمرير */
}

.sheet-categories-grid {
    display: grid;
    /* استخدام auto-fill لإنشاء عدد أعمدة متجاوب بناءً على المساحة المتاحة */
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 20px;
}

.sheet-category-card {
    text-align: center;
    cursor: pointer;
    color: var(--sheet-text);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease;
}







.sheet-category-card img {
    /* توحيد حجم الصور لضمان التناسق */
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 0;
    /* تم استبداله بـ gap */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* تنسيق أيقونات المكتبة للأقسام */
.category-icon-lib {
    /* توحيد حجم الأيقونات لتكون بنفس حجم الصور */
    width: 70px;
    height: 70px;
    font-size: 2.8rem;
    /* تكبير الأيقونة قليلاً لتناسب الإطار */
    margin-bottom: 0;
    /* تم استبداله بـ gap */
    color: var(--sheet-text);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--sheet-icon-bg);
    /* خلفية بسيطة للتمييز */
    border-radius: 15px;
}

/* --- تنسيقات لوحة التحكم الجديدة (Admin Panel) --- */
.admin-dashboard {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    color: #333;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: #f1f3f5;
    padding: 5px;
    border-radius: 12px;
}

.admin-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    color: #666;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
}

.admin-tab.active {
    background: white;
    color: var(--primary-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.admin-section {
    animation: fadeIn 0.4s ease;
}

.item-list {
    margin-top: 20px;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: white;
    transition: background 0.2s;
}

.item-row:last-child {
    border-bottom: none;
}

.item-row:hover {
    background: #f8f9fa;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Product Modal Styles */
.product-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    /* خلفية شفافة تماشياً مع الأقسام واللغات */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* المحاذاة للأسفل كباقي القوائم */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 0;
    backdrop-filter: none;
}

.product-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.product-modal-content {
    background-color: var(--sheet-bg, var(--modal-bg, var(--prod-card-bg, #1a1a1a)));
    color: var(--text-white);
    border-radius: 30px 30px 0 0;
    /* نفس دائرية الأقسام واللغات */
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 245px);
    /* نفس الطول المحدد للأقسام واللغات */
    max-height: calc(100vh - 245px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    position: relative;
    display: block;
    visibility: hidden;
    /* مخفي افتراضياً */
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
    .product-modal-overlay {
        align-items: center;
        background-color: rgba(0, 0, 0, 0.4);
        /* خلفية خفيفة للشاشات الكبيرة */
    }

    .product-modal-content {
        border-radius: 25px;
        max-width: 500px;
        width: 90%;
        height: 700px;
        max-height: 85vh;
        transform: scale(0.9);
    }

    .product-modal-overlay.active .product-modal-content {
        transform: scale(1);
    }
}

/* إظهار المحتوى عند تفعيل المودال */
.product-modal-overlay.active .product-modal-content {
    visibility: visible;
    opacity: 1;
    transform: none;
}



.product-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--modal-close-bg, rgba(0, 0, 0, 0.6));
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--modal-close-icon, #ffffff);
}

.product-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.product-modal-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* توحيد القياس ليكون مربعاً احترافياً */
    object-fit: cover;
    display: block;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.product-modal-info {
    padding: 20px 25px;
    /* تمت إزالة التمرير الداخلي ليكون التمرير للبطاقة ككل */
}

.product-modal-content::-webkit-scrollbar {
    display: none;
}

.product-modal-content::-webkit-scrollbar {
    display: none;
}

.product-modal-info::-webkit-scrollbar {
    display: none;
}

.product-modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    width: 100%;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.product-modal-name {
    font-size: 1.4rem;
    margin: 0;
    font-weight: 700;
    flex: 1;
    color: var(--text-white);
    line-height: 1.3;
}

.product-modal-price-main {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--modal-selection-bg, #ff751f);
    white-space: nowrap;
    margin: 0 !important;
    letter-spacing: -0.5px;
}

.product-modal-desc p {
    font-size: 0.95rem;
    line-height: 1.7;
    opacity: 0.9;
    margin: 0 0 20px 0;
}

.product-modal-desc h4,
.product-modal-sizes h4,
.product-modal-options h4 {
    font-size: 0.95rem;
    color: var(--modal-header-color, var(--text-white));
    margin-bottom: 15px;
    margin-top: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 0.3px;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
}

.collapsible-header i {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

.collapsible-header.collapsed i {
    transform: rotate(-180deg);
}

.collapsible-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

/* تنسيق قائمة الأحجام كصفوف */
.sizes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.size-row {
    background: var(--option-item-bg, rgba(255, 255, 255, 0.04));
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
    /* لمنع خروج تأثير اللون */
}

.size-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.size-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 100%;
    background: var(--modal-selection-bg, var(--accent-green));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    z-index: 0;
    opacity: 0;
}

.size-row.active::before {
    width: 100%;
    opacity: 1;
}

.size-row .size-name,
.size-row .size-price {
    position: relative;
    z-index: 1;
    /* ليكون النص فوق تأثير اللون */
    transition: all 0.3s ease;
}

/* إضافة أيقونة اختيار للحجم النشط */
.size-row.active::after {
    content: '\eb7b';
    font-family: 'remixicon';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 1.2rem;
    z-index: 2;
}

/* إزاحة السعر قليلاً لليسار لإفساح المجال للأيقونة */
[dir="rtl"] .size-row.active .size-price {
    margin-left: 25px;
}

[dir="ltr"] .size-row.active .size-price {
    margin-right: 25px;
}


.size-row.active {
    border-color: var(--modal-selection-bg, var(--accent-green));
}

.size-row .size-name {
    font-size: 1rem;
    font-weight: 600;
}

.size-row .size-price {
    font-size: 1.1rem;
    font-weight: 800;
}

.size-row.active .size-name,
.size-row.active .size-price {
    color: white;
}

/* تنسيق الاختيارات الإضافية */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    background: var(--option-item-bg, rgba(255, 255, 255, 0.04));
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.option-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 100%;
    background: var(--modal-selection-bg, #ff751f);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    z-index: 0;
    opacity: 0;
}

.option-item:has(input:checked)::before {
    width: 100%;
    opacity: 1;
}

.option-check,
.option-details {
    position: relative;
    z-index: 1;
}

.option-item input {
    display: none;
}

.option-check {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-item input:checked+.option-check {
    background: var(--modal-selection-bg, #ff751f);
    border-color: var(--modal-selection-bg, #ff751f);
    transform: scale(1.1);
}

.option-item input:checked+.option-check::after {
    content: '\eb7b';
    font-family: 'remixicon';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.option-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.option-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-white);
    transition: color 0.3s ease;
}

.option-item:has(input:checked) .option-name,
.option-item:has(input:checked) .option-price {
    color: white;
}

.option-price {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--option-price-color, var(--modal-selection-bg, #ff751f));
    opacity: 0.9;
}

.free-badge {
    font-size: 0.75rem;
    color: var(--free-text-color, var(--accent-green));
    opacity: 0.7;
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(58, 109, 86, 0.1);
    border-radius: 20px;
}

.cart-item-opts {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 3px;
    font-style: italic;
}

.product-modal-price-main {
    font-size: 2rem;
    font-weight: 900;
    text-align: center;
    margin-top: 20px;
    color: var(--text-white);
}

/* --- ثيمات تفاصيل المنتج الجديدة (Product Modal Themes) --- */

/* ثيم إيليت العصري (Elite Modern) - تصميم دائري بسيط وناعم */
.modal-theme-theme1 .product-modal-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 30px auto 10px;
    border: 5px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3), 0 0 15px var(--modal-selection-bg, #ff751f);
    object-fit: cover;
}

.modal-theme-theme1 .product-modal-header-row {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-theme-theme1 .product-modal-name {
    text-align: center;
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 0;
    flex: none;
}

.modal-theme-theme1 .product-modal-desc {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
}

.modal-theme-theme1 .product-modal-price-main {
    font-size: 2.1rem;
    color: var(--modal-selection-bg, #ff751f);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    font-weight: 800;
}

.modal-theme-theme1 .size-card,
.modal-theme-theme1 .option-item {
    border-radius: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.03);
}

/* ثيم في آي بي المتوهج (VIP Neon Glow) - تصميم مستقبلي بحدود مضيئة */
.modal-theme-theme2 {
    border: 2px solid var(--modal-selection-bg, #ff751f) !important;
    overflow: hidden;
}

.modal-theme-theme2 .product-modal-img {
    width: 100%;
    aspect-ratio: 16/9;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    margin-bottom: -15px;
}

.modal-theme-theme2 .product-modal-name {
    padding: 5px 15px;
    background: var(--modal-selection-bg, #ff751f);
    color: white;
    display: table;
    border-radius: 4px;
    margin-bottom: 0;
    flex: none;
}

.modal-theme-theme2 .size-card.active,
.modal-theme-theme2 .option-item input:checked+.option-check {
    box-shadow: 0 0 15px var(--modal-selection-bg, #ff751f);
}

.modal-theme-theme2 .product-modal-desc p {
    font-style: italic;
    border-right: 2px solid var(--modal-selection-bg, #ff751f);
    padding-right: 15px;
}

.modal-theme-theme2 .product-modal-price-main {
    text-align: right;
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 0px var(--modal-selection-bg, #ff751f);
}

/* --- تحسينات للهواتف (Mobile Enhancements) --- */
@media (max-width: 500px) {
    .product-modal-overlay {
        /* في الهواتف، نجعل اللوحة تظهر من الأسفل لتجربة استخدام أفضل */
        align-items: flex-end;
        padding: 0;
        /* إزالة الهوامش لتتمدد اللوحة على كامل العرض */
    }

    .product-modal-content {
        /* تعديل التصميم ليناسب الظهور من الأسفل */
        max-width: 100%;
        max-height: 80vh;
        /* تحديد الارتفاع لمنع ملء الشاشة بالكامل */
        border-radius: 25px 25px 0 0;
        /* حواف دائرية علوية فقط */

        /* تغيير حركة الظهور لتكون انزلاق من الأسفل */
        transform: translateY(100%);
        transition: transform 0.35s ease-out;
    }

    .product-modal-overlay.active .product-modal-content {
        /* إظهار اللوحة عند تفعيلها */
        transform: translateY(0);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    }

    .product-modal-img {
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .product-modal-name {
        font-size: 1.6rem;
        /* تصغير حجم العنوان قليلاً */
    }
}

/* For tablets and larger screens */
@media (min-width: 768px) {
    .categories-wrapper {
        overflow-x: visible;
        /* Disable horizontal scroll */
        padding: 15px 20px;
    }

    .categories {
        display: flex;
        /* Revert to flexbox for wrapping */
        flex-wrap: wrap;
        /* Allow categories to wrap */
        justify-content: center;
        /* Center the wrapped items */
        gap: 20px;
    }

    .category-card {
        flex: 0 0 auto;
        /* Reset flex sizing for desktop */
        width: 110px;
        /* A slightly larger fixed width */
    }
}


/* --- تنسيقات صفحة البحث الإبداعية (Creative Search Page) --- */

#searchPage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2500;
    background-color: var(--primary-bg);
    overflow-y: auto;

    /* إزالة تأثيرات الانتقال - ظهور فوري */
    display: none;
}

#searchPage.active {
    display: block;
}


/* تثبيت الهيدر في الصفحات المنبثقة (البحث، التقييم، السلة) */
#searchPage header,
#ratingPage header,
#cartPage header {
    position: sticky;
    top: 0;
    background-color: var(--primary-bg);
    z-index: 100;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 60px;
    width: 100%;
}

/* تنسيق العناوين في الهيدرات المنبثقة */
.rating-title-wrapper,
.cart-header-title-container {
    flex-grow: 1;
    text-align: center;
    margin-inline-end: 40px;
    /* موازن لزر الرجوع لتوسيط العنوان تماماً */
}

#cartHeaderTitle,
.rating-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

/* زر الرجوع (السهم) - تصميم دائري أنيق */
#closeSearchBtn {
    font-size: 1.6rem;
    color: var(--text-white);
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

#closeSearchBtn:hover {
    opacity: 0.8;
    /* تغيير بسيط في الشفافية بدل الخلفية */
}


.search-container {
    padding: 0;
    /* جعل القائمة تمتد لكامل العرض */
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    flex-grow: 1;
    background-color: transparent !important;
    /* حذف أي خلفية نهائياً */
    border: none;
    padding: 0;
    height: 48px;
}

.search-input-wrapper:focus-within {
    background-color: transparent !important;
}


.search-input-wrapper .ri-search-line {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.5);
    margin-inline-start: 10px;
    margin-inline-end: 10px;
    pointer-events: none;
}

/* --- إعادة تصميم حقل البحث --- */
#searchInput {
    flex-grow: 1;
    width: auto;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
    color: var(--text-white);
    box-shadow: none;
}

#searchInput:focus {
    background-color: transparent;
    box-shadow: none;
}

#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: normal;
}

.clear-search-btn {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    width: 28px;
    font-size: 1.1rem;
    color: var(--text-white);
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin-inline-start: 5px;
    margin-inline-end: 5px;
    cursor: pointer;
}

.clear-search-btn:hover {
    background-color: #ff4757;
}


/* --- نتائج البحث --- */
#searchPage .products-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* إزالة المسافات بين العناصر للقائمة المتصلة */
    padding-bottom: 50px;
}

#searchPage .product-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 15px 20px;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 15px;
    text-align: right;
    transition: background-color 0.2s, transform 0.2s;
}

#searchPage .product-card:hover {
    /* إزالة تأثير الخلفية البيضاء عند التمرير لتصميم أنظف */
    transform: none;
}

#searchPage .product-img {
    width: 80px;
    height: 80px;
    min-width: 80px;
    aspect-ratio: 1;
    border-radius: 12px;
}

#searchPage .product-info {
    padding: 0;
    background: transparent;
    align-items: flex-start;
    width: 100%;
    justify-content: center;
}

#searchPage .product-name {
    font-size: 1rem;
    font-weight: 700;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 4px;
}

.product-description-search {
    font-size: 0.8rem;
    opacity: 0.8;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-container {
    width: 100%;
}

#searchPage .product-price {
    font-size: 0.9rem;
    color: var(--text-white);
    font-weight: bold;
    opacity: 1;
}

#searchPage .product-sizes-tags span {
    background-color: transparent;
}

/* حالة عدم وجود نتائج */
.no-search-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-white);
}

.no-search-results i {
    font-size: 5rem;
    color: var(--accent-green);
    margin-bottom: 20px;
    line-height: 1;
}

.no-search-results p {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0 0 10px 0;
}

.no-search-results span {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* --- Rating System UI (Modern, Clean & Responsive) --- */
#ratingPage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2500;
    background-color: var(--primary-bg);
    display: none;
    flex-direction: column;
}

#ratingPage.active {
    display: flex;
}

#ratingPage header {
    position: sticky;
    top: 0;
    background-color: var(--primary-bg);
    z-index: 10;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 60px;
    direction: inherit;
}

.rating-title-wrapper {
    display: flex;
    align-items: center;
    flex-grow: 1;
    height: 48px;
}

.rating-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-white);
}

.rating-scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.rating-form-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding-bottom: 40px;
}

.rating-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.rating-item label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-white);
    opacity: 0.9;
    text-align: center;
}

.stars-container {
    display: flex;
    gap: 12px;
    font-size: 2.4rem;
    direction: ltr;
}

.star-icon {
    color: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.emoji-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.emoji-btn {
    font-size: 2.6rem;
    cursor: pointer;
    filter: grayscale(100%) opacity(0.4);
    transition: all 0.3s ease;
}

.emoji-btn.selected {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.2);
}

.rating-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border-radius: 12px;
    padding: 14px 18px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.rating-input:focus {
    border-color: var(--accent-green);
}

.rating-textarea {
    resize: none;
}

.rating-actions {
    margin-top: 10px;
}

.submit-rating-btn {
    width: 100%;
    height: 54px;
    background-color: var(--accent-green);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.submit-rating-btn:active {
    transform: scale(0.98);
}

@media (max-width: 480px) {
    .stars-container {
        font-size: 2.1rem;
        gap: 8px;
    }

    .emoji-btn {
        font-size: 2.3rem;
    }
}

/* --- Menu Footer Info Styles (VIP Full Width) --- */
/* --- Menu Footer Info Styles (Seamless VIP Branding) --- */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1100;
    background: var(--primary-bg);
    height: 44px;
    /* Back to fixed height */
    padding: 0;
    /* Removed padding to make it thinner */
    display: flex;
    align-items: center;
    justify-content: center;
    transform: none;
    -webkit-transform: none;
    border: none;
    box-shadow: none;
}

#main-content {
    /* Adjusted padding-bottom for the new footer style */
    padding-bottom: 100px;
}

.footer-branding-vip {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-branding-vip:active {
    transform: scale(0.95);
    /* تأثير ضغطة خفيفة */
}


.footer-branding-vip .powered-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--footer-text);
    white-space: nowrap;
}

.footer-logo {
    height: 38px;
    max-height: 38px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    /* إشراق كامل لوضوح أقصى على جميع الشاشات */
    filter: brightness(1.1);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    footer {
        height: 40px;
        /* Thinner for mobile */
        padding: 0;
    }

    .footer-logo {
        height: 35px;
        max-height: 35px;
    }
}

/* زر الرجوع للأعلى - تصميم مربع عصري ومرتب */
.back-to-top-btn {
    position: fixed;
    bottom: 110px;
    /* تم رفعه ليكون فوق بطاقة السلة */
    inset-inline-end: 20px;
    width: 42px;
    height: 42px;
    background-color: var(--back-to-top-bg, #ff751f);
    /* استخدام لون مخصص أو افتراضي */
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    /* شكل مربع بزوايا دائرية أنيقة */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) translate3d(0, 0, 0);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    backface-visibility: hidden;
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* تأثير الصعود الصاروخي - سريع ومرتب */
.back-to-top-btn.ascending {
    transform: translateY(-120vh) !important;
    opacity: 0 !important;
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.3s ease-out !important;
    pointer-events: none;
}

.back-to-top-btn i {
    transition: transform 0.3s ease;
}

.back-to-top-btn:hover {
    background-color: var(--back-to-top-bg, #ff751f);
    transform: translateY(-3px);
}

.back-to-top-btn:hover i {
    transform: translateY(-2px);
}

.back-to-top-btn:active {
    transform: scale(0.92);
}

/* تكييف للمجال الضيق */
@media (max-width: 480px) {
    .back-to-top-btn {
        width: 40px;
        height: 40px;
        bottom: 110px;
        inset-inline-end: 15px;
        border-radius: 10px;
    }
}

/* تمت إزالة حركة الظهور (cardEnter) لضمان السرعة القصوى عند تغيير اللغة */




/* --- نافذة حالة المطعم (صفحة كاملة) --- */
.status-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-bg, #1B4332);
    /* استخدام لون البراند كخلفية كاملة */
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    animation: fadeIn 0.5s ease;
}

.status-content {
    background: transparent;
    border: none;
    padding: 40px;
    text-align: center;
    max-width: 600px;
    width: 100%;
    box-shadow: none;
    transform: translateY(0);
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.status-icon {
    font-size: 6rem;
    /* تكبير الأيقونة لتناسب الصفحة الكاملة */
    margin-bottom: 30px;
    color: var(--accent-color, #ff751f);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.status-overlay.is-closed .status-icon {
    color: #ff4d4d;
    /* أحمر للمغلق */
}

.status-overlay.is-busy .status-icon {
    color: #ffcc00;
    /* أصفر للمشغول */
}

.status-overlay.is-maintenance .status-icon {
    color: #3498db;
    /* أزرق للصيانة */
}

.status-content h2 {
    margin-bottom: 20px;
    font-size: 2.5rem;
    /* خط كبير وعريض */
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.status-content p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.btn-status-ok {
    background-color: #fff;
    /* زر بلون مختلف للتميز في الصفحة الكاملة */
    color: var(--primary-bg, #1B4332);
    border: none;
    padding: 15px 50px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-status-ok:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.btn-status-ok:active {
    transform: scale(0.95);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- نظام سلة المشتريات (Cart System Styles) --- */

/* شريط السلة العائم - تصميم VIP */
/* شريط السلة العائم - تصميم بطاقة VIP مرتبطة بالفوتر */
#cartBar {
    position: fixed;
    bottom: 60px;
    /* رفعه قليلاً ليكون فوق الفوتر بمسافة مريحة */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 90%;
    /* عرض متناسب مع معظم الشاشات */
    max-width: 400px;
    background: linear-gradient(135deg, var(--cart-bg1, #ff751f) 0%, var(--cart-bg2, #ff9f43) 100%);
    color: var(--cart-text, #ffffff);
    padding: 14px 20px;
    border-radius: 18px;
    /* شكل كبسولة أنيق */
    /* زوايا دائرية من الأعلى ومستوية من الأسفل للاتصال بالفوتر */
    z-index: 1500;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
}

#cartBar.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* تنسيق متوافق مع جميع الشاشات */
@media (max-width: 500px) {
    #cartBar {
        width: 92%;
        bottom: 55px;
    }
}

#cartBar.active {
    transform: translateY(0);
    animation: bounceBar 0.5s ease-out;
}

#cartBar.active {
    transform: translateX(-50%) translateY(0);
    animation: bounceBar 0.5s ease-out;
}

@keyframes bounceBar {
    0% {
        transform: translateX(-50%) translateY(20px);
    }

    50% {
        transform: translateX(-50%) translateY(-10px);
    }


    100% {
        transform: translateX(-50%) translateY(0);
    }
}

.cart-bar-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    justify-content: space-between;
}

#cartBarMsg {
    font-weight: 700;
    font-size: 0.95rem;
}

.cart-bar-count {
    background: var(--cart-badge-bg, white);
    color: var(--cart-badge-text, #ff751f);
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* صفحة السلة (لائحة الطلبات) */
#cartPage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-bg, #1B4332);
    z-index: 2600;
    display: none;
    /* مخفي افتراضياً لظهور فوري */
    flex-direction: column;
}

#cartPage.active {
    display: flex;
    /* ظهور فوري */
}

/* إزالة تحويلات الاتجاه لضمان الظهور الفوري */



/* تم توحيد التنسيق في الأعلى مع البحث والتقييم */

.cart-scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-footer {
    padding: 15px 20px 25px;
    background: var(--sheet-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.cart-total-row.grand-total {
    font-size: 1.4rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    margin-top: 5px;
}

#cartTotalPrice {
    color: var(--accent-green);
}

.whatsapp-btn {
    width: 100%;
    background-color: var(--accent-green);
    color: white;
    border: none;
    height: 58px;
    border-radius: 18px;
    font-size: 1.15rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.whatsapp-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.12);
    transform: translateX(-50%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.whatsapp-btn:active {
    transform: scale(0.96);
}

.whatsapp-btn:hover::before {
    width: 100%;
}

.whatsapp-btn i,
.whatsapp-btn span {
    position: relative;
    z-index: 2;
}

.whatsapp-btn.active::before {
    width: 100%;
    opacity: 1;
}

.whatsapp-btn i,
.whatsapp-btn span,
.whatsapp-btn strong {
    position: relative;
    z-index: 1;
}

.whatsapp-btn:active {
    transform: scale(0.98);
}

/* عناصر السلة */
.cart-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-item-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cart-item-name {
    font-weight: 700;
    font-size: 1rem;
}

.cart-item-name small {
    display: block;
    opacity: 0.6;
    font-weight: 400;
}

.cart-item-price {
    color: var(--cart-item-price, var(--accent-color, #ff751f));
    font-weight: 700;
}

.cart-item-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--qty-bg, rgba(255, 255, 255, 0.1));
    padding: 5px 10px;
    border-radius: 10px;
}

.qty-control button {
    background: transparent;
    border: none;
    color: var(--qty-text, #ffffff);
    font-size: 1.2rem;
    cursor: pointer;
}

.qty-control span {
    font-weight: 800;
    min-width: 20px;
    text-align: center;
}

.cart-item-note input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
}

.empty-cart-msg {
    text-align: center;
    padding: 50px 0;
    opacity: 0.5;
    font-size: 1.1rem;
}

/* زر الإضافة للسلة في المودال */
.add-to-cart-btn {
    width: 100%;
    background: var(--add-to-order-bg, var(--accent-color, #ff751f));
    color: white;
    border: none;
    padding: 16px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    opacity: 0;
}

.add-to-cart-btn.active::before {
    width: 100%;
    opacity: 1;
}

.add-to-cart-btn i,
.add-to-cart-btn span {
    position: relative;
    z-index: 1;
}

.add-to-cart-btn:hover {
    filter: brightness(1.1);
}

.size-card.active {
    border-color: var(--modal-selection-bg, var(--accent-color, #ff751f));
    background: rgba(255, 117, 31, 0.1);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.size-card.active .size-price {
    color: var(--modal-selection-bg, var(--accent-color, #ff751f));
}



.view-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-white);
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s ease;
    z-index: 5;
    padding: 0;
    box-shadow: none;
}

.view-toggle-btn:active {
    transform: scale(0.92);
}

.view-toggle-btn i {
    position: relative;
    z-index: 2;
}

/* تنسيق القائمة المرتب (List View) */
.products-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 15px 30px;
}

.products-grid.list-view .product-card {
    flex-direction: row;
    height: 110px;
    align-items: stretch;
    background-color: var(--prod-card-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.products-grid.list-view .product-img {
    width: 110px;
    height: 110px;
    aspect-ratio: 1/1;
    border-radius: 0 18px 18px 0;
    /* تقويس الجهة اليمنى في RTL */
}

/* تعديل التقويس للأجهزة التي تدعم القراءة من اليسار لليمين */
[dir="ltr"] .products-grid.list-view .product-img {
    border-radius: 18px 0 0 18px;
}

.products-grid.list-view .product-info {
    flex: 1;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    text-align: right;
}

[dir="ltr"] .products-grid.list-view .product-info {
    text-align: left;
}

.products-grid.list-view .product-name {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.products-grid.list-view .product-price {
    font-size: 0.95rem;
    color: var(--accent-green);
    font-weight: 700;
}

.products-grid.list-view .product-sizes-tags {
    display: none;
    /* إخفاء الأحجام في عرض القائمة للحفاظ على الترتيب */
}

/* فليب أيقونة الرجوع في وضع LTR لتعمل بشكل صحيح */
[dir="ltr"] .ri-arrow-right-line {
    transform: scaleX(-1);
}

[dir="ltr"] .ri-arrow-left-line {
    transform: scaleX(-1);
}

/* --- نظام كوبونات الخصم بستايل الكارت (Cart Promo Card VIP) --- */
.cart-promo-card-vip {
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    margin-bottom: 5px;
}

.promo-card-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.promo-icon-box {
    width: 45px;
    height: 45px;
    background: var(--primary-trans);
    color: var(--accent-green);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.promo-input-wrapper {
    flex: 1;
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    height: 45px;
}

.promo-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    padding: 0 12px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
}

.promo-input-wrapper button {
    background: var(--accent-green);
    color: white;
    border: none;
    padding: 0 15px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.promo-input-wrapper button:active {
    transform: scale(0.9);
}

.promo-msg {
    margin-top: 10px;
    font-size: 0.8rem;
    padding: 0 5px;
    display: block;
}

.promo-msg.success {
    color: #2ecc71;
}

.promo-msg.error {
    color: #e74c3c;
}

.promo-applied-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(46, 204, 113, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.15);
    padding: 8px 12px;
    border-radius: 12px;
    margin-top: 10px;
}

.promo-applied-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2ecc71;
    font-weight: bold;
    font-size: 0.85rem;
}

.promo-msg {
    font-size: 0.8rem;
    margin-top: 8px;
    padding: 0 5px;
}

.promo-msg.success {
    color: #2ecc71;
}

.promo-msg.error {
    color: #e74c3c;
}

/* جداول تلخيص السعر */
.cart-total-row.subtotal {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 5px;
}

.cart-total-row.discount {
    font-size: 0.9rem;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-total-row.grand-total {
    margin-top: 10px;
}