/* ===================================================================
   Style Reference Panel - 우측 슬라이드 패널
   PC (769px+): 35% 패널 / 65% 메인
   Tablet (481-768px): 45% 패널 / 55% 메인
   Mobile (≤480px): 100% 패널 (메인 숨김)
   =================================================================== */

/* ===== 패널 오버레이 (모바일 전용) ===== */
.style-ref-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.style-ref-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== 패널 본체 ===== */
.style-ref-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 35%;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    background: linear-gradient(180deg, #1e1a2e 0%, #2a2342 40%, #312450 100%);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    box-sizing: border-box;
}

.style-ref-panel.active {
    transform: translateX(0);
}

/* 라이브 풀스크린(Z Fold 펼침 등): 영상 오버레이(z≈2e9) 위에 선택 패널 노출 */
body.live-fullscreen .style-ref-overlay {
    z-index: 2147483010 !important;
}
body.live-fullscreen .style-ref-panel {
    z-index: 2147483011 !important;
}
body.live-fullscreen .brand-contact-modal,
body.live-fullscreen .brand-contact-overlay {
    z-index: 2147483012 !important;
}

/* 메인 콘텐츠 너비 조정 (패널 활성화 시) */
body.style-ref-open .avatar-container {
    width: 65% !important;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.style-ref-open {
    overflow: hidden;
}

/* ===== 패널 헤더 ===== */
.style-ref-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.style-ref-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.style-ref-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.style-ref-title .ref-icon {
    font-size: 1.2rem;
}

.style-ref-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

.style-ref-close {
    width: 32px;
    height: 32px;
    min-width: 32px;
    max-width: 32px;
    min-height: 32px;
    max-height: 32px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    flex-grow: 0;
    align-self: flex-start;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    line-height: 1;
}

.style-ref-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* ===== 현재 선택된 스타일 표시 ===== */
.style-ref-current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(183, 78, 145, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.style-ref-current-badge {
    padding: 4px 10px;
    background: linear-gradient(135deg, #b74e91, #5e42a6);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.style-ref-current-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 필터 탭 ===== */
.style-ref-tabs {
    display: flex;
    gap: 6px;
    padding: 12px 20px 10px;
    flex-shrink: 0;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.style-ref-tabs::-webkit-scrollbar {
    display: none;
}

.style-ref-tab {
    padding: 6px 14px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.75rem !important;
    font-weight: 500;
    letter-spacing: 0.03em !important;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    height: auto !important;
    line-height: 1.4 !important;
    text-transform: none !important;
}

.style-ref-tab i {
    font-size: 0.7rem;
    opacity: 0.7;
    transition: opacity 0.25s ease;
}

.style-ref-tab:hover {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
}

.style-ref-tab:hover i {
    opacity: 1;
}

.style-ref-tab.active {
    background: linear-gradient(135deg, rgba(183, 78, 145, 0.3), rgba(94, 66, 166, 0.3));
    border-color: rgba(183, 78, 145, 0.4);
    color: #fff;
    font-weight: 600;
}

.style-ref-tab.active i {
    opacity: 1;
}

/* ===== 그리드 컨테이너 ===== */
.style-ref-grid-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 14px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}

.style-ref-grid-wrapper::-webkit-scrollbar {
    width: 5px;
}

.style-ref-grid-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.style-ref-grid-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.style-ref-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* ===== 레퍼런스 카드 ===== */
.style-ref-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    aspect-ratio: 3 / 4;
}

.style-ref-card:hover {
    transform: translateY(-3px);
    border-color: rgba(183, 78, 145, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(183, 78, 145, 0.2);
}

.style-ref-card:active {
    transform: translateY(-1px);
    transition-duration: 0.1s;
}

.style-ref-card.selected {
    border-color: #b74e91;
    box-shadow: 0 0 0 2px rgba(183, 78, 145, 0.5), 0 8px 24px rgba(183, 78, 145, 0.2);
}

.style-ref-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #b74e91;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
    font-weight: 700;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(183, 78, 145, 0.4);
}

/* 카드 이미지 */
.style-ref-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.style-ref-card:hover .style-ref-card-img {
    transform: scale(1.05);
}

/* 카드 하단 그라디언트 오버레이 — 선택 시 확대(좌) + 이름(우) 가로 배치 */
.style-ref-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 10px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.style-ref-card-name {
    flex: 1;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

/* 인기도 뱃지 */
.style-ref-hot-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    background: rgba(255, 87, 51, 0.9);
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    z-index: 3;
    backdrop-filter: blur(4px);
}

.style-ref-hot-badge .hot-emoji {
    font-size: 0.7rem;
}

.style-ref-new-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    background: rgba(76, 175, 80, 0.9);
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    z-index: 3;
    backdrop-filter: blur(4px);
}

/* 이미지 로딩 실패 시 placeholder */
.style-ref-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(94, 66, 166, 0.3), rgba(183, 78, 145, 0.2));
    color: rgba(255, 255, 255, 0.4);
    gap: 8px;
}

.style-ref-card-placeholder i {
    font-size: 2rem;
}

.style-ref-card-placeholder span {
    font-size: 0.7rem;
}

/* ===== 하단 안내 ===== */
/* ===== Hair Color 전용: 참조 적용 모드 (색만 / 색+스타일) ===== */
.style-ref-mode {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 20px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.style-ref-mode-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    gap: 6px;
}

.style-ref-mode-label i {
    font-size: 0.72rem;
    color: rgba(183, 78, 145, 0.85);
}

.style-ref-mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* === 라디오 버튼 형태 (Color only / Color + Style) === */
.style-ref-radio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.78rem !important;
    font-weight: 600;
    letter-spacing: 0.01em !important;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    height: auto !important;
    line-height: 1.4 !important;
    text-transform: none !important;
}

.style-ref-radio:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.16);
}

.style-ref-radio:active {
    transform: scale(0.98);
}

.style-ref-radio i {
    font-size: 0.78rem;
    opacity: 0.85;
}

.style-ref-radio-label {
    flex: 1;
    text-align: left;
}

.style-ref-radio-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.style-ref-radio-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.18s ease;
}

.style-ref-radio.active {
    background: linear-gradient(135deg, rgba(183, 78, 145, 0.28), rgba(94, 66, 166, 0.28));
    border-color: rgba(183, 78, 145, 0.55);
    color: #fff;
    box-shadow: 0 4px 14px rgba(94, 66, 166, 0.18);
}

.style-ref-radio.active .style-ref-radio-dot {
    border-color: #d873b0;
    background: rgba(183, 78, 145, 0.18);
}

.style-ref-radio.active .style-ref-radio-dot::after {
    background: #ffd1ec;
    transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 480px) {
    .style-ref-mode {
        padding: 10px 16px 12px;
    }
    .style-ref-radio {
        padding: 9px 10px;
        font-size: 0.72rem;
    }
}

.style-ref-footer {
    padding: 12px 20px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    text-align: center;
}

.style-ref-footer-text {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.5;
}

.style-ref-footer-text i {
    margin-right: 4px;
    color: rgba(183, 78, 145, 0.6);
}

/* === Apply 버튼 (확정 + 패널 닫기) === */
.style-ref-apply-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    cursor: pointer;
    width: 100%;
    padding: 10px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #b74e91 0%, #7e4ec5 55%, #5e42a6 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow:
        0 6px 18px rgba(94, 66, 166, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
    position: relative;
    overflow: hidden;
}

.style-ref-apply-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.style-ref-apply-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 10px 24px rgba(94, 66, 166, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    filter: brightness(1.06);
}

.style-ref-apply-btn:hover:not(:disabled)::before {
    opacity: 1;
}

.style-ref-apply-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.99);
}

.style-ref-apply-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    filter: grayscale(0.4);
    box-shadow: none;
}

.style-ref-apply-btn i {
    font-size: 0.9rem;
}

/* ===== 빈 상태 ===== */
.style-ref-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    gap: 12px;
}

.style-ref-empty i {
    font-size: 2.5rem;
    opacity: 0.5;
}

.style-ref-empty p {
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ===================================================================
   Capacitor 네이티브 — 패널 전체 스크롤
   flex 내부 scroll 은 iOS WKWebView / Android WebView 모두 불안정 → 패널 자체 scroll
   JS 가 .btk-native-panel-scroll (및 하위호환 .style-ref-ios-scroll) 부여
   =================================================================== */
.style-ref-panel.btk-native-panel-scroll,
.style-ref-panel.style-ref-ios-scroll {
    display: block !important;
    flex-direction: unset !important;
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    transform: none !important;
    overscroll-behavior-y: contain;
}

.style-ref-panel.btk-native-panel-scroll:not(.active),
.style-ref-panel.style-ref-ios-scroll:not(.active) {
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
}

.style-ref-panel.btk-native-panel-scroll.active,
.style-ref-panel.style-ref-ios-scroll.active {
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    right: 0 !important;
    transform: none !important;
}

.style-ref-panel.btk-native-panel-scroll .style-ref-header,
.style-ref-panel.style-ref-ios-scroll .style-ref-header {
    position: sticky;
    top: 0;
    z-index: 5;
}

.style-ref-panel.btk-native-panel-scroll .style-ref-grid-wrapper,
.style-ref-panel.style-ref-ios-scroll .style-ref-grid-wrapper {
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    flex: none !important;
}

.style-ref-panel.btk-native-panel-scroll .style-ref-current,
.style-ref-panel.btk-native-panel-scroll .style-ref-tabs,
.style-ref-panel.btk-native-panel-scroll .style-ref-mode,
.style-ref-panel.btk-native-panel-scroll .style-ref-footer,
.style-ref-panel.style-ref-ios-scroll .style-ref-current,
.style-ref-panel.style-ref-ios-scroll .style-ref-tabs,
.style-ref-panel.style-ref-ios-scroll .style-ref-mode,
.style-ref-panel.style-ref-ios-scroll .style-ref-footer {
    flex-shrink: unset;
}

/* ===================================================================
   반응형
   =================================================================== */

/* 태블릿 */
@media (min-width: 481px) and (max-width: 768px) {
    .style-ref-panel {
        width: 45%;
    }

    body.style-ref-open .avatar-container {
        width: 55% !important;
    }
}

/* 모바일 — safe-area는 헤더/푸터에만 (패널 padding 시 flex 스크롤 깨짐 방지) */
@media (max-width: 768px) {
    .style-ref-panel {
        height: 100dvh;
        max-height: 100dvh;
        min-height: 0;
    }

    .style-ref-header {
        padding: calc(max(env(safe-area-inset-top, 0px), 32px) + 10px) 16px 12px;
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
    }

    .style-ref-footer {
        padding: 12px 16px calc(max(env(safe-area-inset-bottom, 0px), 10px) + 14px);
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
        flex-shrink: 0;
    }

    .style-ref-grid-wrapper {
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }
}

/* 모바일 풀스크린 레이아웃 */
@media (max-width: 480px) {
    .style-ref-panel {
        width: 100%;
        height: 100dvh;
    }

    body.style-ref-open .avatar-container {
        display: none !important;
    }

    .style-ref-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .style-ref-tabs {
        padding: 10px 16px 8px;
    }

    .style-ref-grid-wrapper {
        padding: 8px 12px 16px;
    }
}

/* 대형 모니터 */
@media (min-width: 1400px) {
    .style-ref-panel {
        width: 30%;
    }

    body.style-ref-open .avatar-container {
        width: 70% !important;
    }

    .style-ref-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   브랜드 입점(광고) 카드 — 레퍼런스 그리드 내 프로모션 슬롯
   기존 .style-ref-card 크기/라운드 그대로, 골드 프리미엄 액센트로 상업 톤.
   ============================================================ */
.style-ref-card.brand-promo-card {
    border: 1.5px solid transparent;
    background:
        linear-gradient(#191325, #191325) padding-box,
        linear-gradient(135deg, #e9c46a 0%, #b74e91 55%, #5e42a6 100%) border-box;
    box-shadow: 0 4px 14px rgba(233, 196, 106, 0.14);
}
.style-ref-card.brand-promo-card:hover {
    box-shadow: 0 6px 20px rgba(233, 196, 106, 0.28);
}
.brand-ad-badge {
    position: absolute;
    top: 8px; left: 8px;
    z-index: 3;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #241a0d;
    background: linear-gradient(135deg, #f3d488 0%, #e9b949 100%);
    padding: 3px 8px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    white-space: nowrap;
}
.brand-promo-overlay {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    padding: 26px 10px 9px;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 6, 18, 0.55) 35%, rgba(10, 6, 18, 0.94) 100%);
    pointer-events: none;
    text-align: left;
}
.brand-promo-name {
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #f3d488;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-promo-tagline {
    margin-top: 1px;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-promo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 7px;
}
.brand-promo-try {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}
.brand-promo-link {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9.5px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #b74e91 0%, #7c3aed 100%);
    padding: 4px 9px;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
    transition: filter 0.15s, transform 0.12s;
}
.brand-promo-link:hover { filter: brightness(1.12); color: #fff; }
.brand-promo-link:active { transform: scale(0.96); }
.brand-promo-link i { font-size: 8px; }

/* ============================================================
   브랜드 입점 안내(홍보) 모달 — "브랜드 보기" 클릭 시 노출
   레퍼런스 패널(z-index 999) 위에 뜨는 단일 화면. 웹/앱 공용.
   ============================================================ */
.brand-onboard-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.brand-onboard-modal.active { display: flex; }

.brand-onboard-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 4, 12, 0.66);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: boFadeIn 0.25s ease;
}

.brand-onboard-sheet {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    border: 1.5px solid transparent;
    background:
        linear-gradient(180deg, #1b1530 0%, #241a3c 45%, #2c2050 100%) padding-box,
        linear-gradient(135deg, #e9c46a 0%, #b74e91 55%, #5e42a6 100%) border-box;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    animation: boPopIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    /* 한글이 단어 중간에서 끊기지 않고 어절 단위로 자연스럽게 줄바꿈 (word-break 는 상속됨) */
    word-break: keep-all;
    overflow-wrap: break-word;
}

@keyframes boFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes boPopIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 전역 main.css 의 button 규칙(padding/height/border !important/radius)을 확실히 덮어써 정원형으로 */
.brand-onboard-close {
    position: absolute;
    top: calc(11px + env(safe-area-inset-top, 0px));
    right: 12px;
    z-index: 4;
    width: 34px;
    height: 34px;
    min-width: 0;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 15px !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.12s;
}
.brand-onboard-close::before,
.brand-onboard-close::after { content: none !important; }
.brand-onboard-close:hover { background: rgba(255, 255, 255, 0.2) !important; }
.brand-onboard-close:active { transform: scale(0.9); }

.brand-onboard-scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: calc(30px + env(safe-area-inset-top, 0px)) 22px 8px;
    flex: 1 1 auto;
    min-height: 0;
}

/* ── Hero ── */
.brand-onboard-hero { text-align: center; }
.brand-onboard-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #241a0d;
    background: linear-gradient(135deg, #f3d488 0%, #e9b949 100%);
    padding: 5px 12px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(233, 185, 73, 0.3);
}
.brand-onboard-title {
    margin: 14px 0 0;
    font-size: clamp(15px, 4.7vw, 22px);
    line-height: 1.3;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.brand-onboard-title b {
    background: linear-gradient(135deg, #f3d488 0%, #d98cc0 60%, #a98bf0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-onboard-sub {
    margin: 12px auto 0;
    max-width: 440px;
    font-size: 13.5px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
}
.brand-onboard-sub b { color: #f3d488; font-weight: 700; }

.brand-onboard-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 16px 0 4px;
    padding: 11px 13px;
    border-radius: 12px;
    background: rgba(233, 196, 106, 0.1);
    border: 1px solid rgba(233, 196, 106, 0.28);
    font-size: 12.5px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
    text-align: left;
}
.brand-onboard-notice i { color: #f3d488; font-size: 14px; margin-top: 1px; flex-shrink: 0; }
.brand-onboard-notice b { color: #f3d488; font-weight: 700; }

/* ── Sections ── */
.brand-onboard-section { margin-top: 24px; }
.brand-onboard-section-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 3px solid #e9c46a;
    line-height: 1.3;
}

.brand-onboard-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.brand-onboard-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.brand-onboard-card-ic {
    font-size: 22px;
    line-height: 1.1;
    flex-shrink: 0;
}
.brand-onboard-card-body {
    flex: 1 1 auto;
    min-width: 0;
}
.brand-onboard-card-h {
    font-size: 13.5px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
}
.brand-onboard-card-p {
    font-size: 12px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.72);
}
.brand-onboard-card-p b { color: rgba(255, 255, 255, 0.95); font-weight: 700; }

/* ── Steps ── */
.brand-onboard-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.brand-onboard-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.bo-step-n {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #241a0d;
    background: linear-gradient(135deg, #f3d488 0%, #e9b949 100%);
    box-shadow: 0 2px 6px rgba(233, 185, 73, 0.3);
}
.bo-step-body b {
    display: block;
    font-size: 13.5px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}
.bo-step-body p {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.72);
}

.brand-onboard-closing {
    margin: 24px 0 6px;
    padding: 14px;
    border-radius: 12px;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, rgba(183, 78, 145, 0.18) 0%, rgba(124, 58, 237, 0.18) 100%);
    border: 1px solid rgba(183, 78, 145, 0.3);
}

/* ── CTA (하단 고정) — 여백 슬림, 버튼 높이 최적화 ── */
.brand-onboard-cta {
    flex-shrink: 0;
    display: flex;
    gap: 9px;
    padding: 10px 22px calc(11px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 10, 26, 0.6);
}
/* 전역 button 규칙(height 4.75em/line-height/padding/border !important)을 덮어써 낮고 단정한 버튼으로 */
.bo-btn {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: auto !important;
    min-height: 0;
    padding: 15px 14px !important;
    line-height: 1.15 !important;
    border-radius: 11px !important;
    border: none !important;
    font-size: 14.5px !important;
    font-weight: 800;
    letter-spacing: normal !important;
    text-transform: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: filter 0.15s, transform 0.12s, background 0.15s;
}
.bo-btn::before, .bo-btn::after { content: none !important; }
.bo-btn-primary {
    flex: 2 1 0;
    color: #fff !important;
    background: linear-gradient(135deg, #b74e91 0%, #7c3aed 100%);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}
.bo-btn-primary:hover { filter: brightness(1.1); }
.bo-btn-primary:active { transform: scale(0.97); }
.bo-btn-ghost {
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.09);
}
.bo-btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }
.bo-btn-ghost:active { transform: scale(0.97); }

/* ============================================================
   인앱 Get in touch 문의 폼 (입점하기 경로 전용) — 입점 안내 모달 위에 노출
   전역 main.css 의 input/textarea/button 규칙을 확실히 덮어쓰기 위해 !important 사용.
   ============================================================ */
.brand-contact-modal { z-index: 100001; }
.brand-contact-form {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.bc-field { display: flex; flex-direction: column; gap: 6px; }
.bc-field label {
    font-size: 12.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.01em;
    margin: 0 !important;
}
.brand-contact-form input,
.brand-contact-form textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 11px 13px !important;
    border-radius: 11px !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    font-family: inherit !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.brand-contact-form textarea { resize: vertical; min-height: 92px; }
.brand-contact-form input::placeholder,
.brand-contact-form textarea::placeholder { color: rgba(255, 255, 255, 0.4) !important; }
.brand-contact-form input:focus,
.brand-contact-form textarea:focus {
    border-color: rgba(183, 78, 145, 0.85) !important;
    background: rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18) !important;
}
.bc-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}
.brand-contact-success { text-align: center; padding: 28px 8px 12px; }
.bc-success-ic { font-size: 46px; color: #6ee7a8; line-height: 1; }
.bc-success-h { margin-top: 12px; font-size: 17px; font-weight: 800; color: #fff; }
.bc-success-p { margin-top: 7px; font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, 0.72); }

/* ── 데스크톱: value 카드 2열 여유 ── */
@media (min-width: 600px) {
    .brand-onboard-title { font-size: 23px; }
    .brand-onboard-scroll { padding-left: 28px; padding-right: 28px; }
    .brand-onboard-cta { padding-left: 28px; padding-right: 28px; }
}

/* ── 모바일: 전체화면 시트 + 반응형 타이포 ── */
@media (max-width: 520px) {
    .brand-onboard-modal { padding: 0; }
    .brand-onboard-sheet {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .brand-onboard-sub { font-size: 12.5px; line-height: 1.6; }
}

/* ── 초소형 화면: 카드 타이포 축소 ── */
@media (max-width: 360px) {
    .brand-onboard-sub { font-size: 12px; }
    .brand-onboard-card-h { font-size: 12.5px; }
    .brand-onboard-card-p { font-size: 11.5px; }
}
