/* base.css — externalized from templates/base.html inline <style> blocks (perf: browser-cacheable across pages) */

/* --- Tawk.io styles + discount-label direction fallbacks (from base.html block 1) --- */
        /* Fallback مباشر بناءً على اتجاه/لغة الصفحة (لتجاوز cache CSS) */
        html[dir="ltr"] .products-container .product-card[data-has-discount="true"]::before,
        html[dir="ltr"] .product-card[data-has-discount="true"]::before {
            content: "Special Offer" !important;
        }
        html[dir="rtl"] .products-container .product-card[data-has-discount="true"]::before,
        html[dir="rtl"] .product-card[data-has-discount="true"]::before {
            content: "عرض خاص" !important;
        }
        /* تحسينات إضافية للتكامل مع التصميم العام */
        body {
            --tawk-primary-color: #872838;
            --tawk-primary-hover: #871f30;
            --tawk-shadow-color: rgba(135, 40, 56, 0.4);
        }
        
        /* تأكيد إخفاء العناصر القديمة */
        .es-chat-floating-icon,
        .floating-support-icon,
        .support-icon,
        [class*="chat-icon"],
        [class*="support-floating"] {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
        }
        
        /* تحسينات الأداء */
        #tawk-bubble {
            contain: layout style paint;
            isolation: isolate;
        }
        
        /* تحسين التجربة مع المودال */
        .modal-open #tawk-bubble {
            opacity: 0.9 !important;
            z-index: 2147483646 !important;
        }
        
        .search-overlay.active ~ #tawk-bubble {
            opacity: 0.9 !important;
        }
        
        /* منع تداخل مع عناصر الموقع */
        body {
            padding-bottom: 0 !important;
        }
        
        /* تحسين للشاشات عالية الدقة */
        @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
            #tawk-bubble {
                border-width: 2px !important;
            }
        }

/* --- General styles: login button, sidebar, keyframes (from base.html block 2) --- */
        
        /* Flash messages styles */
        
        /* تحسينات زر تسجيل الدخول في الهيدر */
        .login-btn-header {
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
            position: relative !important;
            overflow: hidden !important;
        }
        
        .login-btn-header::before {
            content: '' !important;
            position: absolute !important;
            top: 50% !important;
            left: 50% !important;
            width: 0 !important;
            height: 0 !important;
            background: rgba(255, 255, 255, 0.3) !important;
            border-radius: 50% !important;
            transition: all 0.6s ease !important;
            transform: translate(-50%, -50%) !important;
        }
        
        .login-btn-header:hover::before {
            width: 300px !important;
            height: 300px !important;
        }
        
        .login-btn-header:hover {
            transform: translateY(-3px) scale(1.05) !important;
            box-shadow: 0 8px 25px rgba(135, 40, 56, 0.5) !important;
            background: linear-gradient(135deg, #ff1a4a 0%, #ff4d7a 50%, #d9003d 100%) !important;
        }
        
        .login-btn-header:active {
            transform: translateY(-1px) scale(1.02) !important;
            box-shadow: 0 4px 15px rgba(135, 40, 56, 0.4) !important;
        }
        
        /* تأثير النقر */
        .login-btn-header:focus {
            outline: none !important;
            box-shadow: 0 0 0 4px rgba(135, 40, 56, 0.3) !important;
        }
        
        /* تأثير الـ Glassmorphism */
        .sidebar {
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
        }
        
        /* إضافة نمط للنصوص */
        .sidebar-header p {
            margin: 5px 0 0 0;
            font-size: 14px;
            opacity: 0.9;
            font-weight: 500;
        }
        
        /* تحسين الخطوط والقراءة */
        .sidebar * {
            text-rendering: optimizeLegibility;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }
        
        /* إضافة تأثير الانعكاس */
        .sidebar .login-btn {
            position: relative;
        }
        
        /* إضافة أنماط التأثيرات الجديدة */
        @keyframes buttonPulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }
        
        .particle {
            will-change: transform, opacity;
        }
        
        @keyframes morphBackground {
            0%, 100% {
                transform: rotate(0deg) scale(1);
            }
            25% {
                transform: rotate(90deg) scale(1.1);
            }
            50% {
                transform: rotate(180deg) scale(0.9);
            }
            75% {
                transform: rotate(270deg) scale(1.1);
            }
        }
        
        /* تحسين الانتقالات للعناصر */
        .sidebar * {
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

/* --- Dropdown navigation + language toggle + mobile sheet (from base.html block 4) --- */
        .nav-dropdown { position: relative; display: inline-flex; }
        .nav-dropdown-trigger { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
        .nav-chevron { font-size: 10px; transition: transform 0.3s ease; opacity: 0.7; }
        .nav-dropdown:hover .nav-chevron { transform: rotate(180deg); opacity: 1; }
        .nav-dropdown-menu {
            position: absolute; top: 100%; right: 0; min-width: 220px;
            background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
            border: 1px solid rgba(135, 40, 56, 0.3); border-radius: 12px;
            box-shadow: 0 15px 40px rgba(0,0,0,0.5); padding: 8px 0;
            opacity: 0; visibility: hidden; transform: translateY(10px);
            transition: all 0.3s ease; z-index: 1000;
        }
        .nav-dropdown:hover .nav-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
        .nav-dropdown-menu .dropdown-item {
            display: flex; align-items: center; gap: 10px; padding: 10px 18px;
            color: #ddd; text-decoration: none; font-size: 14px; transition: all 0.2s ease;
        }
        .nav-dropdown-menu .dropdown-item:hover { background: rgba(135, 40, 56, 0.15); color: #872838; }
        .nav-dropdown-menu .dropdown-item i { width: 18px; text-align: center; color: #872838; font-size: 13px; }
        .nav-dropdown-menu .dropdown-view-all {
            border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 4px; font-weight: 600; color: #872838;
        }
        .lang-toggle-btn {
            display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
            border-radius: 20px; border: 1px solid rgba(255,255,255,0.2);
            background: rgba(255,255,255,0.08); color: #fff; font-weight: 600;
            font-size: 13px; cursor: pointer; text-decoration: none; transition: all 0.3s ease;
        }
        .lang-toggle-btn:hover { background: rgba(135, 40, 56, 0.2); border-color: #872838; color: #872838; }
        /* Mobile: disable hover, use tap via JS */
        @media (max-width: 952px) {
            .nav-dropdown { flex-shrink: 0; }
            .nav-dropdown-trigger {
                padding: 8px 14px; font-size: 13px; min-width: max-content;
                background: rgba(255, 255, 255, 0.05); border-radius: 20px;
                border: 1px solid rgba(255, 255, 255, 0.1); color: #fff; text-decoration: none;
            }
            .nav-dropdown:hover .nav-dropdown-menu { opacity: 0; visibility: hidden; }
            .nav-dropdown-menu .dropdown-item { padding: 14px 20px; font-size: 15px; }
        }
        /* Mobile bottom-sheet dropdown (appended to body via JS) */
        .mobile-dropdown-sheet {
            position: fixed; bottom: 0; left: 0; right: 0; width: 100%;
            max-height: 60vh; overflow-y: auto; border-radius: 16px 16px 0 0;
            background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
            border: 1px solid rgba(135, 40, 56, 0.3); border-bottom: none;
            box-shadow: 0 -10px 40px rgba(0,0,0,0.6); padding: 8px 0;
            z-index: 10000; transform: translateY(100%);
            transition: transform 0.3s ease;
        }
        .mobile-dropdown-sheet.active { transform: translateY(0); }
        .mobile-dropdown-sheet .dropdown-item {
            display: flex; align-items: center; gap: 10px; padding: 14px 20px;
            color: #ddd; text-decoration: none; font-size: 15px; transition: background 0.2s;
        }
        .mobile-dropdown-sheet .dropdown-item:hover { background: rgba(135, 40, 56, 0.15); color: #872838; }
        .mobile-dropdown-sheet .dropdown-item i { width: 18px; text-align: center; color: #872838; }
        .mobile-dropdown-sheet .dropdown-view-all {
            border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 4px; font-weight: 600; color: #872838;
        }
        .mobile-dropdown-overlay {
            display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5); z-index: 9998;
        }
        .mobile-dropdown-overlay.active { display: block; }

/* --- WhatsApp float (from base.html block 5) --- */
.whatsapp-float-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(45deg, #872838, #a04258, #872838);
  color: white;
  font-size: 28px;
  width: 60px;
  height: 60px;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  text-align: center;
  z-index: 100000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease;
}

.whatsapp-float {
  color: white;
}
