/*
 * 메인 헤더 시안(열림.svg, 1920px 기준) 반영: 높이 64, 항목 간격 53, 글자 #555, 벡터 로고, '전체 서비스' 메가 패널.
 * layout.css 의 값은 원본 측정에 맞춘 것이라 그대로 두고, 여기서 PC(992px 이상)만 덮어쓴다.
 */

/* ---------- 모바일(드로어) ---------- */
/* '전체 서비스'는 펼치면 제품 워드마크 목록이 나온다. 아이콘 타일·한글명·제목은 PC 패널에만 있다 */
@media (max-width: 991px) {
    .sm-header__logo-mobile { width: 96px; height: auto; }

    .sm-nav__link--trigger { display: block; cursor: pointer; }
    .sm-nav__caret,
    .sm-products__title,
    .sm-products__tile,
    .sm-products__name { display: none; }

    .sm-products__list { margin: 0; padding: 0; list-style: none; }
    .sm-products__item:first-child { border-top: 1px solid var(--sm-color-line); }
    .sm-products__link { display: flex; align-items: center; box-sizing: border-box; min-height: 45px; padding: 0 32px; }
    .sm-products__text { margin: 0; }
    .sm-products__wordmark { display: block; width: auto; height: 12px; }
    .sm-products__plain { color: #00295f; font-size: 16px; font-weight: 700; line-height: 21px; }
}

/* ---------- PC ---------- */
@media (min-width: 992px) {
    .sm-header__inner { min-height: 63px; }
    .sm-header__logo { flex: 0 0 auto; max-width: none; margin-top: 0; }
    .sm-header__logo-desktop { width: 114px; height: auto; }

    /* 링크의 line-height + padding 이 헤더 안쪽 높이를 정하므로 63 에 맞춘다(layout.css 는 63 + 2) */
    .sm-nav__link { padding-right: 26.5px; padding-bottom: 0; padding-left: 26.5px; color: #555; }
    .sm-nav__more-btn { height: 63px; }

    /* 버튼: 높이 42, 글자 좌우 여백 24(테두리 버튼은 테두리 1 포함 23), 관리자 테두리 #ccc */
    .sm-nav__actions .sm-btn {
        display: inline-flex;
        align-items: center;
        box-sizing: border-box;
        height: 42px;
        padding-top: 0;
        padding-bottom: 0;
    }
    .sm-nav__actions .sm-btn--outline { padding-right: 23px; padding-left: 23px; border-color: #ccc; }

    /* 전체 서비스 */
    .sm-nav__item--products { position: static; }
    .sm-nav__link--trigger { display: flex; align-items: center; cursor: default; }
    .sm-nav__caret {
        flex: 0 0 auto;
        width: 16px;
        height: 16px;
        margin-left: 4px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.667 6 8 10.333 12.333 6' stroke='%23555' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 16px 16px;
    }

    /*
     * 열림: 남색 글자 + 화살표 위(호버·키보드 포커스).
     * :has() 를 모르는 브라우저는 선택자 목록 전체를 버리므로 호버 규칙과 나눠 둔다(layout.css 와 같은 이유).
     */
    .sm-nav__item--products:hover > .sm-nav__link { color: #002b5f; }
    .sm-nav__item--products:has(:focus-visible) > .sm-nav__link { color: #002b5f; }
    .sm-nav__item--products:hover > .sm-nav__link .sm-nav__caret {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.667 10 8 5.667 12.333 10' stroke='%23002b5f' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }
    .sm-nav__item--products:has(:focus-visible) > .sm-nav__link .sm-nav__caret {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.667 10 8 5.667 12.333 10' stroke='%23002b5f' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }

    /* 패널: 헤더(sticky) 아래 전체 폭, 안쪽은 콘텐츠 폭 1160 가운데. 헤더 안에서 위치를 잡으려고 li 를 static 으로 풀었다 */
    .sm-products {
        top: 100%;
        right: 0;
        left: 0;
        box-sizing: border-box;
        min-width: 0;
        padding: 36px max(20px, calc((100% - 1160px) / 2)) 44px;
        overflow: visible;
        background: #fff;
        border-top: 1px solid #e5e8eb;
        border-bottom: 1px solid #e5e8eb;
        border-radius: 0;
        /*
         * 패널 아래 나머지 화면을 검정 7% 로 어둡게 한다(헤더는 덮지 않는다).
         * 그림자는 스크롤 영역을 늘리지 않으므로, 짧은 페이지에서 열고 닫을 때 스크롤바가 생겼다 사라지며 화면이 흔들리지 않는다.
         * 아래로 100vh 밀고 100vh 퍼뜨리면 위 끝이 패널 위 끝과 같아져 헤더 위로 올라오지 않는다.
         */
        box-shadow: 0 100vh 0 100vh rgba(0, 0, 0, 0.07);
    }

    .sm-products__title { margin: 0 0 28px; color: #555; font-size: 13px; line-height: 20px; }
    .sm-products__list {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 360px));
        gap: 36px 40px;
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .sm-products__link { display: flex; align-items: center; min-height: 52px; color: #555; }
    .sm-products__link:focus-visible { border-radius: 8px; outline: 2px solid #3d92f6; outline-offset: 4px; }

    .sm-products__tile {
        display: flex;
        flex: 0 0 52px;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 52px;
        height: 52px;
        background: #fff;
        border: 1px solid #e5e8eb;
        border-radius: 8px;
    }
    .sm-products__tile img { display: block; width: 44px; height: 44px; }

    .sm-products__text { display: flex; flex-direction: column; min-width: 0; margin-left: 24px; }
    .sm-products__wordmark { display: block; width: auto; height: 12px; }
    .sm-products__name { margin-top: 12px; color: #555; font-size: 12px; line-height: 12px; }
    /* 시안에 아이콘·워드마크가 없는 제품은 글자로만 보인다 */
    .sm-products__link--text .sm-products__text { margin-left: 0; }
    .sm-products__plain { color: #002b5f; font-size: 16px; font-weight: 700; line-height: 24px; }
}
