/* 모던파이브 모바일 전용 헤더/검색. 패치 완료 테마 기준 */
#hd { background:#fff; color:#222; }


/* 모바일 헤더: 로고와 검색 버튼 간격 확보 */
#hd #hd_wr.m5m_header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


 
#hd .m5m_menu { width:42px; height:48px; margin:0; padding:0; border:0; background:transparent; color:#222; font-size:24px; display:flex; align-items:center; justify-content:center; flex:none; position:relative; float:none; }


/* 가운데 로고 */
#hd #logo.m5m_logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    margin: 0;
    padding: 0;
}


#hd #logo.m5m_logo a {display:block;line-height:0;}



#hd #logo.m5m_logo img {
    display: block;
    width: clamp(150px, 43vw, 190px);
    max-height: 52px;
    height: auto;
    object-fit: contain;
}



/* 검색·장바구니 버튼을 오른쪽에 유지 */
#hd #hd_btn.m5m_actions {
    position: relative;
    z-index: 2;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}





#hd .m5m_actions #btn_hdsch, #hd .m5m_actions #btn_hdcart { position:relative; top:auto; right:auto; bottom:auto; left:auto; float:none; display:flex; align-items:center; justify-content:center; width:42px; height:48px; padding:0; margin:0; background:transparent; border:0; color:#222; font-size:22px; line-height:1; text-decoration:none; box-shadow:none; }
#hd .m5m_actions #btn_hdcart { font-size:23px; }
#hd .m5m_menu .m5m_icon, #hd .m5m_actions .m5m_icon {display:block;flex:none;width:25px;height:25px;stroke:currentColor;}
#hd .m5m_actions #btn_hdcart .cart-count {position:absolute;top:5px;right:0;display:flex;justify-content:center;align-items:center;min-width:17px;height:17px;padding:0 4px;background:#ec4952;border-radius:20px;color:white;font-size:11px;line-height:1;box-sizing:border-box;}
#hd .m5m_category_bar {display:flex;align-items:center;gap:24px;overflow-x:auto;white-space:nowrap;scrollbar-width:none;border-bottom:1px solid #e8eaed;padding:0 16px;height:46px;background:#fff;box-sizing:border-box;}
#hd .m5m_category_bar::-webkit-scrollbar {display:none;}
#hd .m5m_category_bar a {flex:none;color:#242424;font-size:15px;text-decoration:none;font-weight:500;line-height:46px;}
body.m5m_search_open {overflow:hidden;}
#hd #m5m_search_panel.m5m_search_panel {position:fixed;z-index:99990;inset:0;overflow-y:auto;overscroll-behavior:contain;background:#fff;color:#151515;padding:0 20px 50px;box-sizing:border-box;max-width:none;}
#hd #m5m_search_panel[hidden] {display:none;}
#hd .m5m_search_top {height:64px;display:flex;align-items:center;gap:16px;margin-bottom:20px;}
#hd .m5m_search_top strong {font-size:17px;}
#hd .m5m_search_back {display:flex;align-items:center;justify-content:center;height:42px;width:42px;border:0;background:transparent;color:#222;font-size:23px;padding:0;}
#hd .m5m_search_account {margin-left:auto;font-size:12px;color:#777;text-decoration:none;}
#hd .m5m_search_field {height:58px;display:flex;align-items:center;border:2px solid #222;border-radius:13px;overflow:hidden;background:#fff;}
#hd .m5m_search_field input {width:100%;min-width:0;flex:1;height:100%;padding:0 14px;border:0;outline:0;font-size:16px;color:#222;background:#fff;box-sizing:border-box;box-shadow:none;}
#hd .m5m_search_field button {flex:none;width:55px;height:100%;border:0;background:transparent;color:#111;font-size:23px;}
#hd .m5m_search_section {margin-top:32px;}
#hd .m5m_search_section h2 {font-size:17px;font-weight:700;line-height:1.3;margin:0 0 18px;padding:0 0 16px;border-bottom:1px solid #e2e2e2;color:#191919;}
#hd .m5m_search_chips {display:flex;flex-wrap:wrap;gap:9px 8px;}
#hd .m5m_search_chips a {display:inline-block;padding:9px 13px;border:1px solid #ddd;border-radius:24px;background:#fff;text-decoration:none;color:#666;font-size:14px;line-height:1.3;}
#hd .m5m_recent_heading {display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid #e2e2e2;margin-bottom:18px;}
#hd .m5m_recent_heading h2 {border:0;margin:0;}
#hd #m5m_recent_clear {background:transparent;border:0;color:#888;font-size:12px;padding:0;}
#hd .m5m_recent_empty {font-size:14px;color:#999;margin:0;}
/* 작은 화면에서 간격 확보 */
@media (max-width: 390px) {
    #hd #logo.m5m_logo img {
        width: 40vw;
    }

    #hd #hd_btn.m5m_actions {
        gap: 8px;
    }
}
