@charset "utf-8";

/* =========================================================
   [1] 헤더 공통 스타일 (높이 확장 및 좌우 정렬 고정)
   ========================================================= */
/* =========================================================
   [0] 상단 띠배너
   ========================================================= */
.top-strip-banner {
    width: 100%; height: 40px; background: #9f4ff0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative; z-index: 1000;
}
.top-strip-inner {
    position: relative; height: 40px; display: flex;
    align-items: center; justify-content: center; width: 100%;
}
.strip-text {
    position: absolute; left: 0; right: 0; text-align: center;
    font-size: 14px; font-weight: 700; color: #fff; letter-spacing: -0.02em;
    white-space: nowrap; line-height: 40px;
    display: flex; align-items: center; justify-content: center;
}
.strip-naver-icon {
    height: 1em; width: auto; vertical-align: middle; margin-right: 6px;
    display: inline-block;
}
/* 첫 텍스트: 보이다 → 위로 사라짐 → 아래서 올라옴 → 반복 */
.strip-text--first {
    animation: stripFirst 5s ease infinite;
}
/* 두 번째 텍스트: 아래서 올라옴 → 보이다 → 위로 사라짐 → 반복 */
.strip-text--second {
    opacity: 0; transform: translateY(100%);
    animation: stripSecond 5s ease infinite;
}
/* 전체 5s 기준: 0~2s Click 표시 / 2~2.4s 전환 / 2.4~4.4s 평일 표시 / 4.4~4.8s 전환 / 4.8~5s Click 복귀 */
@keyframes stripFirst {
    0%, 40%    { opacity: 1; transform: translateY(0); }
    48%        { opacity: 0; transform: translateY(-100%); }
    88%        { opacity: 0; transform: translateY(100%); }
    96%, 100%  { opacity: 1; transform: translateY(0); }
}
@keyframes stripSecond {
    0%, 40%    { opacity: 0; transform: translateY(100%); }
    48%        { opacity: 1; transform: translateY(0); }
    88%        { opacity: 1; transform: translateY(0); }
    96%        { opacity: 0; transform: translateY(-100%); }
    100%       { opacity: 0; transform: translateY(100%); }
}

/* 헤더 높이 */
.header { background: #fff; border-bottom: 1px solid #efefef; width: 100%; height: 86px; z-index: 999; position: relative; box-sizing: border-box; }
.header.is-fixed { position: fixed; top: 0; left: 0; right: 0; }
.header-spacer { display: none; height: 86px; }
.header-container { display: flex; align-items: center; justify-content: space-between; height: 100%; max-width: 1920px !important; margin: 0 auto; padding: 0 20px !important; box-sizing: border-box; gap: 24px; }

/* 로고를 왼쪽 끝으로 완전히 밀착 (flex: 1 적용) */
.top-logo { display: flex; align-items: center; height: 100%; flex: 1; justify-content: flex-start; }
.logo-img { max-height: 34px; width: auto; transition: all 0.2s ease; }

/* 중앙 카테고리 고정 */
.category { display: flex; justify-content: center; align-items: center; height: 100%; }
.category__list { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; gap: 0px; height: 100%; }
.category__item { position: relative; display: flex; align-items: center; height: 100%; flex: 0 0 auto; }
.category__link { display: flex; align-items: center; height: 100%; font-size: 16px; font-weight: 800; color: #333; text-decoration: none; transition: color 0.2s ease; white-space: nowrap; word-break: keep-all; }
.category__link:hover { color: #9f4ff0 !important; text-decoration: none !important; }
.category__link--active { color: #9f4ff0 !important; }
.category-submenu {
    position: absolute; top: calc(100% + 1px); left: 50%; transform: translateX(-50%) translateY(8px);
    min-width: 150px; margin: 0; padding: 6px 0; list-style: none;
    background: #fff; border: 1px solid #ebebeb; box-sizing: border-box;
    opacity: 0; visibility: hidden; transition: all 0.2s ease; z-index: 120;
}
.category__item:hover .category-submenu {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.category-submenu a {
    display: block; padding: 10px 14px; font-size: 14px; line-height: 1.3;
    color: #0e0e0e; text-decoration: none !important; text-align: center;
}
.category-submenu a:hover {
    background: #f4f4f4; color: #0e0e0e !important;
}

/* 우측 메뉴를 오른쪽 끝으로 완전히 밀착 (flex: 1 적용) */
.other { display: flex; align-items: center; justify-content: flex-end; gap: 25px; height: 100%; flex: 1; }

.usm-wrap { display: flex; align-items: center; gap: 12px; font-size: 15px; color: #555; height: 100%; }
.usm-wrap a { color: inherit; text-decoration: none; font-weight: 500; transition: color 0.2s ease; }
.usm-wrap a:hover { color: #9f4ff0 !important; text-decoration: none !important; }
.usm-wrap .btn-join { position: relative; }
.usm-wrap .divider { width: 1px; height: 14px; background: #e0e0e0; }

.icon-list { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; gap: 12px; height: 100%; }
.btn-search { cursor: pointer; display: flex; align-items: center; height: 100%; }

.icon-list > li { display: flex; align-items: center; justify-content: center; }
.btn-search,
.mypage-menu,
.cart-menu { width: 24px; height: 24px; }
.btn-search .util-icon,
.mypage-menu .util-icon,
.cart-menu .util-icon { width: 19px; height: 19px; }

.mypage-menu { position: relative; cursor: pointer; display: flex; align-items: center; height: 100%; }
.mypage-menu > a { color: inherit; text-decoration: none; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; line-height: 0; }
.mypage-toggle {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    line-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.mypage-dropdown {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(6px);
    width: 130px; background: #fff; border: 1px solid #ebebeb; text-align: center;
    opacity: 0; visibility: hidden; transition: all 0.2s ease; z-index: 100;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.mypage-menu:hover .mypage-dropdown { opacity: 1 !important; visibility: visible !important; transform: translateX(-50%) translateY(0) !important; }
.mypage-menu.is-open .mypage-dropdown { opacity: 1 !important; visibility: visible !important; transform: translateX(-50%) translateY(0) !important; }
.mypage-dropdown a { display: block; font-size: 13px; padding: 12px 0; color: #333; text-decoration: none !important; border-bottom: 1px solid #f5f5f5; transition: background 0.2s ease; }
.mypage-dropdown a:hover { background-color: #f9f9f9; color: #9f4ff0 !important; }
.mypage-dropdown a.no-border { border-bottom: none; }

.cart-menu { display: flex; align-items: center; }
.cart-menu > a { color: inherit; text-decoration: none; display: flex; align-items: center; justify-content: center; position: relative; width: 24px; height: 24px; line-height: 0; }
.cart-count-badge {
    position: absolute; top: -8px; right: -10px; background: #9f4ff0; color: #fff;
    font-size: 11px; width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; line-height: 1; font-family: inherit;
    border: 2px solid #fff; box-sizing: border-box; padding: 0;
}

@keyframes bounce-tooltip {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}
.join-bonus {
    position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
    background: #fff; color: #0e8359; border: 1px solid #0e8359; border-radius: 12px;
    padding: 3px 8px; font-size: 11px; font-weight: 800; white-space: nowrap;
    animation: bounce-tooltip 1.5s infinite ease-in-out; pointer-events: none; line-height: 1;
}
.join-bonus::after {
    content: ''; position: absolute; bottom: -5px; left: 50%; margin-left: -4px;
    border-width: 5px 4px 0; border-style: solid; border-color: #0e8359 transparent transparent transparent;
}
.join-bonus::before {
    content: ''; position: absolute; bottom: -3.5px; left: 50%; margin-left: -3px;
    border-width: 4px 3px 0; border-style: solid; border-color: #fff transparent transparent transparent; z-index: 1;
}

/* 아이콘 찌그러짐 방지 (flex-shrink:0 및 min-width 적용) */
.util-icon { 
    width: 19px; height: 19px; min-width: 19px; flex-shrink: 0; 
    stroke: #333; stroke-width: 1.8px; fill: none; stroke-linecap: round; stroke-linejoin: round; 
    display: block; transition: stroke 0.2s ease; 
}


/* =========================================================
   [2] 본문 레이아웃 공통 리셋 (wrap, container)
   ========================================================= */
#wrap { background: #fff; min-height: 600px; }
#container { max-width: 1600px; margin: 0 auto; width: 100%; box-sizing: border-box; }
#contents { padding: 50px 0; }
#container_title { text-align: center; padding-bottom: 30px; }

/* =========================================================
   [3] 모바일 반응형 헤더
   ========================================================= */
html.loaded .user-menu__link, html.loaded .left-menu__link { transition: opacity 0.2s ease-in-out; }

.top-banner { overflow: hidden; position: relative; width: 100%; text-align: center; z-index: 11; height: 40px; }
.top-banner__link { font-size: 14px; color: inherit; display: block; width: 100%; height: 100%; line-height: 40px; text-align: center; font-weight: 700; }

.header__wrap { position: relative; top: 0; left: 0; width: 100%; height: 100%; box-sizing: border-box; background: #fff; border-bottom: 0; }
.header__bottom { height: 100%; }
.header__wrap.fixed { position: fixed; }
.header__top { height: 80px; }

.icon-search-mobile { display: none; }
.sub-category { position: absolute; background: rgba(255,255,255,.95); width: 150px; border: 1px solid #ebebeb; box-sizing: border-box; left: 50%; margin-left: -75px; top: calc(100% + 5px); z-index: 1; opacity: 0; visibility: hidden; }
html.loaded .sub-category { transition: all 0.2s ease; }
.sub-category__link { display: block; font-size: 14px; color: #333; font-weight: 500; line-height: 33px; transition: background 0.2s ease; text-decoration: none !important; }

.top-search-popup { position: absolute; top: 50px; right: 0; width: 370px; box-sizing: border-box; background: #fff; border-radius: 8px; border: 1px solid #efefef; border-top-left-radius: 0; border-top-right-radius: 0; opacity: 0; visibility: hidden; transform: translateY(5px); }
.top-search.on .top-search-popup { opacity: 1; visibility: visible; transform: translateY(0px); }
.header__wrap.fixed .top-search-popup { top: 53px; right: -45px; }

.search { position: fixed; top: 0; width: 480px; height: 100%; right: 0; background: #fff; overflow: hidden; z-index: 1001; transform: translateX(100%); transition: transform 0.38s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
.search.on { transform: translateX(0); }
.search-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.55); z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0.35s ease; }
.search.on + .search-bg { opacity: 1; visibility: visible; }

/* ── 검색 패널 내부 UI ──────────────────────────────────────────────── */
.sp-header { display: flex; align-items: center; justify-content: space-between; padding: 26px 28px 20px; border-bottom: 1px solid #efefef; flex-shrink: 0; }
.sp-title { font-size: 20px; font-weight: 700; color: #111; }
.sp-close { background: none; border: none; font-size: 20px; color: #888; cursor: pointer; padding: 4px 6px; line-height: 1; transition: color .15s; }
.sp-close:hover { color: #111; }

.sp-body { flex: 1; overflow-y: auto; padding: 24px 28px 50px; }
.sp-search-form { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.sp-search-input { flex: 1; border: none; outline: none; font-size: 15px; color: #111; background: transparent; padding: 14px 0; }
.sp-search-input:hover { outline: 1px solid #666; outline-offset: 0; box-shadow: none !important; }
.sp-search-input:focus { outline: 1px solid #666; outline-offset: 0; box-shadow: none !important; }
.sp-search-input::placeholder { color: #bbb; }
.sp-search-btn { background: none; border: none; padding: 4px; cursor: pointer; color: #666; display: flex; align-items: center; flex-shrink: 0; transition: color .15s; }
.sp-search-btn:hover { color: #111; }

.sp-section { margin-bottom: 32px; }
.sp-section + .sp-section { border-top: 1px solid #ebebeb; padding-top: 28px; }
.sp-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sp-section-title { font-size: 15px; font-weight: 700; color: #111; margin: 0 0 14px; }
.sp-section-head .sp-section-title { margin: 0; }
.sp-clear-btn { background: none; border: none; font-size: 12px; color: #bbb; cursor: pointer; padding: 0; }
.sp-clear-btn:hover { color: #666; }
.sp-empty { font-size: 13px; color: #bbb; margin: 0; text-align: center; padding: 6px 0; }

/* 인기 검색어 */
.sp-popular-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; }
.sp-popular-link { display: flex; align-items: center; gap: 10px; padding: 7px 4px; text-decoration: none; color: #333; font-size: 14px; transition: color .15s; }
.sp-popular-link:hover { color: #9f4ff0; text-decoration: none; }
.sp-popular-num { font-weight: 700; color: #9f4ff0; font-size: 14px; min-width: 18px; }

/* 최근 검색어 */
.sp-recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sp-recent-item { display: flex; align-items: center; background: #f5f5f5; border-radius: 20px; padding: 5px 12px 5px 16px; gap: 6px; }
.sp-recent-word { font-size: 13px; color: #333; text-decoration: none; line-height: 1.4; }
.sp-recent-word:hover { color: #9f4ff0; }
.sp-recent-del { background: none; border: none; font-size: 11px; color: #bbb; cursor: pointer; padding: 0; line-height: 1; }
.sp-recent-del:hover { color: #666; }

/* 최근 본 상품 */
.sp-product-list { list-style: none; margin: 0; padding: 0; }
.sp-product-item { border-bottom: 1px solid #f2f2f2; }
.sp-product-item:last-child { border-bottom: none; }
.sp-product-link { display: flex; align-items: center; gap: 14px; padding: 11px 0; text-decoration: none; transition: opacity .15s; }
.sp-product-link:hover { opacity: .75; }
.sp-product-img { width: 60px; height: 60px; flex-shrink: 0; overflow: hidden; border-radius: 6px; background: #f8f8f8; }
.sp-product-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-product-info { flex: 1; min-width: 0; }
.sp-product-name { font-size: 13px; color: #333; margin: 0 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-product-origin { font-size: 12px; color: #bbb; margin: 0 0 2px; text-decoration: line-through; }
.sp-product-price { font-size: 14px; font-weight: 700; color: #111; margin: 0; }

.mobile-menu-toggle,
.mobile-category-head,
.mobile-menu-overlay {
    display: none;
}

@media screen and (min-width: 1024px) and (max-width: 1280px) {
    #hd_login_msg { display: none; }
}

@media(max-width: 1024px) {
    .header,
    .header__wrap {
        height: 52px;
    }

    .header-spacer {
        height: 52px;
    }

    .header__top { height: 46px; }
    .header__wrap.fixed { transform: translateY(0); position: relative; }
    .header__wrap.m-fixed { position: fixed; top: 0; }

    .usm-wrap { display: none; }

    /*
     * 1행 absolute 레이아웃: 세 요소 모두 absolute + top:50%+translateY로 완전 수직 중앙
     * flex align 의존 제거 → PC CSS 잔재로 밀리는 문제 근본 차단
     */
    .header-container {
        position: relative !important;
        display: block !important;
        height: 52px !important;
        padding: 0 8px !important;
        box-sizing: border-box !important;
    }

    /* ── 왼쪽: 햄버거 ────────────────────────────── */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column !important;
        position: absolute !important;
        top: 50% !important;
        left: -2px !important;
        transform: translateY(-50%) !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px;
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 0;
        background: transparent;
        padding: 0;
        cursor: pointer;
        z-index: 2;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        background: #111;
    }

    /* ── 가운데: 로고 — 완전 중앙 고정 ─────────────── */
    .top-logo {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto !important;
        pointer-events: none;
    }

    .top-logo a {
        pointer-events: auto;
    }

    .logo-img { max-height: 24px; }

    /* ── 오른쪽: 아이콘 ──────────────────────────── */
    .other {
        position: absolute !important;
        top: 50% !important;
        right: -4px !important;
        left: auto !important;
        transform: translateY(-50%) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        height: auto !important;
        gap: 0 !important;
        flex: none !important;
        float: none !important;
        width: auto !important;
    }

    .icon-list {
        display: flex !important;
        align-items: center !important;
        gap: 14px !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }

    .icon-list > li {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto !important;
    }

    .btn-search,
    .mypage-menu,
    .cart-menu {
        width: 22px !important;
        height: 22px !important;
        position: static !important;
    }

    .btn-search .util-icon,
    .mypage-menu .util-icon,
    .cart-menu .util-icon {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }

    /* ── 메뉴 드로어 ──────────────────────────────── */
    .category {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1300;
        display: block;
        width: min(86vw, 360px);
        height: 100vh;
        overflow-y: auto;
        background: #fff;
        border-right: 1px solid #ececec;
        transform: translateX(-100%);
        transition: transform 0.35s ease;
        padding: 12px 18px 120px;
        box-sizing: border-box;
    }

    body.is-mobile-menu-open {
        overflow: hidden;
    }

    body.is-mobile-menu-open .header {
        z-index: 1201;
    }

    body.is-mobile-menu-open .category {
        transform: translateX(0);
    }

    .mobile-category-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 6px;
        padding: 6px 0 10px;
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-category-title {
        font-size: 17px;
        color: #111;
        font-weight: 700;
    }

    .mobile-menu-close {
        width: 32px;
        height: 32px;
        border: 0;
        border-radius: 50%;
        background: #f4f4f4;
        color: #333;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
    }

    .category__list {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        height: auto;
        gap: 0;
    }

    .category__item {
        display: block;
        width: 100%;
        height: auto;
        border-bottom: 1px solid #f3f3f3;
        padding: 2px 0;
    }

    .category__link {
        display: block;
        width: 100%;
        height: auto;
        padding: 11px 4px;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.35;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .category-submenu {
        position: static;
        transform: none;
        min-width: 0;
        opacity: 1;
        visibility: visible;
        border: 0;
        background: transparent;
        padding: 0 0 6px 14px;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0;
    }

    .category__item:hover .category-submenu { transform: none; }

    .category-submenu li {
        display: flex;
        align-items: center;
    }
    .category-submenu li + li::before {
        content: '';
        display: inline-block;
        width: 1px;
        height: 12px;
        background: #ccc;
        margin: 0 6px;
        flex-shrink: 0;
    }

    .category-submenu a {
        text-align: left;
        padding: 6px 2px;
        font-size: 13px;
        font-weight: 500;
        line-height: 1.4;
        white-space: nowrap;
    }

    /* ── 딤 오버레이 ──────────────────────────────── */
    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 1200;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    body.is-mobile-menu-open .mobile-menu-overlay {
        opacity: 1;
        visibility: visible;
    }

    .search,
    .header__wrap.fixed .search {
        top: 64px;
        height: calc(100% - 64px);
        width: 100%;
        left: 0;
        box-sizing: border-box;
    }

    /* ── 상단 띠배너 모바일 ─────────────────────────── */
    .top-strip-banner { height: 34px; }
    .top-strip-inner { height: 34px; }
    .strip-text { font-size: 12px; line-height: 34px; }

    /* ── 모바일 마이페이지 드롭다운 ─────────────────── */
    .mypage-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        transform: translateY(100%);
        border-radius: 16px 16px 0 0;
        border: none;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
        z-index: 1400;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    }
    .mypage-menu:hover .mypage-dropdown { opacity: 0; visibility: hidden; transform: translateY(100%) !important; }
    .mypage-menu.is-open .mypage-dropdown { opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important; }
    .mypage-dropdown a { padding: 16px 0; font-size: 15px; }
}