/*
 * Theme: LEGCO - optimized for Payagostaresh/LEO pumps
 * Author: Payagostaresh Team
 * File: header.css
 * Description: Main header styles for the LEGCO website, including top bar, navigation, logo, and mobile menu.
 * Version: 1.0.1
 */

/* Variables and Base Styles */
@font-face {
    font-family: 'Vazirmatn';
    src: url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #0a2348;
    --secondary-color: #03152f;
    --accent-color: #ff7a00;
    --text-color: #ffffff;
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition-speed: 0.3s;
}

body {
    font-family: var(--font-family-base);
    direction: rtl;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}
@font-face {
    font-family: 'Font Awesome 5 Solid';
    font-style: normal;
    font-weight: 900;
    src: url('../webfonts/fa-solid-900.woff2') format('woff2');
    unicode-range: U+F000-F4FF;
}
@font-face {
    font-family: 'Font Awesome 5 Regular';
    font-style: normal;
    font-weight: 400;
    src: url('../webfonts/fa-regular-400.woff2') format('woff2');
    unicode-range: U+F000-F4FF;
}

/* Top Bar */
.top-bar {
    background-color: var(--secondary-color);
    color: var(--text-color);
    font-size: 14px;
    padding: 5px 0;
}

.top-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 15px;
    box-sizing: border-box;
}

.top-contact {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-action-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    text-decoration: none;
    white-space: nowrap;
}

.btn-action-link i {
    font-size: 1.2em;
}

.action-text {
    font-weight: 600;
}

.badge-pill {
    display: inline-block;
    padding: .35em .65em;
    font-size: .75em;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .45rem;
}

.badge-compare {
    background-color: #ffc107;
    color: #000;
}

.badge-cart, .badge-empty {
    background-color: #dc3545;
    color: var(--text-color);
}

.btn-track {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background-color: var(--accent-color);
    color: var(--text-color);
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color var(--transition-speed) ease;
    white-space: nowrap;
}

.cat-menu .cat-item .cat-icon {
    width: 19px;
    height: 19px;
    margin-left: 4px;
    color: #ff6a00 !important;  /* صریح + محافظت از override */
}

/* Main Navigation Bar */
.main-nav-bar {
    background-color: var(--primary-color);
    padding: 10px 0;
}

.main-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 84px;
    padding: 0 15px;
    box-sizing: border-box;
}

.logo {
    flex-shrink: 0;
}

.logo img {
    max-height: 64px;
    width: auto;
    display: block;
}

/* Category Navigation */
.category-nav {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: auto;
}

.category-nav ul.cat-menu {
    display: flex;
    align-items: center;
    justify-content: center; /* Changed from flex-start to center */
    gap: 28px; /* Increased gap for better spacing */
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-nav li.cat-item {
    position: relative;
}

.category-nav li.cat-item a {
    color: var(--text-color);
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0; /* Added padding for larger click area */
    transition: color var(--transition-speed) ease;
}

.category-nav li.cat-item a:hover {
    color: var(--accent-color);
}

.category-nav .cat-icon {
    font-size: 1.1em;
}

.category-nav .cat-title {
    font-weight: 600;
    font-size: 15px;
}

/* Dropdown Menu */
.cat-menu ul.dropdown-menu {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--primary-color);
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    margin: 0;
    padding: 10px 0;
}

.cat-menu li.cat-item:hover > ul.dropdown-menu {
    display: block; /* Show on hover */
}

.cat-menu ul.dropdown-menu li {
    width: 100%;
}

.cat-menu ul.dropdown-menu li a {
    padding: 10px 20px;
    white-space: nowrap;
    display: block;
    color: var(--text-color);
    font-size: 14px;
}

.cat-menu ul.dropdown-menu li a:hover {
    background-color: var(--secondary-color);
    color: var(--accent-color);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none; /* Hidden on larger screens */
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-btn i {
    display: block; /* Ensure icon is visible */
}

/* Sticky Header */
.is-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

@media (max-width: 992px) {
    /* === ردیف بالا: لوگو و همبرگری کنار هم === */
    .main-nav-container {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        min-height: auto;
        padding: 12px 15px;
    }

    .logo {
        order: 1;
        width: auto;
        margin: 0;
        text-align: right;
    }

    .mobile-menu-btn {
        order: 2;
        display: block;
        width: auto;
        margin: 0;
    }

    /* === پنل منو (تمام عرض، زیر ردیف بالا) === */
   .category-nav {
    order: 3;
    width: 100%;
    display: none;
    background: var(--secondary-color);                /* زمینه تیره مثل قبل */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}


    .category-nav.active {
        display: block;
    }

    .category-nav ul.cat-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        max-height: none;
        overflow: visible;
        list-style: none;
    }

    .category-nav li.cat-item {
        width: 100%;
        margin: 0;
        padding: 0;
        text-align: right;
        border-bottom: 1px solid #f0f0f0;
    }

    .category-nav li.cat-item:last-child {
        border-bottom: none;
    }

    .category-nav li.cat-item a {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        padding: 14px 16px;
        text-align: right;
    }

    .category-nav .cat-icon {
        flex: 0 0 24px;
        width: 24px;
        text-align: center;
    }

    .category-nav .cat-title {
        flex: 1;
    }

   @media (max-width: 992px) {
    .top-bar {
        display: block;
    }

    .top-bar-container {
        flex-direction: column;   /* تماس‌ها بالا، دکمه‌ها پایین */
        gap: 6px;
        align-items: center;
        text-align: center;
        padding: 6px 10px;
    }

    .top-contact,
    .top-contact .top-contact-item {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px 10px;
    }

    .top-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

}
