/* حجم اللوجو - كمبيوتر */
header .logo img,
header.scrolled .logo img {
    height: 90px !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
}

/* حجم اللوجو - موبايل */
@media (max-width: 768px) {
    header .logo-group {
        width: auto !important;
        height: auto !important;
    }
    header .logo {
        width: auto !important;
    }
    header .logo img,
    header.scrolled .logo img {
        height: 56px !important;
        width: auto !important;
        max-width: 160px !important;
        max-height: none !important;
    }
}

/* مسافة بين اللوجو وزرار EN + لوجو أكبر - موبايل */
@media (max-width: 768px) {
    header .logo-group {
        translate: -30px 0 !important;
        overflow: visible !important;
    }
    header .logo img,
    header.scrolled .logo img {
        height: 58px !important;
        max-width: 150px !important;
    }
}

/* لوجو أكبر وموسّط في المساحة بين الأيقونات وزرار EN - موبايل */
@media (max-width: 768px) {
    header .logo-group {
        translate: -14px 0 !important;
    }
    header .logo img,
    header.scrolled .logo img {
        height: 68px !important;
        max-width: 135px !important;
    }
}

/* ===== ترتيب هيد الموبايل: أيقونات على الجانبين + لوجو كبير في النص ===== */
@media (max-width: 768px) {
    html body header .header-row-top {
        display: flex !important;
        flex-direction: row !important;
        direction: ltr !important;
        align-items: center !important;
        justify-content: space-between !important;
        height: 68px !important;
        padding: 0 8px !important;
        gap: 0 !important;
    }

    html body header .header-row-top .header-icons-group {
        display: contents !important;
        position: static !important;
        height: auto !important;
        width: auto !important;
    }

    /* كل الأيقونات: تصفير المواضع القديمة وحجم موحد */
    html body header .header-row-top .header-icons-group > .hi-cart,
    html body header .header-row-top .header-icons-group > .hi-wish,
    html body header .header-row-top .header-icons-group > .hi-account,
    html body header .header-row-top .header-icons-group > .mobile-search-icon,
    html body header .header-row-top .header-icons-group > .lang-toggle-btn,
    html body header .header-row-top .hamburger {
        position: relative !important;
        top: auto !important; right: auto !important; bottom: auto !important; left: auto !important;
        inset: auto !important;
        translate: none !important;
        transform: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        flex: 0 0 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* نخفي النصوص ونسيب الأيقونات */
    html body header .header-row-top .hi-account > span:not(.hi-badge),
    html body header .header-row-top .hi-wish > span:not(.hi-badge),
    html body header .header-row-top .hi-cart > span:not(.hi-badge),
    html body header .header-row-top .header-search-wrap {
        display: none !important;
    }

    html body header .header-row-top .ic-lg {
        width: 24px !important;
        height: 24px !important;
    }

    html body header .header-row-top .hi-badge {
        position: absolute !important;
        top: 3px !important; right: 1px !important; left: auto !important;
    }

    /* الترتيب: شنطة | قلب | حساب | لوجو | EN | بحث | قائمة */
    html body header .header-row-top .header-icons-group > .hi-cart            { order: 1 !important; }
    html body header .header-row-top .header-icons-group > .hi-wish            { order: 2 !important; }
    html body header .header-row-top .header-icons-group > .hi-account:not(.mobile-search-icon) { order: 3 !important; }
    html body header .header-row-top .logo-group                               { order: 4 !important; }
    html body header .header-row-top .header-icons-group > .lang-toggle-btn    { order: 5 !important; }
    html body header .header-row-top .header-icons-group > .mobile-search-icon { order: 6 !important; }
    html body header .header-row-top .hamburger                                { order: 7 !important; }

    html body header .header-row-top .header-icons-group > .lang-toggle-btn {
        width: 40px !important;
        min-width: 40px !important;
        height: 26px !important;
        flex: 0 0 40px !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        border: 1px solid currentColor !important;
        border-radius: 7px !important;
        line-height: 1 !important;
    }

    /* اللوجو: كبير ومتوسّط */
    html body header .header-row-top .logo-group {
        position: static !important;
        top: auto !important; right: auto !important; bottom: auto !important; left: auto !important;
        inset: auto !important;
        translate: none !important;
        transform: none !important;
        margin: 0 !important;
        padding: 0 4px !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: visible !important;
    }
    html body header .header-row-top .logo-group .logo {
        position: static !important;
        inset: auto !important;
        translate: none !important;
        transform: none !important;
        margin: 0 !important;
        width: auto !important;
        height: auto !important;
        flex: none !important;
        display: flex !important;
        justify-content: center !important;
    }
    html body header .header-row-top .logo-group .logo img,
    html body header.scrolled .header-row-top .logo-group .logo img {
        height: 56px !important;
        width: auto !important;
        max-width: 44vw !important;
        max-height: none !important;
        min-width: 0 !important;
        object-fit: contain !important;
    }
}
