@charset "utf-8";
/************************************************************************
 * filename     : common.css
 * description  : 명성인터내셔날 common style CSS
 * date         : 2025.10.20
************************************************************************/

/*===== [공통] LAYOUT =====*/
html {
    font-size: 62.5%;
    /* 1rem = 10px */
}

body {
    font-size: 1.6rem;
    /* = 16px 기본 본문 */
    margin: 0;
    padding: 0;
    font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "맑은 고딕", sans-serif;
    color: var(--text);
    background: #fff;
    line-height: 1.5;
}

.container {
    width: min(100% - 32px, var(--container));
    margin-inline: auto;
}

/*===== [공통] HEADER =====*/

/* ===== 상단 유틸 메뉴 ===== */
.header-top {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1.2rem;
}

.util-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 36px;
}

.util-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.util-links a {
    color: #374151;
    font-weight: 600;
    position: relative;
    padding: 0 10px;
    color: #333;
    text-decoration: none;
    font-size: 1.2rem;
}

.util-links a:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background-color: #ddd;
}

.util-links a:hover {
    color: var(--primary);
}


/* ===== 1단 Header + GNB (PC) ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 64px
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800
}

.brand__logo {
    display: block;
    width: clamp(96px, 14vw, 160px);
    aspect-ratio: 3 / 1;
    background: center / contain no-repeat;
    background-image: url('../../images/common/logo-ms.png');
}

.brand__name {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


.nav__spacer {
    flex: 1
}

.nav__menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 18px
}

.nav__menu>li {
    position: relative
}

.nav__menu>li>.sub-menu {
    top: 100%;
    margin-top: 8px;
    z-index: 40;
}

.nav__menu>li>.sub-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
}

.nav__menu a {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 600
}

.nav__menu a:hover {
    background: rgba(0, 71, 148, 0.06);
    color: var(--primary);
}

.sub-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    min-width: 160px;
    list-style: none;
    margin: 0;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: none;
}

.nav__menu>li:hover>.sub-menu,
.nav__menu>li:focus-within>.sub-menu,
.nav__menu>li>.sub-menu:hover {
    display: block;
}

/* (선택) 상위 메뉴 hover 중 강조 유지 */
.nav__menu>li:hover>a {
    background: rgba(0, 71, 148, 0.06);
    color: var(--primary);
}

.sub-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.sub-menu a:hover {
    background: rgba(0, 71, 148, 0.06);
}

.nav__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
}

.nav__toggle svg {
    width: 22px;
    height: 22px
}


/* ===== 4단: 하단 유틸 메뉴 ===== */
.utility {
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.util-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    justify-content: center;
    padding: 0 12px;
    font-weight: 700;
}

.util-list a {
    font-size: 1.4rem;
    position: relative;
    padding: 0 15px;
    color: #333;
    text-decoration: none;
}

.util-list a:hover {
    color: var(--primary);
}

.util-list a:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background-color: #ddd;
}


/* ===== 5단: Footer ===== */
.site-footer {
    padding-top: clamp(16px, 2.5vw, 50px);
    background: #f9fafb;
    color: #374151;
}

.footer-top {
    display: grid;
    padding: 30px 0;
    gap: 15px;
}

.footer-info {
    font-size: 1.4rem;
    color: var(--text);
}

.footer-info ul {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 0;
    list-style: none;
    padding: 0;
    margin: 0;
    color: #555;
}

.footer-info ul li {
    position: relative;
    display: inline-block;
    padding: 0 10px 0 0;
    margin: 0 10px 0 0;
    color: #333;
    line-height: 1;
}

.footer-info ul li:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 12px;
    background-color: #ddd;
}

.copyright {
    border-top: 1px dashed var(--border);
    font-size: 1.2rem;
    color: var(--muted);
}

/* 접근성: 스킵링크 */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden
}

.skip-link:focus {
    left: 12px;
    top: 12px;
    width: auto;
    height: auto;
    background: #111;
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    z-index: 1000
}


/*===== MEDIA QUERIES : DESKTOP =====*/
@media screen and (min-width: 768px) {}

/*===== MEDIA QUERIES : WIDE DESKTOP =====*/
@media screen and (min-width: 992px) {

    /* PC 유지, 모바일 드로어는 숨김 */
    .nav__menu {
        display: flex;
    }

    .nav__toggle {
        display: none;
    }

    .drawer {
        display: none !important;
    }

}

/*===== MEDIA QUERIES : MOBILE =====*/
@media (max-width: 991.98px) {

    .nav__menu {
        display: none;
    }

    .nav__toggle {
        display: inline-flex;
    }

    .drawer {
        position: fixed;
        inset: 0;
        height: 100dvh;
        background: transparent;
        display: block;
        z-index: 1000;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translateY(6%);
        transition: opacity .22s ease, transform .22s ease;
        border-top: none;
    }

    .drawer.open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    body.nav-open {
        overflow: hidden;
    }

    .drawer .drawer-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, .45);
    }

    .drawer .drawer-panel {
        position: absolute;
        inset: 0;
        background: #fff;
        display: grid;
        grid-template-rows: auto 1fr;
    }

    .drawer .drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 16px;
        border-bottom: 1px solid #e5e7eb;
        background: #fff;
    }

    .drawer .drawer-title {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        font-weight: 800;
    }

    .drawer .close-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        border: 1px solid #e5e7eb;
        background: #fff;
        display: grid;
        place-items: center;
    }

    .drawer .drawer-body {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        height: 100%;
    }

    .m-util {
        display: flex;
        justify-content: space-around;
        gap: 24px;
        padding: 12px 0;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 6px;
    }

    .m-util a {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        text-decoration: none;
        color: #333;
        font-weight: 500;
        font-size: 1.4rem;
    }

    /* 아이콘 공통 설정 */
    .m-util a::before {
        font-family: 'Material Symbols Outlined';
        font-weight: normal;
        font-style: normal;
        font-size: 18px;
        line-height: 1;
        display: inline-block;
        vertical-align: middle;
        color: #555;
    }

    /* 각 항목별 아이콘 지정 */
    .m-util a.m-util__cart::before {
        content: "shopping_cart";
    }

    .m-util a.m-util__login::before {
        content: "login";
    }

    .m-util a.m-util__join::before {
        content: "person_add";
    }

    /* hover 효과 (선택사항) */
    .m-util a:hover::before {
        color: #111;
    }

    .m-util a:hover {
        color: #111;
    }

    .m-accordion {
        list-style: none;
        margin: 0;
        padding: 12px;
        display: grid;
        gap: 8px;
    }

    .m-acc-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 12px;
        border-radius: 10px;
        border: 1px solid var(--border);
        background: #fff;
        font-weight: 700;
        transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
    }

    .m-acc-btn[aria-expanded="true"] {
        border-color: var(--primary);
        box-shadow: 0 0 0 2px rgba(0, 71, 148, .08) inset;
        background: var(--bg-soft);
    }

    .acc-caret {
        flex: 0 0 auto;
        width: 18px;
        height: 18px;
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path fill="%23000" d="M9 6l6 6-6 6"/></svg>') center/100% 100% no-repeat;
        -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path fill="%23000" d="M9 6l6 6-6 6"/></svg>') center/100% 100% no-repeat;
        background: #4b5563;
        transform: rotate(0deg);
        transition: transform .22s ease, background-color .22s ease;
    }

    .m-acc-btn[aria-expanded="true"] .acc-caret {
        transform: rotate(90deg);
        background: var(--primary);
    }

    .m-sub {
        display: block;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-4px);
        transition: max-height .28s ease, opacity .22s ease, transform .22s ease;
        will-change: max-height, opacity, transform;
        margin: 0;
        padding: 0 0 0 10px;
    }

    .m-sub li {
        line-height: 1.8;
    }

    .m-sub li a {
        font-size: 1.4rem;
    }

    .m-sub.open {
        opacity: 1;
        transform: translateY(0);
    }

}

/* ===== 상단 이동 버튼 ===== */
.btn-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: var(--primary, #004694);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
    z-index: 999;
}

.btn-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-top:hover {
    background: #0369a1;
}