/**
 * 전체 메뉴 (00-4-1) · 즐겨찾기 (00-4-3-1 · 00-4-3-2)
 *
 * 색·간격은 _layout/bootstrap/css/style.css 의 토큰을 씁니다.
 */

/* ============================================================
 * 전체 메뉴 (00-4-1)
 * ============================================================ */
.gnb {
    background: #fff;
    display: flex;
    flex-direction: column;
}

.gnb__group {
    border-bottom: 1px solid var(--color-border);
    overflow: hidden;
}

.gnb__head {
    align-items: center;
    background: none;
    border: 0;
    cursor: pointer;
    display: flex;
    height: 48px;
    justify-content: space-between;
    padding: 8px 20px;
    text-align: left;
    width: 100%;
}

.gnb__head-label {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    opacity: .8;
}

/* 화살표 — 시안과 같은 글리프(6x10)를 돌려 씁니다.
   접혀 있으면 아래(-90deg), 펴져 있으면 위(90deg)를 가리킵니다. */
.gnb__caret {
    display: block;
    flex: 0 0 auto;
    height: 10px;
    transform: rotate(-90deg);
    transition: transform .15s ease;
    width: 6px;
}

.gnb__group.is-open .gnb__caret {
    transform: rotate(90deg);
}

/* 소분류 — 3열 (시안 742:19556) */
.gnb__sub {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 4px 0 12px;
}

.gnb__group:not(.is-open) .gnb__sub {
    display: none;
}

.gnb__link {
    color: var(--color-text);
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    opacity: .6;
    padding: 8px 4px 8px 20px;
    word-break: keep-all;
}

.gnb__link:active { opacity: 1; }

/* 좁은 화면에서는 2열로 접습니다. */
@media (max-width: 359px) {
    .gnb__sub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
 * 즐겨찾기 목록 (00-4-3-1)
 * ============================================================ */
.fav {
    background: #fff;
    min-height: 60vh;
}

.fav__hero {
    background: #eef8f8;
    min-height: 124px;
    overflow: hidden;
    padding: 24px 24px 32px;
    position: relative;
}

.fav__title {
    color: var(--color-text);
    font-size: 28px;
    font-weight: 800;
    line-height: 36px;
    position: relative;
    z-index: 1;
}

.fav__deco {
    bottom: -29px;
    height: 153px;
    pointer-events: none;
    position: absolute;
    right: 0;
    width: 200px;
}

.fav__bar {
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    height: 48px;
    justify-content: space-between;
    padding: 8px 28px;
}

.fav__count {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    opacity: .8;
}

.fav__add {
    align-items: center;
    color: var(--color-primary);
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    gap: 4px;
    line-height: 20px;
}

.fav__add-ico {
    display: block;
    height: 10px;
    width: 10px;
}

.fav__list {
    display: flex;
    flex-direction: column;
}

.fav__list .ik-state { padding: 60px 0; }

.fav__row {
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 20px 28px;
}

.fav__row-link {
    color: var(--color-text);
    flex: 1 1 auto;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    opacity: .8;
    word-break: break-word;
}

/* 북마크 — 다시 누르면 목록에서 뺍니다. */
.fav__mark {
    background: none;
    border: 0;
    cursor: pointer;
    flex: 0 0 auto;
    line-height: 0;
    padding: 4px;
}

.fav__mark img {
    display: block;
    height: 15px;
    width: 16px;
}

/* ============================================================
 * 즐겨찾기 추가 (00-4-3-2)
 * ============================================================ */
.fav-add {
    background: #fff;
    min-height: 60vh;
}

.fav-add__bar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    height: 48px;
    justify-content: space-between;
    padding: 8px 28px;
    position: sticky;
    top: var(--topbar-h);
    z-index: 5;
}

.fav-add__lead {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    opacity: .8;
}

.fav-add__done {
    background: none;
    border: 0;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    padding: 4px 0;
}

.fav-add__done[disabled] { opacity: .4; }

.fav-add__error {
    background: rgba(216, 74, 74, .08);
    color: #d84a4a;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    padding: 12px 28px;
}

.fav-add__group { border-bottom: 1px solid var(--color-border); }

.fav-add__head {
    align-items: center;
    background: none;
    border: 0;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 20px 28px;
    text-align: left;
    width: 100%;
}

.fav-add__head-label {
    color: var(--color-primary);
    font-size: 16px;
    font-weight: 600;
    line-height: 20px;
}

.fav-add__caret {
    display: block;
    flex: 0 0 auto;
    height: 10px;
    transform: rotate(-90deg);
    transition: transform .15s ease;
    width: 6px;
}

.fav-add__group.is-open .fav-add__caret {
    transform: rotate(90deg);
}

.fav-add__group:not(.is-open) .fav-add__items { display: none; }

.fav-add__row {
    align-items: center;
    background: none;
    border: 0;
    border-top: 1px solid var(--color-border);
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 20px 28px;
    text-align: left;
    width: 100%;
}

.fav-add__name {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    opacity: .8;
    word-break: break-word;
}

.fav-add__mark {
    display: block;
    flex: 0 0 auto;
    height: 15px;
    width: 16px;
}

/* 켜짐/꺼짐은 두 그림을 바꿔 끼웁니다. (색만 다른 같은 도형입니다) */
.fav-add__row .fav-add__mark--on  { display: none; }
.fav-add__row[aria-pressed="true"] .fav-add__mark--on  { display: block; }
.fav-add__row[aria-pressed="true"] .fav-add__mark--off { display: none; }

.fav__empty-add {
    color: var(--color-primary);
    display: inline-block;
    font-weight: 700;
    margin-top: 8px;
    text-decoration: underline;
}
