/**
 * Mobile Header Fix - اصلاح چیدمان هدر موبایل
 * مرتب کردن آیکون‌ها و جستجو در نسخه موبایل
 */

/* === اصلاح چیدمان هدر موبایل === */
@media (max-width: 768px) {
    /* همبرگر منو - موقعیت ثابت در سمت راست */
    .et-hamburger {
        display: block !important;
        position: absolute !important;
        top: 50% !important;
        right: 8px !important;
        transform: translateY(-50%) !important;
        width: 36px !important;
        height: 36px !important;
        padding: 8px !important;
        z-index: 100003 !important;
    }

    /* هدر - تنظیمات کلی */
    .top-bar-z {
        position: relative !important;
        padding: 8px 0 !important;
    }

    .top-bar-z > .row:first-child {
        position: relative !important;
    }

    /* سطر اول هدر - چیدمان صحیح */
    .top-bar-z > .row:first-child {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0 !important;
        padding: 0 80px 0 8px !important;
    }

    /* لوگو مخفی در موبایل */
    .top-bar-z .logo {
        display: none !important;
    }

    /* جستجو - فضای مناسب */
    .top-bar-z .search,
    .top-bar-z .columns.search {
        order: 1 !important;
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        float: none !important;
        position: relative !important;
    }

    .top-bar-z .search input[type="text"] {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 8px 40px 8px 12px !important;
        font-size: 13px !important;
        height: 36px !important;
        border-radius: 18px !important;
    }

    .top-bar-z .search .fa-search {
        position: absolute !important;
        top: 50% !important;
        right: 12px !important;
        transform: translateY(-50%) !important;
    }

    .top-bar-z .search form {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* آیکون‌ها - موقعیت ثابت در سمت چپ */
    .top-bar-z .mobile-header-actions {
        order: 2 !important;
        position: absolute !important;
        left: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 100002 !important;
        flex: 0 0 auto !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 8px !important;
        display: flex !important;
        align-items: center !important;
    }

    .top-bar-z .mobile-header-actions .cart,
    .top-bar-z .mobile-header-actions .account-nav {
        width: auto !important;
        flex: 0 0 auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .top-bar-z .mobile-header-actions .cart img,
    .top-bar-z .mobile-header-actions .account-nav img {
        width: 32px !important;
        height: 32px !important;
        display: block !important;
    }

    /* اصلاح dropdown در موبایل */
    .wrapper-dropdown-5 {
        width: 32px !important;
        height: 32px !important;
    }

    .wrapper-dropdown-5 .avatar {
        width: 32px !important;
        height: 32px !important;
    }

    .wrapper-dropdown-5 .avatar img {
        width: 32px !important;
        height: 32px !important;
    }

    /* مخفی کردن منوی اصلی دسکتاپ */
    .top-bar-z > .row:last-child {
        display: none !important;
    }
}

/* === اصلاح برای موبایل خیلی کوچک === */
@media (max-width: 360px) {
    .top-bar-z .search input[type="text"] {
        font-size: 12px !important;
        padding: 7px 35px 7px 10px !important;
    }

    .top-bar-z .mobile-header-actions .cart img,
    .top-bar-z .mobile-header-actions .account-nav img {
        width: 28px !important;
        height: 28px !important;
    }

    .et-hamburger {
        width: 32px !important;
        height: 32px !important;
        padding: 7px !important;
    }
}