/**
 * هدر - ساده، مینیمال، بدون پیچیدگی
 * 
 * @package QuadWeb
 * @version 3.0.0
 */

.site-header,
.site-header *,
.site-header *::before,
.site-header *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.site-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 999;
    height: 60px;
    display: flex;
    align-items: center;
    font-family: 'Lahzeh', 'Vazirmatn', 'Tahoma', sans-serif;
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.04);
    width: 100%;
}

.site-header .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

.site-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.site-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    color: #2d2d2d !important;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-text {
    font-weight: 700;
    font-size: 20px;
    color: #2d2d2d;
    letter-spacing: -0.3px;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.site-logo a:hover .logo-text {
    color: #4a90d9;
}

.main-nav {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 6px;
    align-items: center;
}

.nav-list li {
    display: inline-block;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.nav-list li a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 0;
    font-size: 14px;
    font-weight: 400;
    color: #5c5c5c !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    background: transparent !important;
    border: none !important;
}

.nav-list li a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 50%;
    width: 0;
    height: 2.5px;
    background: #4a90d9;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
    transform: translateX(50%);
}

.nav-list li a:hover::after {
    width: 70%;
}

.nav-list li a.active::after {
    width: 70%;
}

.nav-list li a:hover {
    color: #4a90d9 !important;
    background: transparent !important;
    transform: translateY(-1px);
}

.nav-list li a.active {
    color: #4a90d9 !important;
    font-weight: 500;
    background: transparent !important;
}

.nav-list li a .badge {
    background: #4a90d9;
    color: #ffffff !important;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    margin-right: 2px;
    display: inline-block;
}

.nav-list li a.add-cat {
    color: #4a90d9 !important;
    background: rgba(74, 144, 217, 0.06) !important;
    border-radius: 20px !important;
    padding: 6px 16px !important;
}

.nav-list li a.add-cat::after {
    display: none;
}

.nav-list li a.add-cat:hover {
    background: #4a90d9 !important;
    color: #ffffff !important;
}

.header-search {
    flex-shrink: 0;
    width: 240px;
}

.header-search form {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 0 14px;
    transition: all 0.3s ease;
    height: 38px;
}

.header-search form:focus-within {
    border-color: #4a90d9;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.08);
}

.header-search input {
    flex: 1;
    padding: 0 10px 0 0;
    border: none !important;
    background: transparent !important;
    font-size: 13px;
    color: #2d2d2d;
    outline: none;
    font-family: inherit;
    min-width: 0;
    height: 100%;
}

.header-search input::placeholder {
    color: #777777;
}

.header-search button {
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: #777777;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.header-search button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.header-search button:hover {
    color: #4a90d9;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.search-mobile {
    display: none;
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 6px 10px;
    color: #5c5c5c;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-mobile svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

.search-mobile:hover {
    background: rgba(74, 144, 217, 0.06) !important;
    color: #4a90d9;
}

.admin-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 400;
    color: #5c5c5c !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
    font-family: inherit;
    background: transparent !important;
    border: none !important;
}

.admin-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.admin-link:hover {
    background: rgba(74, 144, 217, 0.06) !important;
    color: #4a90d9 !important;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 20px;
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #2d2d2d;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    background: #4a90d9;
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    background: #4a90d9;
}

.menu-toggle:hover span {
    background: #4a90d9;
}

.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.search-overlay.active {
    display: flex;
}

.search-container {
    width: 100%;
    max-width: 520px;
    position: relative;
}

.search-container .close-search {
    position: absolute;
    top: -48px;
    left: 0;
    background: none !important;
    border: none !important;
    font-size: 28px;
    color: #5c5c5c;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.3s ease;
    line-height: 1;
}

.search-container .close-search:hover {
    color: #2d2d2d;
    transform: rotate(90deg);
}

.search-container form {
    display: flex;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
    margin: 0;
}

.search-container input {
    flex: 1;
    padding: 16px 20px;
    border: none !important;
    font-size: 16px;
    color: #2d2d2d;
    outline: none;
    font-family: inherit;
    background: transparent !important;
}

.search-container input::placeholder {
    color: #b0b0b0;
}

.search-container button[type="submit"] {
    padding: 16px 28px;
    background: #4a90d9 !important;
    color: #ffffff !important;
    border: none !important;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.search-container button[type="submit"]:hover {
    background: #3a7bc8 !important;
}

/* ============================================
   موبایل - منوی ساده از بالا
   ============================================ */

@media (max-width: 768px) {
    .site-header {
        height: 56px;
    }

    .site-header .container {
        padding: 0 16px;
    }

    .logo-text {
        font-size: 17px;
    }
    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .header-search {
        display: none !important;
    }

    .search-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .menu-toggle {
        display: flex;
    }

    .site-logo {
        order: 1;
    }
    .header-actions {
        order: 3;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        padding: 12px 20px 20px;
        border-top: 1px solid #e8e8e8;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 100;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        justify-content: flex-start;
        flex: none;
        width: 100%;
    }

    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 2px;
    }

    .nav-list li {
        width: 100%;
    }

    .nav-list li a {
        width: 100%;
        padding: 12px 16px;
        font-size: 15px;
        justify-content: flex-start;
        white-space: normal;
        border-radius: 8px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .nav-list li a::after {
        bottom: 4px;
        right: 16px;
        transform: translateX(0);
        height: 2px;
    }

    .nav-list li a:hover::after,
    .nav-list li a.active::after {
        width: calc(100% - 32px);
    }

    .nav-list li a:hover {
        padding-right: 22px;
        background: rgba(74, 144, 217, 0.04) !important;
        border-radius: 8px !important;
        transform: none;
    }

    .nav-list li a.active {
        background: rgba(74, 144, 217, 0.06) !important;
        border-radius: 8px !important;
    }

    .nav-list li a.add-cat {
        background: rgba(74, 144, 217, 0.06) !important;
        border-radius: 8px !important;
        justify-content: center;
        margin-top: 4px;
    }

    .nav-list li a.add-cat:hover {
        background: #4a90d9 !important;
        color: #ffffff !important;
    }

    .search-container form {
        flex-direction: column;
        border-radius: 10px;
    }
    .search-container input {
        padding: 14px 18px;
        font-size: 15px;
        border-bottom: 1px solid #e8e8e8 !important;
    }
    .search-container button[type="submit"] {
        width: 100%;
        justify-content: center;
        padding: 14px;
        border-radius: 0;
        font-size: 14px;
    }
    .search-container .close-search {
        top: -44px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .site-header {
        height: 50px;
    }

    .site-header .container {
        padding: 0 12px;
    }

    .logo-text {
        font-size: 15px;
    }
    .logo-icon {
        width: 24px;
        height: 24px;
        border-radius: 6px;
    }
    .site-logo a {
        gap: 6px;
    }

    .nav-list li a {
        font-size: 14px;
        padding: 10px 14px;
    }

    .admin-link {
        font-size: 12px;
        padding: 4px 10px;
    }
    .admin-link svg {
        width: 16px;
        height: 16px;
    }
    .search-mobile svg {
        width: 18px;
        height: 18px;
    }
    .menu-toggle {
        width: 22px;
        height: 18px;
    }
    .menu-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .search-container input {
        font-size: 14px;
        padding: 12px 16px;
    }
    .search-container button[type="submit"] {
        font-size: 13px;
        padding: 12px;
    }
    .search-container .close-search {
        top: -38px;
        font-size: 20px;
    }
}