/* ============================================================
   HEADER MODERN - نسخه نهایی و بدون تکرار
   ============================================================ */

.tj-header-area {
    position: relative;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 16px 0;
    transition: all 0.3s ease;
}

    .tj-header-area.header-absolute {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        padding: 20px 0 !important;
    }

    .tj-header-area.header-sticky {
        position: fixed;
        top: -100px;
        left: 0;
        width: 100%;
        opacity: 0;
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
        transition: top 0.4s ease, opacity 0.4s ease;
        padding: 8px 0 !important;
    }

        .tj-header-area.header-sticky.sticky-out,
        .tj-header-area.header-sticky.active {
            top: 0;
            opacity: 1;
        }

/* Grid Layout */
.madaniro-header-row {
    display: grid !important;
    grid-template-columns: auto 1fr auto auto auto !important;
    align-items: center !important;
    gap: 32px !important;
}

/* ============================================================
   لوگو - با height به جای max-height
   ============================================================ */
.logo-box a {
    display: flex;
    align-items: center;
}

.logo-box img {
    height: 110px !important; /* ← height به جای max-height */
    width: auto !important;
    max-height: none !important; /* ← حذف محدودیت */
    object-fit: contain !important;
    transition: transform 0.3s ease;
}

.logo-box a:hover img {
    transform: scale(1.05);
}

/* لوگو در هدر sticky - کمی کوچک‌تر */
.tj-header-area.header-sticky .logo-box img {
    height: 80px !important;
}

/* Navigation */
.main-nav .nav-list {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.main-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: #1f2330;
    font-weight: 500;
    font-size: 15px;
    border-radius: 10px;
    transition: all 0.25s ease;
    text-decoration: none;
    cursor: pointer;
}

    .main-nav .nav-link:hover {
        background: rgba(0, 82, 204, 0.08);
        color: #0052cc;
    }

    .main-nav .nav-link i {
        font-size: 11px;
        transition: transform 0.3s ease;
    }

.has-dropdown {
    position: relative;
}

    .has-dropdown:hover .nav-link i {
        transform: rotate(180deg);
    }

/* Mega Menu */
.mega-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 600px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    padding: 24px;
    z-index: 100;
}

.has-dropdown:hover .mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.mega-title {
    font-size: 13px;
    font-weight: 700;
    color: #0052cc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0052cc;
    display: inline-block;
}

.mega-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sub-list {
    display: none;
}

    .sub-list.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mega-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    margin-bottom: 4px;
    color: #4b4f5a;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .mega-link:hover {
        background: rgba(0, 82, 204, 0.08);
        color: #0052cc;
        padding-right: 18px;
    }

.count-badge {
    background: #0052cc;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

/* Search Box */
.header-search-wrapper {
    position: relative;
}

.modern-search {
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f5f7fa 0%, #eef1f5 100%);
    border: 2px solid transparent;
    border-radius: 50px;
    padding: 0 8px 0 20px;
    transition: all 0.3s ease;
    width: 280px;
    height: 48px;
}

    .search-box:focus-within {
        background: #fff;
        border-color: #0052cc;
        box-shadow: 0 8px 24px rgba(0, 82, 204, 0.15);
        width: 340px;
    }

.search-icon {
    color: #8a8f9c;
    font-size: 15px;
    transition: color 0.3s ease;
}

.search-box:focus-within .search-icon {
    color: #0052cc;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #1f2330;
    outline: none;
    font-family: inherit;
    padding: 0;
    min-width: 0;
}

    .search-box input::placeholder {
        color: #8a8f9c;
    }

.search-clear {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #8a8f9c;
    transition: all 0.2s ease;
}

    .search-clear:hover {
        background: rgba(225, 75, 75, 0.1);
        color: #e14b4b;
        transform: rotate(90deg);
    }

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    left: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    max-height: 450px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 200;
}

    .search-dropdown.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.suggestions-list {
    list-style: none;
    margin: 0;
    padding: 8px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #1f2330;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

    .suggestion-item:hover {
        background: rgba(0, 82, 204, 0.08);
    }

.suggestion-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    background: #f5f7fa;
}

.suggestion-img-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f5f7fa, #eef1f5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2330;
    margin-bottom: 4px;
}

.suggestion-category {
    font-size: 12px;
    color: #8a8f9c;
}

.no-results {
    padding: 32px 20px;
    text-align: center;
    color: #8a8f9c;
    font-size: 14px;
}

.view-all-results {
    border-top: 1px solid #eef0f2;
    margin-top: 4px;
}

    .view-all-results a {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 14px;
        color: #0052cc;
        text-decoration: none;
        font-weight: 600;
        font-size: 14px;
    }

        .view-all-results a:hover {
            background: rgba(0, 82, 204, 0.05);
        }

/* Auth Button */
.header-actions .auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: linear-gradient(135deg, #0052cc 0%, #4f6ef7 100%);
    color: #fff !important;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 82, 204, 0.25);
}

    .header-actions .auth-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 82, 204, 0.35);
        color: #fff !important;
    }

/* Mobile Toggle */
.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1.5px solid #eef0f2;
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
}

    .mobile-menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: #1f2330;
        margin: 4px auto;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

/* ============================================================
   Responsive - بدون تکرار media query
   ============================================================ */
@media (max-width: 1199px) {
    .madaniro-header-row {
        gap: 20px !important;
    }

    .search-box {
        width: 220px;
    }

        .search-box:focus-within {
            width: 260px;
        }

    .main-nav .nav-link {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (max-width: 991px) {
    .madaniro-header-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .header-menu-wrapper,
    .header-search-wrapper {
        display: none !important;
    }

    .header-actions .auth-btn span {
        display: none;
    }

    .header-actions .auth-btn {
        padding: 10px 12px;
        min-width: auto;
    }

    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    /* لوگو در موبایل */
    .logo-box img {
        height: 70px !important;
    }
}

/* موبایل کوچک - فقط یک بار تعریف شده */
@media (max-width: 575px) {
    .tj-header-area {
        padding: 12px 0 !important;
    }

    .logo-box img {
        height: 55px !important;
    }

    .header-actions .auth-btn {
        padding: 8px 10px;
    }

    .mobile-menu-toggle {
        width: 38px;
        height: 38px;
    }

        .mobile-menu-toggle span {
            width: 18px;
            height: 2px;
        }
}

/* ============================================================
   Mobile Drawer
   ============================================================ */
.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

    .mobile-drawer-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 9999;
    overflow-y: auto;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
}

    .mobile-drawer.active {
        right: 0;
    }

/* Drawer Header */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f2;
    background: #fafbfc;
}

.drawer-logo img {
    height: 65px !important; /* ← از ۳۵ به ۶۵ */
    width: auto !important;
    max-height: none !important;
}

.drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .drawer-close:hover {
        background: #e74c3c;
        color: #fff;
    }

/* Drawer Search */
.drawer-search {
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f2;
}

.drawer-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f7fa;
    border-radius: 50px;
    padding: 0 16px;
    border: 1.5px solid transparent;
    transition: all 0.3s ease;
}

    .drawer-search-box:focus-within {
        background: #fff;
        border-color: #0052cc;
    }

    .drawer-search-box i {
        color: #8a8f9c;
        font-size: 14px;
    }

    .drawer-search-box input {
        flex: 1;
        border: none;
        background: transparent;
        padding: 12px 0;
        font-size: 14px;
        outline: none;
        font-family: inherit;
    }

/* Mobile Nav List */
.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 12px 0;
    flex: 1;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: #1f2330;
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
}

    .mobile-nav-link:hover,
    .mobile-nav-link:active {
        background: rgba(0, 82, 204, 0.05);
        color: #0052cc;
        border-right-color: #0052cc;
    }

    .mobile-nav-link i {
        width: 20px;
        font-size: 16px;
        color: #0052cc;
    }

/* Submenu Toggle */
.mobile-nav-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: none;
    border: none;
    border-right: 3px solid transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: #1f2330;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .mobile-nav-toggle:hover {
        background: rgba(0, 82, 204, 0.05);
        color: #0052cc;
    }

.toggle-label {
    display: flex;
    align-items: center;
    gap: 14px;
}

    .toggle-label i {
        width: 20px;
        font-size: 16px;
        color: #0052cc;
    }

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

    .toggle-icon.rotated {
        transform: rotate(180deg);
    }

/* Submenu */
.mobile-nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: #fafbfc;
}

    .mobile-nav-submenu.active {
        max-height: 1000px;
    }

.mobile-submenu-item {
    padding: 8px 20px 8px 40px;
}

.mobile-submenu-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #0052cc;
    padding: 8px 0;
    text-decoration: none;
}

.mobile-submenu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .mobile-submenu-list li a {
        display: block;
        padding: 8px 0 8px 16px;
        color: #4b4f5a;
        font-size: 13px;
        text-decoration: none;
        border-right: 2px solid #eef0f2;
        transition: all 0.2s ease;
    }

        .mobile-submenu-list li a:hover {
            color: #0052cc;
            border-right-color: #0052cc;
            padding-right: 8px;
        }

/* Drawer Footer */
.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid #eef0f2;
    background: #fafbfc;
}

.drawer-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0052cc 0%, #4f6ef7 100%);
    color: #fff !important;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 82, 204, 0.3);
}

    .drawer-auth-btn:hover,
    .drawer-auth-btn:active {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 82, 204, 0.4);
        color: #fff !important;
    }

    .drawer-auth-btn i {
        font-size: 16px;
    }
