/**
 * Nice Select 커스텀 스킨
 * - 폼 필드(.form-group) · LNB(.sel_wrap.form-skin) — 동일 Nice Select 스킨
 * - nice-select.css 로드 이후에 이 파일을 불러올 것
 * - ::after = icon-box 배경(고정) · ::before = chevron(열릴 때만 회전)
 */

/* ============================================
   공통 스킨 (폼 / LNB 드롭다운)
   ============================================ */
.form-group .nice-select,
.sel_wrap .nice-select {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    height: var(--formInpH, 60px);
    line-height: 1;
    padding: 0 44px 0 10px;
    border: 1px solid var(--formBorder, #e0e0e0);
    border-radius: var(--formRadius, 8px);
    font-size: var(--txt, 18px);
    font-weight: 500;
    color: var(--txtBlack1);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

/* 닫힌 박스 — 선택된 값 */
.form-group .nice-select .current,
.sel_wrap .nice-select .current {
    display: flex;
    align-items: center;
    align-self: stretch;
    flex: 1;
    min-width: 0;
    height: auto;
    line-height: var(--txtLine, 1.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-group .nice-select:hover,
.sel_wrap .nice-select:hover {
    border-color: var(--formBorderHover, #c4c4c4);
}

.form-group .nice-select:active,
.form-group .nice-select.open,
.form-group .nice-select:focus,
.sel_wrap .nice-select:active,
.sel_wrap .nice-select.open,
.sel_wrap .nice-select:focus {
    border-color: var(--primary);
}

/* 폼 select — Figma 2112:439 심플 쉐브론 (LNB icon-box와 분리) */
.form-group .nice-select:after {
    content: '';
    right: 12px;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: 0;
    border: 0;
    border-radius: 0;
    transform: translateY(-50%);
    background: transparent;
    pointer-events: none;
}

.form-group .nice-select:before {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    z-index: 1;
    width: 12px;
    height: 8px;
    margin-top: 0;
    transform: translateY(-50%);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.5L6 6l4.5-4.5' stroke='%23111' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px auto no-repeat;
    pointer-events: none;
    transition: transform 0.15s ease-in-out;
}

.form-group .nice-select.open:before {
    transform: translateY(-50%) rotate(180deg);
}

/* LNB 기본 (form과 공유되던 icon-box — sel_wrap 전용으로 아래에서 덮음) */
.sel_wrap .nice-select:after {
    content: '';
    right: 1rem;
    top: 50%;
    width: 2.4rem;
    height: 2.4rem;
    margin-top: 0;
    border: 0;
    transform: translateY(-50%);
    background: transparent;
    pointer-events: none;
}

.sel_wrap .nice-select:before {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    z-index: 1;
    width: 2.4rem;
    height: 2.4rem;
    margin-top: 0;
    transform: translateY(-50%);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.5L6 6l4.5-4.5' stroke='%23111' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 1.2rem auto no-repeat;
    pointer-events: none;
    transition: transform 0.15s ease-in-out;
}

.sel_wrap .nice-select.open:before {
    transform: translateY(-50%) rotate(180deg);
}

/* Figma value-list — shadow 0 8 24 / 0.08 · r8 */
.form-group .nice-select .list,
.sel_wrap .nice-select .list,
.select-wrap .nice-select .list {
    /* vendor cubic-bezier(..., 1.25) 오버슈트 제거 */
    transition: transform 0.22s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)), opacity 0.18s ease-out;
}

.form-group .nice-select .list {
    margin-top: 0;
    top: calc(100% + 4px);
    border: 1px solid var(--formBorder, #e0e0e0);
    border-radius: var(--formRadius, 8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    max-height: 210px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
}

/* 드롭다운 스크롤 — body 전역 스크롤바와 동일 */
.nice-select .list {
    scrollbar-width: thin;
    scrollbar-color: #A9A9A9 transparent;
}

.nice-select .list::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.nice-select .list::-webkit-scrollbar-thumb {
    height: 5px;
    background: #A9A9A9;
    border-radius: 5px;
}

.nice-select .list::-webkit-scrollbar-track {
    background: transparent;
}

.sel_wrap .nice-select .list {
    margin-top: 0;
    border: 1px solid var(--formBorder, #e0e0e0);
    border-radius: var(--formRadius, 8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    max-height: 28rem;
    overflow-y: auto;
}

/* Figma value / value select — h50 · px10 · selected primaryBg + 600 */
.form-group .nice-select .option {
    display: flex;
    align-items: center;
    min-height: var(--formInpH2, 50px);
    height: var(--formInpH2, 50px);
    padding: 0 10px;
    line-height: var(--txtLine, 1.5);
    font-size: var(--txt, 18px);
    font-weight: 500;
    color: var(--txtBlack1);
    background: #fff;
}

.sel_wrap .nice-select .option {
    display: flex;
    align-items: center;
    min-height: var(--formInpH2, 4.6rem);
    padding: 0 1rem;
    line-height: var(--titLine, 1.4);
    font-size: var(--txt, 1.8rem);
    font-weight: 500;
    color: var(--txtBlack1);
}

.form-group .nice-select .option:hover,
.form-group .nice-select .option.focus,
.form-group .nice-select .option.selected.focus,
.sel_wrap .nice-select .option:hover,
.sel_wrap .nice-select .option.focus,
.sel_wrap .nice-select .option.selected.focus {
    background: var(--primaryBg, #f3eff8);
}

.form-group .nice-select .option.selected,
.sel_wrap .nice-select .option.selected {
    font-weight: 600;
    background: var(--primaryBg, #f3eff8);
}

.form-group .nice-select.disabled {
    background: var(--formDisabledBg, #f5f5f5);
    color: var(--txtGray2);
    border-color: var(--formBorder, #e0e0e0);
    pointer-events: none;
}

/* ============================================
   폼 필드 연동
   ============================================ */
.form-group select { display: none; }

.form-group .nice-select.wide {
    width: 100%;
    display: flex;
    float: none;
}

.form-group.is-error .nice-select {
    border-color: var(--formError, #e74c3c);
    background: var(--formErrorBg, rgba(231, 76, 60, 0.06));
}

.form-group.is-error .nice-select.open,
.form-group.is-error .nice-select:focus {
    border-color: var(--formError, #e74c3c);
}

.form-group.is-success .nice-select {
    border-color: var(--formSuccess, #27ae60);
    background: var(--formSuccessBg, rgba(39, 174, 96, 0.06));
}

/* ============================================
   LNB · combo box (.select-wrap / .sel_wrap / .combo-box)
   Figma 2111:758 combo box
     select-wrap
       current — h42 · smTxt2/500 · icon-box 18 투명(쉐브론만 표시, 배경 없음)
       ul — radius8 · shadow 0 8 12 / 0.08 · overflow clip
         li active — h40 · px16 · primaryBg · smTxt2/600
         li — h40 · px16 · white · smTxt2/500
   ============================================ */
.select-wrap select,
.sel_wrap select {
    display: none;
}

.select-wrap .nice-select,
.sel_wrap .nice-select {
    width: auto;
    min-width: 12rem;
    display: inline-flex;
    float: none;
    height: 4.2rem;
    min-height: 4.2rem;
    padding: 0 2.6rem 0 0; /* icon 18 + gap 8 */
    border: 0;
    border-radius: 0;
    font-size: var(--smTxt2);
    font-weight: 500;
    line-height: var(--txtLine);
    color: var(--txtBlack1);
    background: transparent;
    box-shadow: none;
}

.select-wrap .nice-select .current,
.sel_wrap .nice-select .current {
    padding-right: 0.8rem;
    font-size: var(--smTxt2);
    font-weight: 500;
    line-height: var(--txtLine);
}

.select-wrap .nice-select:after,
.sel_wrap .nice-select:after {
    right: 0;
    width: 1.8rem;
    height: 1.8rem;
    background: transparent;
    border-radius: 0;
}

.select-wrap .nice-select:before,
.sel_wrap .nice-select:before {
    right: 0;
    width: 1.8rem;
    height: 1.8rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23111' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 1rem auto no-repeat;
}

.select-wrap .nice-select:hover,
.sel_wrap .nice-select:hover,
.select-wrap .nice-select:active,
.select-wrap .nice-select.open,
.select-wrap .nice-select:focus,
.sel_wrap .nice-select:active,
.sel_wrap .nice-select.open,
.sel_wrap .nice-select:focus {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.select-wrap .nice-select .list,
.sel_wrap .nice-select .list {
    width: 100%;
    min-width: 100%;
    top: 100%;
    margin-top: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.08);
    background: #fff;
    overflow: hidden;
}

.select-wrap .nice-select .option,
.sel_wrap .nice-select .option {
    min-height: 4rem;
    height: 4rem;
    padding: 0 1.6rem;
    font-size: var(--smTxt2);
    font-weight: 500;
    line-height: var(--txtLine);
    color: var(--txtBlack1);
    background: #fff;
}

.select-wrap .nice-select .option:hover,
.select-wrap .nice-select .option.focus,
.select-wrap .nice-select .option.selected.focus,
.sel_wrap .nice-select .option:hover,
.sel_wrap .nice-select .option.focus,
.sel_wrap .nice-select .option.selected.focus {
    background: var(--primaryBg);
}

.select-wrap .nice-select .option.selected,
.sel_wrap .nice-select .option.selected {
    font-weight: 600;
    background: var(--primaryBg);
}

/* LNB · combo box — sub-visual .lnb 슬롯 안 */
.sub-visual .lnb .select-wrap,
.sub-visual .lnb .sel_wrap,
.sub-visual .lnb .combo-box {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    width: auto;
    max-width: 100%;
}

.sub-visual .lnb .select-wrap .nice-select,
.sub-visual .lnb .sel_wrap .nice-select {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
}

.sub-visual .lnb .select-wrap .nice-select .current,
.sub-visual .lnb .sel_wrap .nice-select .current {
    flex: 0 1 auto;
    align-self: auto;
    min-width: auto;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.sub-visual .lnb .select-wrap .nice-select .list,
.sub-visual .lnb .sel_wrap .nice-select .list {
    width: max-content;
    min-width: 100%;
    max-width: calc(100vw - 2 * var(--inPd, 2rem));
}

.sub-visual .lnb .select-wrap .nice-select .option,
.sub-visual .lnb .sel_wrap .nice-select .option {
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .select-wrap,
    .select-wrap .nice-select,
    .sel_wrap,
    .sel_wrap .nice-select {
        width: 100%;
    }

    .sub-visual .lnb .select-wrap,
    .sub-visual .lnb .sel_wrap,
    .sub-visual .lnb .select-wrap .nice-select,
    .sub-visual .lnb .sel_wrap .nice-select {
        width: fit-content;
        max-width: 100%;
    }
}
