:root {
    --primary: #1e3d2f;
    --primary-light: #2c5e3b;
    --accent: #d4a373;
    --bg-main: #f4f6f5;
    --white: #ffffff;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.1);
    --radius: 16px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    direction: rtl;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    padding-bottom: 100px; /* هامش سفلي لشريط التنقل وزر السلة */
}

/* ==========================================
   خلفيات متحركة وتأثيرات بصرية شاملة
========================================== */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212,163,115,0.08) 0%, rgba(30,61,47,0.03) 50%, transparent 70%);
    z-index: -3;
    pointer-events: none;
    animation: lightPulse 8s ease-in-out infinite alternate;
}

@keyframes lightPulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.1); opacity: 1; }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    opacity: 0;
    z-index: -1;
    pointer-events: none;
    animation: lightningFlash 12s infinite;
}

@keyframes lightningFlash {
    0%, 92%, 96%, 100% { opacity: 0; }
    93%, 97% { opacity: 1; }
    94% { opacity: 0.3; }
}

.smoke-bg {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" opacity="0.03"><filter id="blur"><feGaussianBlur stdDeviation="20"/></filter><circle cx="200" cy="200" r="100" fill="%231e3d2f" filter="url(%23blur)"/></svg>');
    z-index: -2;
    pointer-events: none;
    animation: smokeDrift 20s linear infinite;
}

@keyframes smokeDrift {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}

.bg-logo-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 350px;
    opacity: 0.04;
    background-image: url('logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: -4;
    pointer-events: none;
    animation: logoFloat 10s ease-in-out infinite alternate;
}

@keyframes logoFloat {
    0% { transform: translate(-50%, -52%) rotate(0deg) scale(1); }
    100% { transform: translate(-50%, -48%) rotate(2deg) scale(1.03); }
}

/* ==========================================
   الهيدر الرئيسي والبحث
========================================== */
.main-header {
    background: var(--primary);
    color: var(--white);
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-area i {
    font-size: 1.8rem;
    color: var(--accent);
}

.logo-area h1 {
    font-size: 1.25rem;
    font-weight: 900;
    white-space: nowrap;
}

.search-box {
    flex: 1;
    max-width: 420px;
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 30px;
    padding: 0 16px;
    border: 1px solid transparent;
    transition: 0.3s;
}

.search-box:focus-within {
    background: var(--white);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.2);
}

.search-box .search-icon {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-left: 8px;
}

.search-box input {
    width: 100%;
    border: none;
    padding: 9px 0;
    outline: none;
    background: transparent;
    font-size: 0.88rem;
    color: var(--text-dark);
}

.user-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-btn, .btn-login-main {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.82rem;
    transition: 0.3s;
    white-space: nowrap;
    position: relative;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--white);
    color: var(--primary);
}

.btn-login-main {
    background: var(--accent);
    border-color: var(--accent);
}

.admin-badge {
    background: rgba(212, 163, 115, 0.25);
    border-color: var(--accent);
}

.action-btn .badge {
    background: #ef4444;
    color: var(--white);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: bold;
}

/* ==========================================
   شريط الأقسام الأفقية
========================================== */
.categories-nav {
    background: var(--white);
    padding: 12px 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    overflow-x: auto;
    scrollbar-width: none;
}

.categories-nav::-webkit-scrollbar {
    display: none;
}

.cat-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.cat-chip {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.cat-chip.active, .cat-chip:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(30, 61, 47, 0.2);
}

/* ==========================================
   المحتوى الرئيسي والبنرات
========================================== */
.app-main {
    max-width: 1300px;
    margin: 20px auto;
    padding: 0 15px;
}

.hero-banner {
    background: linear-gradient(135deg, rgba(30, 61, 47, 0.95), rgba(44, 94, 59, 0.88)), url('https://images.unsplash.com/photo-1500595046743-cd271d694d30?auto=format&fit=crop&w=1200&q=80');
    background-size: cover;
    background-position: center;
    border-radius: var(--radius);
    padding: 28px 24px;
    color: var(--white);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.hero-content h2 {
    font-size: 1.6rem;
    margin-bottom: 6px;
    font-weight: 900;
}

.hero-content p {
    font-size: 0.92rem;
    opacity: 0.92;
}

.dynamic-carousel-card {
    background: var(--white);
    padding: 12px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    border-right: 5px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.carousel-icon-box {
    font-size: 1.8rem;
    color: var(--accent);
}

.carousel-badge {
    background: #eef7f2;
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.section-title {
    margin-bottom: 15px;
}

.section-title h3 {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 800;
}

.section-title span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================
   شبكة المنتجات وبطاقات العرض
========================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(229, 231, 235, 0.7);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(44, 94, 59, 0.3);
}

.product-media-wrapper {
    position: relative;
    width: 100%;
    height: 190px;
    background: #f9fafb;
    overflow: hidden;
}

.product-media-wrapper img, 
.product-media-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-media-wrapper img {
    transform: scale(1.05);
}

.product-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.product-info h3 {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 6px;
}

.product-price {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--primary);
}

.btn-add-cart-icon {
    background: var(--primary);
    color: var(--white);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s ease;
    box-shadow: 0 3px 8px rgba(30, 61, 47, 0.25);
}

.btn-add-cart-icon:hover {
    background: var(--primary-light);
    transform: scale(1.08);
}

/* ==========================================
   شريط التنقل السفلي المطور وزر السلة العائم
========================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 0 10px;
}

.bottom-nav .nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    gap: 3px;
    transition: all 0.2s ease;
    flex: 1;
}

.bottom-nav .nav-item i {
    font-size: 1.25rem;
}

.bottom-nav .nav-item.active {
    color: var(--primary);
    font-weight: 800;
}

.nav-cart-floating-wrapper {
    position: relative;
    top: -18px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-cart-floating {
    background: var(--primary);
    color: var(--white);
    border: 4px solid var(--white);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(30, 61, 47, 0.35);
    transition: transform 0.25s ease, background 0.25s ease;
    position: relative;
}

.nav-cart-floating i {
    font-size: 1.35rem;
}

.nav-cart-floating:active {
    transform: scale(0.92);
}

.cart-floating-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 900;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

/* ==========================================
   سلة المشتريات والبطاقات التفاعلية
========================================== */
.cart-modal-container {
    max-width: 540px !important;
    border-radius: 20px !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 88vh;
}

.cart-modal-body {
    padding: 16px;
    background: #f8faf9;
    max-height: 52vh;
    overflow-y: auto;
}

.cart-items-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid #edf2f0;
}

.cart-item-img {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    object-fit: cover;
    background: #f3f4f6;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary);
}

.cart-qty-controls {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 20px;
    padding: 2px 6px;
    gap: 8px;
}

.btn-qty {
    background: var(--white);
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.qty-val {
    font-size: 0.85rem;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

.btn-remove-item {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 6px;
    font-size: 1rem;
    opacity: 0.8;
    transition: 0.2s;
}

.btn-remove-item:hover {
    opacity: 1;
}

.cart-modal-footer {
    background: var(--white);
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.cart-summary-card {
    background: #f8faf9;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #e2ece7;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.summary-row.total {
    font-size: 1.05rem;
    color: var(--text-dark);
    font-weight: 800;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d1d5db;
}

.total-price {
    color: var(--primary);
    font-size: 1.2rem;
}

.payment-method-box {
    margin-top: 10px;
}

.payment-method-box label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.styled-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--white);
    font-size: 0.85rem;
    outline: none;
}

.btn-checkout {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(30, 61, 47, 0.25);
    transition: background 0.2s;
}

.btn-checkout:hover {
    background: var(--primary-light);
}

/* ==========================================
   النوافذ المنبثقة العامة (Modals)
========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-container {
    background: var(--white);
    border-radius: var(--radius);
    width: 92%;
    max-width: 480px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.modal-header {
    background: var(--primary);
    color: var(--white);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal, .close-auth-modal, .close-prod-modal, .close-invoice-modal, .close-notif-modal, .close-rfq-modal {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--white);
    transition: opacity 0.2s;
}

.close-modal:hover, .close-auth-modal:hover, .close-prod-modal:hover, .close-invoice-modal:hover, .close-notif-modal:hover, .close-rfq-modal:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 18px;
    max-height: 60vh;
    overflow-y: auto;
}

/* ==========================================
   قسم التصدير للجملة B2B أزرار التواصل
========================================== */
#exportRfqModal .modal-container {
    max-width: 550px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 14px 45px rgba(0,0,0,0.25);
}

#rfqWhatsAppBtn, #rfqCallBtn {
    transition: transform 0.2s ease, filter 0.2s ease;
}

#rfqWhatsAppBtn:hover, #rfqCallBtn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

#rfqWhatsAppBtn:active, #rfqCallBtn:active {
    transform: translateY(0);
}

/* زر تسجيل الدخول بجوجل */
.btn-google {
    background: #ffffff;
    color: #444;
    border: 1px solid #ddd;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: 0.3s;
}

.btn-google:hover {
    background: #f8f9fa;
}

.btn-google i {
    color: #4285F4;
    font-size: 1.1rem;
}

/* ==========================================
   تنسيق الفاتورة والطباعة وحفظ الصور
========================================== */
@page {
    size: auto;
    margin: 5mm;
}

#printableInvoiceContent {
    background: #ffffff !important;
    color: #222222 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 0.9rem;
}

#printableInvoiceContent table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 15px 0 !important;
}

#printableInvoiceContent th, 
#printableInvoiceContent td {
    padding: 8px !important;
    border: 1px solid #ddd !important;
    text-align: center !important;
}

@media print {
    body * {
        visibility: hidden !important;
    }
    #printableInvoiceContent, 
    #printableInvoiceContent * {
        visibility: visible !important;
    }
    #printableInvoiceContent {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        padding: 15px !important;
        background: #ffffff !important;
        box-shadow: none !important;
    }
}

.invoice-actions-container {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
}

.btn-invoice-action {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.btn-invoice-action:active {
    opacity: 0.85;
}

.btn-save-img {
    background: var(--accent);
    color: #ffffff;
}

.btn-print {
    background: var(--primary);
    color: #ffffff;
}

.btn-close-inv {
    background: #666666;
    color: #ffffff;
}

/* ==========================================
   لوحة تحكم المدير وتنسيق النماذج
========================================== */
.admin-header {
    margin-bottom: 20px;
}

.admin-header h2 {
    color: var(--primary);
    font-size: 1.5rem;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 6px;
    scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    transition: 0.3s;
    flex-shrink: 0;
}

.tab-btn.active, .tab-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.form-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-card h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

.input-group input, .input-group select, .input-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    background: #fafafa;
    font-size: 0.9rem;
}

.btn-submit {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px;
    width: 100%;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s opacity;
}

.btn-submit:active {
    opacity: 0.85;
}

.data-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.data-item {
    background: var(--white);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-right: 4px solid var(--primary);
    font-size: 0.9rem;
}

/* ==========================================
   مركز المحادثات والشات المباشر (Live Chat System)
========================================== */
.admin-chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 15px;
    margin-top: 15px;
}

.admin-conversations-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 12px;
    height: 500px;
    display: flex;
    flex-direction: column;
}

.admin-conversations-card h4 {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

#adminConversationsList {
    flex: 1;
    overflow-y: auto;
}

.admin-chat-box {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 500px;
    overflow: hidden;
}

.admin-chat-header {
    background: var(--primary);
    color: var(--white);
    padding: 12px 15px;
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-client-phone-badge {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.admin-chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8faf9;
}

.admin-chat-footer {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: var(--white);
    border-top: 1px solid var(--border-color);
}

.admin-chat-footer input {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    outline: none;
}

.admin-chat-footer button {
    width: auto;
    padding: 10px 20px;
}

#userChatMessages, 
#adminChatMessages, 
#adminConversationsList {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#userChatMessages::-webkit-scrollbar, 
#adminChatMessages::-webkit-scrollbar, 
#adminConversationsList::-webkit-scrollbar {
    width: 6px;
}

#userChatMessages::-webkit-scrollbar-thumb, 
#adminChatMessages::-webkit-scrollbar-thumb, 
#adminConversationsList::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

/* ==========================================
   حساب العميل والخرائط (Leaflet)
========================================== */
.profile-card-header {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.profile-box {
    background: var(--white);
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.profile-box h3 {
    margin-bottom: 12px;
    color: var(--primary);
}

.leaflet-container {
    z-index: 1 !important;
    touch-action: pan-x pan-y pinch-zoom;
}

#userMap, #adminMap {
    width: 100%;
    min-height: 280px;
    border-radius: 12px;
    overflow: hidden;
}

.leaflet-control-rotate {
    background: #ffffff;
    border-radius: 50% !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25) !important;
    border: 2px solid var(--primary) !important;
}

.leaflet-control-rotate button {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   التجاوب المحسّن والشامل مع الهواتف المحمولة
========================================== */
@media(max-width: 768px) {
    .main-header {
        padding: 0.5rem 0.8rem;
    }

    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .logo-area {
        justify-content: center;
    }

    .logo-area h1 {
        font-size: 1.1rem;
    }

    .search-box {
        max-width: 100%;
        padding: 0 12px;
    }

    .search-box input {
        padding: 6px 0;
        font-size: 0.82rem;
    }

    .user-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }

    .action-btn, .btn-login-main {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .product-media-wrapper {
        height: 130px;
    }

    .product-info h3 {
        font-size: 0.88rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .admin-tabs {
        justify-content: flex-start;
        padding-bottom: 8px;
    }

    .tab-btn {
        font-size: 0.78rem;
        padding: 6px 12px;
    }

    #exportRfqModal .modal-container {
        width: 95%;
        margin: 10px;
    }

    /* تجاوب الشات المباشر على الهاتف */
    .admin-chat-layout {
        grid-template-columns: 1fr;
    }

    .admin-conversations-card {
        height: 200px;
    }

    .admin-chat-box, #userChatContainer {
        height: 420px !important;
    }
}
