/* 
 * ملف CSS الرئيسي - متجر Notifier للحماية من الحرائق
 * يدعم الاتجاهين العربي والإنجليزي
 */

/* ===============================
   متغيرات CSS
   =============================== */
:root {
    --primary-color: #0066cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    --font-family-ar: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-family-en: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ===============================
   إعدادات الخط والاتجاه
   =============================== */
body {
    font-family: var(--font-family-en);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #fff;
}

body.rtl {
    font-family: var(--font-family-ar);
    direction: rtl;
    text-align: right;
}

body.ltr {
    direction: ltr;
    text-align: left;
}

/* ===============================
   مكونات Bootstrap المخصصة
   =============================== */
.btn {
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--box-shadow);
}

.card {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ===============================
   الهيدر والتنقل
   =============================== */
.top-bar {
    font-size: 0.875rem;
    position: relative; /* ضروري لعمل z-index */
    z-index: 1030;      /* رقم أعلى من 1020 الخاص بالهيدر */
}


.main-header {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1020;
    background: white !important;
}

.logo img {
    max-height: 60px;
    width: auto;
}

.search-form .form-control {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    border-right: none;
}

.search-form .btn {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    border-left: none;
}

.main-nav {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.nav-pills .nav-link {
    color: var(--dark-color);
    border-radius: var(--border-radius);
    margin-left: 5px;
    margin-right: 5px;
    transition: var(--transition);
}

.nav-pills .nav-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-menu {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: none;
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
}

/* ===============================
   الصفحة الرئيسية
   =============================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004499 100%);
    min-height: 500px;
    display: flex;
    align-items: center;
}

.hero-content h1 {
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-image img {
    border-radius: var(--border-radius-lg);
}

.features-section {
    padding: 80px 0;
}

.feature-box {
    text-align: center;
    padding: 30px 20px;
    height: 100%;
}

.feature-icon {
    margin-bottom: 20px;
}

.feature-icon i {
    color: var(--primary-color);
}

/* ===============================
   بطاقات المنتجات
   =============================== */
.product-card .card {
    height: 100%;
    transition: var(--transition);
    overflow: hidden;
}

.product-card .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    background: var(--light-color);
    height: 250px;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badges {
    z-index: 10;
}

.product-badges .badge {
    font-size: 0.7rem;
    border-radius: var(--border-radius);
}

.product-actions {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
}

.product-actions .btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 5px;
}

.product-name a {
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
}

.product-name a:hover {
    color: var(--primary-color);
}

.rating-stars {
    display: inline-flex;
    gap: 2px;
}

.rating-stars i {
    font-size: 0.9rem;
}

/* ===============================
   صفحة المنتجات والفلترة
   =============================== */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004499 100%);
}

.filters-sidebar .card {
    position: sticky;
    top: 100px;
}

.filter-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-options {
    max-height: 200px;
    overflow-y: auto;
}

.filter-options::-webkit-scrollbar {
    width: 4px;
}

.filter-options::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.filter-options::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

/* ===============================
   عربة التسوق
   =============================== */
.cart-item img {
    border-radius: var(--border-radius);
}

.quantity-controls {
    display: flex;
    align-items: center;
}

.quantity-controls button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
}

.quantity-controls input {
    width: 60px;
    text-align: center;
    border: 1px solid #dee2e6;
    border-left: 0;
    border-right: 0;
}

.quantity-controls button:first-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.quantity-controls button:last-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.cart-summary .card-header {
    background: var(--primary-color) !important;
}

.summary-row {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-total {
    background: rgba(0, 102, 204, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

/* ===============================
   الفوتر
   =============================== */
.main-footer {
    background: var(--dark-color) !important;
    color: white;
}

.footer-title {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.social-icons {
    display: flex;
    gap: 10px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.payment-icon {
    height: 30px;
    margin-right: 10px;
    background: white;
    padding: 5px;
    border-radius: var(--border-radius);
}

/* ===============================
   أزرار الطفو
   =============================== */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--box-shadow);
}

.back-to-top:hover {
    background: #004499;
    transform: translateY(-2px);
}

.whatsapp-float {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
}

.whatsapp-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25d366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    animation: pulse 2s infinite;
}

.whatsapp-btn:hover {
    background: #128c7e;
    color: white;
    transform: scale(1.1);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* ===============================
   إشعارات الكوكيز
   =============================== */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark-color);
    color: white;
    padding: 1rem 0;
    z-index: 1050;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* ===============================
   حالات فارغة
   =============================== */
.empty-state {
    padding: 60px 20px;
}

.empty-state i {
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto 2rem;
}

/* ===============================
   التحميل
   =============================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    color: white;
}

/* ===============================
   التصفح (Pagination)
   =============================== */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
    border-radius: var(--border-radius);
    margin: 0 2px;
}

.pagination .page-link:hover {
    color: white;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===============================
   النماذج
   =============================== */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.form-select {
    border-radius: var(--border-radius);
}

/* ===============================
   التنبيهات
   =============================== */
.alert {
    border-radius: var(--border-radius);
    border: none;
}

/* ===============================
   وسائط متجاوبة
   =============================== */
@media (max-width: 768px) {
    .hero-section {
        min-height: 400px;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .features-section {
        padding: 60px 0;
    }
    
    .product-image-container {
        height: 200px;
    }
    
    .product-actions {
        opacity: 1;
    }
    
    .back-to-top {
        right: 15px;
        bottom: 15px;
        width: 45px;
        height: 45px;
    }
    
    .whatsapp-float {
        right: 15px;
        bottom: 70px;
    }
    
    .whatsapp-btn {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .main-nav {
        display: none !important;
    }
    
    .search-form {
        margin: 1rem 0;
    }
    
    .cart-summary {
        margin-top: 2rem;
    }
    
    .filter-options {
        max-height: 150px;
    }
    
    .pagination {
        justify-content: center;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .product-image-container {
        height: 180px;
    }
    
    .feature-box {
        padding: 20px 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* ===============================
   إضافات خاصة
   =============================== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004499 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004499 100%);
}

.border-primary-light {
    border-color: rgba(0, 102, 204, 0.3) !important;
}

.shadow-hover {
    transition: var(--transition);
}

.shadow-hover:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* ===============================
   تحسينات الأداء
   =============================== */
.product-image,
.hero-image img,
.feature-icon i {
    will-change: transform;
}

.card,
.btn,
.product-card {
    will-change: transform, box-shadow;
}

/* ===============================
   إمكانية الوصول
   =============================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* تحسين التنقل بلوحة المفاتيح */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* تحسين التباين للنصوص */
.text-muted {
    color: #6c757d !important;
}

.bg-light .text-muted {
    color: #495057 !important;
}

/* ===============================
   طباعة
   =============================== */
@media print {
    .main-header,
    .main-nav,
    .main-footer,
    .back-to-top,
    .whatsapp-float,
    .cookie-consent {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .btn {
        color: #000 !important;
        background: none !important;
        border: 1px solid #000 !important;
    }
}
