/* ===========================
   1. الأساسيات وتهيئة عامة
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

:root {
    /* الألوان الأصلية */
    --brand: #0c305b;
    --brand-dark: #072242;
    --accent: #28cb69;
    --bg-soft: #f2f6fb;
    --text-main: #222;
    --text-muted: #666;
    
    /* متغيرات التخطيط الجديد */
    --header-height: 64px;
    --sidebar-width: 260px;
    --transition-speed: 0.3s;

    /* القياسات الأصلية */
    --radius-lg: 7px;
    --radius-md: 14px;
    --shadow-soft: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-soft-strong: 0 8px 28px rgba(0,0,0,0.16);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background-color: var(--bg-soft);
    color: var(--text-main);
    overflow-x: hidden; /* ضروري لمنع السكرول العرضي مع السايد بار */
}

/* اتجاه عام حسب اللغة */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="ltr"] body {
    direction: ltr;
    text-align: left;
}

a { color: var(--brand); text-decoration: none; transition: 0.2s; }
a:hover { text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }

.container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    /* البادينغ مسيطر عليه من main-content */
}

/* ===========================
   2. السايد بار (Sidebar) - التخطيط الجديد
   =========================== */

.sidebar {
    position: fixed;
    top: 0;
    right: 0; /* افتراضياً يمين (للـ RTL) */
    width: var(--sidebar-width);
    height: 100vh;
    background-color: #fff;
    border-left: 1px solid #e1e4ee;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.02);
}

/* في حالة اللغة الإنجليزية: السايدبار على اليسار */
html[dir="ltr"] .sidebar {
    right: auto;
    left: 0;
    border-left: 0;
    border-right: 1px solid #e1e4ee;
    box-shadow: -4px 0 24px rgba(0,0,0,0.02);
}

/* هيدر السايد بار (زر الإغلاق للموبايل) */
.sidebar-mobile-header {
    display: none;
    padding: 10px 15px;
    justify-content: flex-end;
}

/* بروفايل المستخدم في السايد بار */
.sidebar-user-profile {
    padding: 25px 20px 20px;
    background-color: #f8f9fc;
    border-bottom: 1px solid #edf0f5;
    text-align: center;
    margin-bottom: 10px;
}

.user-avatar-circle {
    width: 60px;
    height: 60px;
    background-color: var(--brand);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 10px;
    box-shadow: 0 4px 10px rgba(12,48,91,0.15);
}

.sidebar-user-name {
    font-weight: 700;
    color: var(--brand);
    font-size: 15px;
    display: block;
    margin-bottom: 2px;
}

.sidebar-user-role {
    font-size: 12px;
    color: #888;
    background-color: #e8ecf3;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

/* روابط السايد بار */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #e1e4ee; border-radius: 10px; }

.sidebar-nav ul li { margin-bottom: 5px; }

.sidebar-nav .nav-label {
    padding: 15px 14px 5px;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    font-weight: 700;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    gap: 12px;
}

.sidebar-nav a i { font-size: 20px; min-width: 24px; text-align: center; }

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: #f0f7ff;
    color: var(--brand);
}
.sidebar-nav a.active {
    background-color: var(--brand);
    color: #fff;
    box-shadow: 0 4px 12px rgba(12,48,91,0.25);
}
.sidebar-nav a.text-danger:hover { background-color: #fee2e2; color: #dc2626; }

/* ===========================
   3. الهيدر (Topbar) - التخطيط الجديد
   =========================== */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: var(--sidebar-width); /* افتراضياً بعد السايدبار اليمين */
    height: var(--header-height);
    background-color: #f1ece3;
    border-bottom: 1px solid #eef1f6;
    z-index: 1001;
    display: flex;
    align-items: center;
    padding: 0 24px;
    transition:
        right var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
        left var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

/* في حالة LTR: السايدبار يسار، فالهيدر يبدأ بعده من اليسار */
html[dir="ltr"] .topbar {
    right: 0;
    left: var(--sidebar-width);
}

.topbar-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* الجهة اليمنى: زر القائمة + الرصيد (اسم بس، الترتيب حسب dir تلقائياً) */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* الجهة اليسرى: اللوجو */
.topbar-left {
    display: flex;
    align-items: center;
}

.toggle-btn {
    background: transparent;
    border: none;
    font-size: 35px;
    cursor: pointer;
    color: var(--brand);
    padding: 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.toggle-btn:hover { background-color: #f0f3f9; }

/* الرصيد */
.balance-badge {
    display: flex; align-items: center; gap: 6px;
    background-color: #ffffff; color: #1c7a46;
    padding: 3px 10px; border-radius: 99px;
    font-size: 14px; font-weight: 700;
    border: 1px solid #b8e6ca;
}
.balance-badge span { color: #1c7a46; }

/* اللوجو */
.topbar-logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--brand);
    text-decoration: none;
}


/* ===========================
   4. المحتوى الرئيسي والفوتر (Layout Logic)
   =========================== */

.main-content {
    margin-top: var(--header-height);
    margin-right: var(--sidebar-width); /* افتراضياً السايدبار يمين */
    padding: 24px;
    min-height: calc(100vh - var(--header-height));
    transition: margin-right var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
                margin-left var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

/* عند LTR نستخدم margin-left بدال margin-right */
html[dir="ltr"] .main-content {
    margin-right: 0;
    margin-left: var(--sidebar-width);
}

.footer {
    margin-right: var(--sidebar-width);
    transition: margin-right var(--transition-speed), margin-left var(--transition-speed);
}

/* عند LTR الفوتر يتحرك مع المحتوى */
html[dir="ltr"] .footer {
    margin-right: 0;
    margin-left: var(--sidebar-width);
}


/* ===========================
   5. حالات التجاوب (Responsive States)
   =========================== */

/* الكمبيوتر: إغلاق القائمة */
@media (min-width: 992px) {
    body.sidebar-closed .sidebar { 
        transform: translateX(100%); /* تطلع لبرا من اليمين في RTL */
    }

    html[dir="ltr"] body.sidebar-closed .sidebar {
        transform: translateX(-100%); /* تطلع لبرا من اليسار في LTR */
    }

    body.sidebar-closed .topbar { 
        right: 0;
    }
    html[dir="ltr"] body.sidebar-closed .topbar {
        left: 0;
    }

    body.sidebar-closed .main-content,
    body.sidebar-closed .footer {
        margin-right: 0;
    }
    html[dir="ltr"] body.sidebar-closed .main-content,
    html[dir="ltr"] body.sidebar-closed .footer {
        margin-left: 0;
    }
}

/* الموبايل */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(100%); /* مخفية يمين (لانها يمين بالـ RTL) */
        width: 280px;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        z-index: 1100;
    }

    /* في LTR السايدبار يسار -> نخليها مخفية لليسار */
    html[dir="ltr"] .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
html[dir="ltr"] .main-content {
    margin-right: 0;
    margin-left: 0;
}
    .sidebar.show { 
        transform: translateX(0); 
    }
html[dir="ltr"] .topbar {
    right: 0;
    left: 0;
}
html[dir="ltr"] .footer {
    margin-right: 0;
    margin-left: 0;
}
    /* ✅ ضمان إن السايدبار تفتح كمان لما اللغة إنكليزي */
    html[dir="ltr"] .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-mobile-header { display: flex; } /* إظهار زر الإغلاق */
    
    .topbar { right: 0; left: 0; padding: 0 15px; }
    .main-content { margin-right: 0; margin-left: 0; padding: 15px; }
    .footer { margin-right: 0; margin-left: 0; }
    
    .balance-badge span { display: none; } /* إخفاء نص الرقم للمساحة */
    .balance-badge::after { content: attr(data-balance); display: block; font-size: 13px; }
    .topbar-logo { font-size: 18px; }
}

.sidebar-overlay {
    position: fixed; inset: 0; background-color: rgba(0,0,0,0.5);
    z-index: 1050; display: none; opacity: 0; transition: opacity 0.3s;
}
.sidebar-overlay.show { display: block; opacity: 1; }


/* ===========================
   6. الأزرار (Buttons)
   =========================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 3px 10px rgba(40,203,105,0.35);
}
.btn-primary:hover {
    background-color: #22b25c;
    box-shadow: 0 5px 16px rgba(40,203,105,0.45);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    color: var(--brand);
    border: 1px solid #ced3df;
}
.btn-outline:hover {
    background-color: rgba(0,0,0,0.05);
}
.btn-outline-dark {
    border: 1px solid #ddd; color: #333; background: transparent;
}

.btn-block { width: 100%; }

.btn-danger {
    background-color: #e53935;
    color: #fff;
    box-shadow: 0 3px 10px rgba(229,57,53,0.35);
}
.btn-danger:hover {
    background-color: #c62828;
    box-shadow: 0 5px 16px rgba(229,57,53,0.45);
    transform: translateY(-1px);
}


/* ===========================
   7. هيرو / العناوين
   =========================== */

.hero {
    padding: 5px;
    margin-bottom: 24px;
}

.hero h1 { margin: 0 0 6px; font-size: 20px; color: var(--brand); }
.hero p { margin: 0; font-size: 13px; color: var(--text-muted); }

.home-section-title,
.page-title {
    font-size: 18px;
    margin: 20px 0 12px;
    color: var(--brand);
    font-weight: 700;
}


/* ===========================
   8. كروت الأقسام (Categories)
   =========================== */

.cards-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 991px) {
    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.card-media-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: radial-gradient(circle at 20% 20%, #ffe27a 0, #ffb347 35%, #f57f17 80%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}
.card-media-placeholder span {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
}

.category-card {
    display: block;
    background-color: transparent;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: none;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.category-card:hover {
    transform: translateY(-4px);
}

.category-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.category-card-image img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}

.category-card-title {
    text-align: center; padding: 5px 8px 4px; font-size: 15px; font-weight: 600; color: var(--brand);
}


/* ===========================
   9. كروت المنتجات (Products)
   =========================== */

.product-card {
    background-color: transparent;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-card-image {
    width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
}
.product-card-image img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}

.product-card-body {
    padding: 5px 12px 4px; text-align: center;
}

.product-card-name {
    font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--brand);
}

.product-card-desc {
    font-size: 13px; color: var(--text-muted); margin-bottom: 6px; min-height: 32px;
}

.product-card-price {
    font-weight: 700; font-size: 14px; color: var(--accent);
}


/* ===========================
   10. تفاصيل المنتج (Detail Page)
   =========================== */

.product-detail { margin-top: 10px; }

.product-detail-main {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
    gap: 20px;
    margin-bottom: 25px;
}
@media (max-width: 768px) {
    .product-detail-main { grid-template-columns: 1fr; }
}

.product-detail-image {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 10px;
}
.product-detail-image img {
    width: 100%; border-radius: var(--radius-md); object-fit: cover;
}

.product-detail-info {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 18px 16px 20px;
    text-align: right;
}

html[dir="ltr"] .product-detail-info {
    text-align: left;
}

.product-detail-title { font-size: 22px; margin-bottom: 8px; color: var(--brand); }
.product-detail-category { font-size: 14px; color: var(--text-muted); margin-bottom: 6px; }
.product-detail-category span { font-weight: 600; }
.product-detail-price { font-size: 16px; color: #333; margin-bottom: 12px; }
.product-detail-price span { font-size: 18px; font-weight: 700; color: var(--accent); }
.product-detail-desc h3 { font-size: 16px; margin-bottom: 6px; color: var(--brand); }
.product-detail-desc p { font-size: 14px; color: #444; line-height: 1.7; }
.product-detail-desc { margin-bottom: 15px; }
.product-detail-buy-form { margin-top: 10px; }
.product-detail-related { margin-top: 10px; }
.product-detail-related h2 { font-size: 18px; margin-bottom: 10px; color: var(--brand); text-align: right; }
html[dir="ltr"] .product-detail-related h2 { text-align: left; }


/* ===========================
   11. Auth / Admin / Panels
   =========================== */

.auth-card,
.admin-panel {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 18px 16px 20px;
    margin-bottom: 18px;
}

.auth-card h2, .admin-panel h2 { margin: 0 0 10px; font-size: 18px; color: var(--brand); }
.admin-title { font-size: 20px; margin: 4px 0 16px; color: var(--brand); }

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
    gap: 18px;
}
@media (max-width: 900px) {
    .admin-grid { grid-template-columns: 1fr; }
}

.admin-actions { margin: 10px 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }


/* ===========================
   12. الفورمات (Forms)
   =========================== */

.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 4px; color: #333; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #ced3df;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    background-color: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(12,48,91,0.12);
    background-color: #ffffff;
}
textarea { resize: vertical; }


/* ===========================
   13. التنبيهات والجداول
   =========================== */

.alert { border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }
.alert-error { background-color: #ffe7e7; color: #b40b0b; border: 1px solid #f3b7b7; }
.alert-success { background-color: #e4f8ec; color: #1c7a46; border: 1px solid #b3e4c6; }

.table-wrapper { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 650px; font-size: 13px; }
.data-table thead { background-color: #f0f3f9; }
.data-table th, .data-table td { padding: 8px 10px; border-bottom: 1px solid #e1e4ee; text-align: right; }

html[dir="ltr"] .data-table th,
html[dir="ltr"] .data-table td {
    text-align: left;
}

.data-table th { font-weight: 600; color: #334; }
.data-table tr:hover td { background-color: #fafbff; }


/* ===========================
   14. المودال (شراء المنتج)
   =========================== */

.modal-overlay {
    position: fixed; inset: 0; background-color: rgba(0,0,0,0.55);
    display: none; align-items: center; justify-content: center; z-index: 9999;
}
.modal-overlay.is-visible { display: flex; }

.modal-box {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 95%;
    box-shadow: var(--shadow-soft-strong);
    overflow: visible;
}

.modal-header {
    display: flex; justify-content: end; align-items: center;
    padding: 10px 14px; border-bottom: 1px solid #eee; color: #fff;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close { border: none; background: transparent; font-size: 20px; cursor: pointer; line-height: 1; padding: 0 4px; color: #000000; }

.modal-body { padding: 12px 14px 16px; text-align: center; }

.modal-product-top {
    display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 12px;
}
.modal-product-info { width: 100%; }

.modal-product-name {
    font-size: 18px; font-weight: 700; margin-bottom: 4px; color: var(--brand); text-align: center;
}
.modal-product-price {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 12px; border-radius: 999px;
    background-color: rgba(40,203,105,0.08); color: var(--accent);
    font-size: 13px; font-weight: 700; margin-bottom: 6px;
}
.modal-product-desc { font-size: 13px; color: var(--text-muted); text-align: center; }

.modal-form .form-group { margin-bottom: 10px; text-align: right; }
html[dir="ltr"] .modal-form .form-group { text-align: left; }

.modal-form label { display: block; margin-bottom: 4px; font-size: 13px; }
.modal-form textarea {
    width: 100%; border-radius: 10px; border: 1px solid #ccc;
    padding: 8px; resize: vertical; min-height: 70px; font-size: 13px;
}


/* ===========================
   15. حقول الكمية المتقدمة (داخل المودال)
   =========================== */

.qty-group { margin-top: 6px; position: relative; }
.qty-group label { font-weight: 600; color: #222; }

.qty-input {
    height: 44px; border-radius: 999px; padding-inline: 14px; font-size: 14px;
    border: 1px solid #ced3df; background-color: #fdfdff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, transform 0.08s ease;
    text-align: center; font-weight: 600;
}
.qty-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(40,203,105,0.20);
    background-color: #ffffff;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input[type="number"] { -moz-appearance: textfield; }

.qty-select-native {
    position: absolute; inset-inline-start: 0; bottom: 0;
    width: 1px; height: 1px; opacity: 0; pointer-events: none;
}

.qty-custom-select { margin-top: 2px; position: relative; }

.qty-custom-toggle {
    width: 100%; height: 44px; border-radius: 999px;
    border: 1px solid #ced3df; background-color: #fdfdff;
    padding-inline: 14px; display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; font-family: inherit; font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.qty-custom-toggle:hover { background-color: #ffffff; }
.qty-custom-select.is-open .qty-custom-toggle {
    border-color: var(--accent); box-shadow: 0 0 0 2px rgba(40,203,105,0.18); background-color: #ffffff;
}

.qty-custom-label { color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.qty-custom-arrow {
    width: 12px; height: 12px; border-right: 2px solid #0c305b; border-bottom: 2px solid #0c305b;
    transform: rotate(45deg); transition: transform 0.15s ease; margin-inline-start: 8px;
}
.qty-custom-select.is-open .qty-custom-arrow { transform: rotate(-135deg); }

.qty-custom-list {
    position: absolute; inset-inline: 0; top: calc(100% + 6px);
    background-color: #ffffff; border-radius: 14px;
    box-shadow: var(--shadow-soft-strong); max-height: 220px; overflow-y: auto;
    padding: 4px 0; opacity: 0; visibility: hidden;
    transform: translateY(4px); pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 20;
}
.qty-custom-select.is-open .qty-custom-list {
    opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}

.qty-custom-option {
    padding: 8px 14px; font-size: 14px; cursor: pointer; text-align: right; color: #333;
}
html[dir="ltr"] .qty-custom-option { text-align: left; }

.qty-custom-option:hover { background-color: #f4f6fb; color: var(--brand); }
.qty-custom-option.is-selected { background-color: rgba(40,203,105,0.08); color: var(--accent); font-weight: 600; }

.qty-custom-list { scroll-behavior: smooth; }
.qty-custom-list::-webkit-scrollbar { width: 6px; }
.qty-custom-list::-webkit-scrollbar-track { background: #f0f2f7; border-radius: 999px; }
.qty-custom-list::-webkit-scrollbar-thumb { background: #c1c7d6; border-radius: 999px; }
.qty-custom-list::-webkit-scrollbar-thumb:hover { background: #a4acc0; }

.qty-hint { margin-top: 4px; font-size: 12px; color: #888 !important; }

.modal-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: center; }
.modal-actions .btn-block { width: auto; flex: 1 1 0; height: 48px;}


/* ===========================
   16. كرت الزائر في السايدبار
   =========================== */

.sidebar-guest-card {
    background-color: #0c305b;
    color: #ffffff;
    border-radius: 18px;
    padding: 18px 16px 16px;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.sidebar-guest-card .guest-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
}

.sidebar-guest-card .guest-text {
    margin: 0 0 12px;
    font-size: 13px;
    color: #e4ecf5;
}

.sidebar-guest-card .guest-actions .btn {
    margin-bottom: 6px;
}

.sidebar-guest-card .btn-outline {
    border-color: #ffffff;
    color: #ffffff;
}
.sidebar-guest-card .btn-outline:hover {
    background-color: rgba(255,255,255,0.08);
}


/* ===========================
   17. رسالة النتيجة داخل مودال المنتج
   =========================== */

.modal-result-message {
    padding: 12px 14px;
    margin: 0 0 10px 0;

    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.04);

    background: rgba(12, 48, 91, 0.03);
    color: #333;

    font-size: 0.9rem;
    line-height: 1.6;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* اتجاه الرسالة حسب اللغة */
html[dir="rtl"] .modal-result-message {
    direction: rtl;
    text-align: right;
}

html[dir="ltr"] .modal-result-message {
    direction: ltr;
    text-align: left;
}

/* النصوص العادية داخل الرسالة */
.modal-result-message p {
    margin: 0 0 6px 0;
}

/* الليست تبع الأخطاء */
.modal-result-message ul {
    padding-right: 18px;
    margin: 0;
}
html[dir="ltr"] .modal-result-message ul {
    padding-right: 0;
    padding-left: 18px;
}

.modal-result-message li {
    margin-bottom: 4px;
}

/* ✅ حالة النجاح */
.modal-result-message.is-success {
    border-color: rgba(40, 203, 105, 0.4);
    background: rgba(40, 203, 105, 0.06);
    color: #1e824c;
}

/* ✅ أيقونة النجاح قبل أول سطر */
.modal-result-message.is-success p:first-child::before {
    content: "✅";
    display: inline-block;
    margin-left: 6px;
    font-size: 1rem;
}

/* ❌ حالة الخطأ */
.modal-result-message.is-error {
    border-color: rgba(231, 76, 60, 0.35);
    background: rgba(231, 76, 60, 0.06);
    color: #b3342b;
}

/* ❌ أيقونة الخطأ قبل أول سطر */
.modal-result-message.is-error p:first-child::before {
    content: "❌";
    display: inline-block;
    margin-left: 6px;
    font-size: 1rem;
}


/* ===========================
   18. Smooth + Nice Scroll
   =========================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body,
.sidebar-nav,
.table-wrapper,
.qty-custom-list {
  -webkit-overflow-scrolling: touch;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(12, 48, 91, 0.35) rgba(12, 48, 91, 0.08);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(12, 48, 91, 0.08);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(12, 48, 91, 0.35);
  border-radius: 999px;
  border: 2px solid rgba(12, 48, 91, 0.08);
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(12, 48, 91, 0.55);
}

*::-webkit-scrollbar-thumb:active {
  background: rgba(40, 203, 105, 0.55);
}

.sidebar-nav,
.table-wrapper,
.qty-custom-list {
  overscroll-behavior: contain;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
