/* أنماط الهيدر - Caza Souq */

body {
    font-family: 'Tajawal', sans-serif;
    background-color: #f8f9fa;
    direction: rtl;
    text-align: right;
}

/* أنماط هيدر الموبايل الجديد */
.mobile-header-container {
    width: 100%;
}

/* الشريط العلوي الرفيع */
.mobile-top-bar {
    background-color: #f5f5f5;
    height: 36px;
    width: 100%;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1029;
    position: relative;
}

.mobile-top-bar .container-fluid {
    padding: 0 10px;
    height: 100%;
}

.mobile-top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    color: #666;
    width: 100%;
    font-size: 13px;
}

/* الشريط الرئيسي للهيدر */
.mobile-header {
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    height: 60px;
    width: 100%;
    position: relative;
    z-index: 1028;
}

.mobile-header .container-fluid {
    padding: 0 10px;
    height: 100%;
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    color: #ffffff;
    position: relative;
    flex-direction: row-reverse;
}

/* أنماط تسجيل الدخول في الشريط العلوي */
.mobile-top-bar .login {
    display: flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    margin-right: auto;
    min-height: 44px;
    padding: 0 5px;
}

.mobile-top-bar .login-link {
    display: flex;
    align-items: center;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    padding: 0 5px;
    height: 100%;
}

.mobile-top-bar .login-link i {
    margin-left: 5px;
    font-size: 12px;
}

.mobile-top-bar .login-link:hover {
    background-color: #e9e9e9;
    color: #20a9f6;
}

/* أنماط اللغة والبلد في الشريط العلوي */
.mobile-top-bar .lang-country {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
    height: 100%;
    padding: 0 5px;
}

.mobile-top-bar .lang-country .language {
    margin-left: 3px;
}

.mobile-top-bar .lang-country i {
    font-size: 8px;
    margin: 0 3px;
    color: #999;
}

.mobile-top-bar .lang-country .country {
    margin-right: 3px;
}

/* أنماط الشريط الرئيسي للهيدر */
.mobile-header {
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    height: 60px;
    width: 100%;
    position: relative;
    z-index: 1028;
}

.mobile-header .container-fluid {
    padding: 0 10px;
    height: 100%;
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    color: #ffffff;
    position: relative;
    flex-direction: row-reverse;
}

/* أنماط سلة التسوق */
.mobile-header .cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #333;
    text-decoration: none;
    margin: 0 5px;
    min-height: 44px;
    min-width: 44px;
    padding: 0 10px;
}

.mobile-header .cart-icon i {
    font-size: 18px;
}

.mobile-header .cart-badge {
    position: absolute;
    top: 8px;
    right: 5px;
    background-color: #ff4c4c;
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-header .cart-icon:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* أنماط أيقونة البحث */
.search-icon {
    color: #333;
    background: transparent;
    border: none;
    font-size: 18px;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    padding: 0;
}

.search-icon:hover {
    background-color: #f0f0f0;
    cursor: pointer;
}

/* أنماط زر القائمة */
.menu-toggle {
    color: #333;
    background: transparent;
    border: none;
    font-size: 20px;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    padding: 0;
}

.menu-toggle:hover {
    background-color: #f0f0f0;
    cursor: pointer;
}

/* أنماط اللوجو */
.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: auto;
    margin-left: 10px;
}

.site-logo-img {
    max-width: 350px;
    max-height: 160px;
    height: auto;
    width: auto;
    display: block;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    font-size: 18px;
    color: #ffffff;
}

.logo-text {
    font-family: 'Tajawal', 'Arial Black', 'Arial', sans-serif;
    font-weight: 900;
    font-size: 1.9rem;
    color: #20a9f6;
    display: inline-block;
    vertical-align: middle;
    margin-left: 12px;
    letter-spacing: 2px;
    border-radius: 6px;
    background: transparent;
    text-shadow: 1px 2px 8px rgba(204,0,0,0.09), 0 1px 0 #fff;
    padding: 2px 10px 2px 2px;
    line-height: 1.1;
}

.mobile-only {
    display: none;
}

@media (max-width: 767px) {
  .logo-text {
    display: none !important;
  }
  .logo-text.mobile-only {
    display: inline-block !important;
    font-size: 1.2rem;
    margin-left: 8px;
    margin-right: 0;
    vertical-align: middle;
    letter-spacing: 1px;
    padding: 1px 6px 1px 1px;
    color: #fff !important;
  }
  .site-logo {
    flex-direction: row !important;
    align-items: center;
  }
}

@media (min-width: 768px) {
  .logo-text.mobile-only {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .logo-text {
    display: none !important;
  }
  .site-logo-img {
    max-width: 200px;
    max-height: 90px;
  }
  .site-logo {
    justify-content: flex-end !important;
    text-align: right !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: auto !important;
    display: flex !important;
  }
  .mobile-header-content {
    display: flex !important;
    flex-direction: row-reverse !important;
    justify-content: flex-start !important;
    align-items: center;
  }
}

@media (max-width: 767px) {
  .logo-text {
    font-size: 1.1rem;
    margin-left: 6px;
  }
}

/* الشريط العلوي */
.top-bar {
    background-color: #f5f5f5;
    height: 35px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}
.top-bar a {
    color: #666;
    text-decoration: none;
    margin-right: 15px;
    display: inline-flex;
    align-items: center;
}
.top-bar a i {
    margin-left: 5px;
}
.top-bar a:hover {
    color: #20a9f6;
}

/* الشريط الأوسط */
.middle-bar {
    background-color: #ffffff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.logo {
    font-weight: bold;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
}
.logo-icon {
    background-color: #ffcc00;
    color: #000;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    margin-left: 10px;
}
.logo:hover {
    text-decoration: none;
    color: #111;
}

/* منطقة البحث */
.search-container {
    position: relative;
    flex-grow: 1;
    max-width: 600px;
}
.search-container .dropdown-toggle {
    background-color: #f5f5f5;
    border-left: 0;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    color: #333;
}
.search-input {
    border-right: 0;
    padding-right: 15px;
}
.search-btn {
    background-color: #20a9f6;
    color: white;
    border: none;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    padding: 0 20px;
}
.search-btn:hover {
    background-color: #b00;
}

/* منطقة خيارات المستخدم */
.user-options-area {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.cart-btn {
    position: relative;
    padding: 8px 12px;
    color: #333333;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}
.cart-btn:hover {
    background-color: #f2f2f2;
}
.cart-icon {
    position: relative;
    font-size: 2rem;
}
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff0000;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}
.user-link {
    color: #333333;
    text-decoration: none;
    margin-right: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}
.user-link:hover {
    background-color: #f9f9f9;
}
.user-link i {
    font-size: 1.8rem;
    margin-bottom: 5px;
}
.user-link span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* شريط التنقل السفلي */
.nav-bar {
    background-color: #1e1e1e;
    color: white;
    height: 55px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}
.nav-bar .container {
    height: 55px;
    display: flex;
    align-items: center;
}
.phone-container {
    background-color: #111;
    padding: 0 15px;
    height: 55px;
    display: flex;
    align-items: center;
    font-weight: 500;
}
.phone-container i {
    margin-left: 8px;
}
.nav-bar .nav-item {
    height: 55px;
    display: flex;
    align-items: center;
    padding: 0 25px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}
.nav-bar .nav-item:hover {
    background-color: #333;
    color: white;
    text-decoration: none;
}
.nav-bar .nav-item i {
    margin-left: 8px;
    font-size: 1.1rem;
}

/* زر وقائمة الأقسام */
.categories-container {
    position: relative;
}
.categories-btn {
    background-color: #8b0000;
    height: 55px;
    display: flex;
    align-items: center;
    padding: 0 25px;
    font-weight: 700;
    cursor: pointer;
    color: white;
}
.categories-btn i {
    margin-left: 10px;
}
.categories-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    display: none;
}
.categories-container:hover .categories-dropdown {
    display: block;
}
.categories-dropdown .main-category {
    position: relative;
    border-bottom: 1px solid #ececec;
}
.categories-dropdown .main-category:last-child {
    border-bottom: none;
}
.categories-dropdown .main-category > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}
.categories-dropdown .main-category > a:hover {
    text-decoration: none;
    color: #333;
}
.categories-dropdown .main-category:hover > a {
    background-color: #f8f8f8;
}
.subcategories {
    position: absolute;
    top: 0;
    right: 100%;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-radius: 4px;
    display: none;
    z-index: 1001;
}
.main-category:hover .subcategories {
    display: block;
}
.subcategories a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #ececec;
}
.subcategories a:last-child {
    border-bottom: none;
}
.subcategories a:hover {
    background-color: #f8f8f8;
    text-decoration: none;
    color: #333;
}

/* زر أقسام الموقع */
.sections-btn {
    background-color: #FFA500;
    height: 55px;
    display: flex;
    align-items: center;
    padding: 0 25px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
}
.sections-btn:hover {
    background-color: #FF9000;
    color: white;
    text-decoration: none;
}

/* زر القائمة للموبايل */
.toggle-menu {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 10px;
    margin-right: auto;
}

/* القائمة المتنقلة للموبايل */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background-color: white;
    z-index: 1060;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transition: right 0.3s ease;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #fff;
    border-bottom: 1px solid #444;
}

.mobile-menu-logo img {
    height: 90px;
    max-width: 200px;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #ffffff;
}

.mobile-menu-body {
    padding: 15px;
}

.mobile-menu-search {
    margin-bottom: 20px;
}

.mobile-menu-title {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #666;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-nav a {
    padding: 10px 0;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s ease;
}

.mobile-menu-nav a.active,
.mobile-menu-nav a:hover {
    color: #20a9f6;
}

.mobile-menu-nav a i {
    margin-left: 10px;
    font-size: 18px;
    width: 25px;
    text-align: center;
}

/* أنماط التصنيفات والفئات الفرعية في القائمة المتنقلة */
.mobile-category-item {
    margin-bottom: 5px;
}

.mobile-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s ease;
}

.mobile-category-link:hover {
    color: #20a9f6;
}

.mobile-category-link i:first-child {
    margin-left: 10px;
    font-size: 18px;
    width: 25px;
    text-align: center;
}

.mobile-submenu-toggle {
    margin-right: auto;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.mobile-submenu {
    padding-right: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    margin-top: 5px;
    margin-bottom: 10px;
}

.mobile-submenu a {
    padding: 8px 10px;
    font-size: 14px;
    border-bottom: 1px dashed #eee;
}

.mobile-submenu a:last-child {
    border-bottom: none;
}

.mobile-submenu a i {
    font-size: 14px;
}

/* القوائم المنسدلة للموبايل */
.mobile-dropdown {
    border-bottom: 1px solid #f1f1f1;
}
.mobile-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    background-color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: right;
}
.mobile-dropdown-toggle:hover {
    background-color: #f9f9f9;
}
.mobile-dropdown-menu {
    display: none;
    background-color: #f9f9f9;
    padding-right: 15px;
}
.mobile-dropdown-menu.active {
    display: block;
}
.mobile-dropdown-menu a {
    padding-right: 25px;
    border-bottom: 1px solid #eee;
}
.mobile-dropdown-menu a:last-child {
    border-bottom: none;
}

/* الخلفية المظلمة عند فتح القائمة */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

/* توافق الموبايل */
@media (max-width: 991px) {
    /* إظهار هيدر الموبايل وإخفاء الهيدر القديم */
    .mobile-header-container {
        position: sticky;
        top: 0;
        z-index: 1030;
    }
    
    .top-bar,
    .middle-bar,
    .nav-bar {
        display: none !important;
    }
    
    /* تنسيقات القائمة المتنقلة */
    .mobile-menu {
        position: fixed;
        top: 0;
        right: -320px;
        width: 320px;
        height: 100vh;
        background-color: white;
        box-shadow: 0 0 15px rgba(0,0,0,.2);
        z-index: 1040;
        overflow-y: auto;
        transition: all 0.3s ease;
        direction: rtl;
    }
    
    .mobile-menu.active {
        right: 0;
    }
    
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,.5);
        z-index: 1039;
        display: none;
    }
    
    /* رأس القائمة المتنقلة */
    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        background-color: #fff;
        color: white;
    }
    
    .mobile-menu-logo {
        display: flex;
        align-items: center;
    }
    
    .mobile-menu-logo .logo-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        background-color: #fcbb04;
        border-radius: 50%;
        margin-left: 10px;
    }
    
    .mobile-menu-logo .logo-icon i {
        color: black;
    }
    
    .mobile-menu-logo .logo-text {
        font-size: 18px;
        font-weight: 700;
        color: #fcbb04;
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        color: white;
        font-size: 20px;
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-menu-close:hover {
        background-color: #383838;
        border-radius: 50%;
    }
    
    /* جسم القائمة المتنقلة */
    .mobile-menu-body {
        padding: 15px;
    }
    
    .mobile-menu-search {
        margin-bottom: 20px;
    }
    
    .mobile-menu-search .input-group {
        border-radius: 5px;
        overflow: hidden;
    }
    
    .mobile-menu-search .form-control {
        border: 1px solid #ddd;
    }
    
    .mobile-menu-title {
        font-size: 16px;
        font-weight: 700;
        margin: 15px 0 10px;
        color: #333;
        border-bottom: 1px solid #eee;
        padding-bottom: 8px;
    }
    
    .mobile-menu-nav {
        display: flex;
        flex-direction: column;
        margin-bottom: 20px;
    }
    
    .mobile-menu-nav a {
        display: flex;
        align-items: center;
        padding: 12px 15px;
        color: #333;
        text-decoration: none;
        border-bottom: 1px solid #f5f5f5;
        transition: all 0.2s ease;
    }
    
    .mobile-menu-nav a i {
        margin-left: 15px;
        font-size: 16px;
        width: 20px;
        text-align: center;
        color: #666;
    }
    
    .mobile-menu-nav a.active,
    .mobile-menu-nav a:hover {
        background-color: #f8f8f8;
        color: #fcbb04;
    }
    
    .mobile-menu-nav a.active i,
    .mobile-menu-nav a:hover i {
        color: #fcbb04;
    }
}

@media (max-width: 767px) {
    .top-bar .container > div {
        flex: 1;
        text-align: center;
    }
    .top-bar .dropdown-menu {
        right: auto;
        left: 0;
    }
    .user-options-area {
        flex-wrap: wrap;
        justify-content: center;
    }
    .search-form {
        margin: 10px 0;
        width: 100%;
    }
    .middle-bar .row {
        flex-direction: column;
    }
    .middle-bar .col-md-3,
    .middle-bar .col-md-6 {
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }
}

@media (min-width: 992px) {
    .mobile-menu {
        display: none;
    }
}
