/*// ZZAN 특수기능 프리미엄 디자인 CSS //*/

:root {
    /* 기본 설정 */
    --sf-blur: blur(25px);
    --sf-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    
    /* 다크 모드 (기본) */
    --sf-bg: rgba(20, 20, 20, 0.6);
    --sf-border: rgba(255, 255, 255, 0.1);
    --sf-btn-cc-bg: rgba(255, 255, 255, 0.05);
    --sf-btn-cc-text: var(--zzan-neon, #a3ff00);
    --sf-btn-cc-border: rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.4);
    --sf-btn-ir-bg: var(--zzan-neon, #a3ff00);
    --sf-btn-ir-text: #000000;
}

/* 라이트 테마 대응 */
html[data-theme="light"] {
    --sf-bg: rgba(255, 255, 255, 0.75);
    --sf-border: rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.2);
    --sf-shadow: 0 15px 50px rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.15);
    --sf-btn-cc-bg: rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.05);
    --sf-btn-cc-text: #000000;
    --sf-btn-cc-border: rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.3);
}

/*// 1. 하단 바 스타일 (기본 PC) */
.zzan-special-bar {
    position: fixed;
    right: 35px;
    bottom: 35px;
    z-index: 9998; /* 모달보다는 아래 */
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.special-bar-inner {
    background: var(--sf-bg);
    backdrop-filter: var(--sf-blur);
    -webkit-backdrop-filter: var(--sf-blur);
    border: 1px solid var(--sf-border);
    border-radius: 28px;
    padding: 15px;
    box-shadow: var(--sf-shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.special-btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-special {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 28px;
    border-radius: 20px;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    min-width: 180px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.btn-special .icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.btn-special .icon svg {
    width: 22px;
    height: 22px;
}

.btn-special .txt {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.5px;
    z-index: 2;
}

/* 고객센터 버튼 (포인트 컬러 활용 강화) */
.cc-btn {
    background: var(--sf-btn-cc-bg);
    color: var(--sf-btn-cc-text) !important;
    border-color: var(--sf-btn-cc-border);
}
.cc-btn .icon svg { stroke: currentColor; }
.cc-btn:hover { 
    background: var(--zzan-neon, #a3ff00); 
    color: #000 !important; 
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.4);
}

/* 관심고객등록 버튼 (포인트 컬러 배경 강조) */
.ir-btn {
    background: var(--sf-btn-ir-bg);
    color: var(--sf-btn-ir-text) !important;
    box-shadow: 0 5px 15px rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.3);
}
.ir-btn .icon svg { stroke: currentColor; }
.ir-btn::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: rotate(45deg);
    transition: 0.6s;
    z-index: 1;
}
.ir-btn:hover { 
    filter: brightness(1.1); 
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.6);
}
.ir-btn:hover::after { left: 100%; }

/* 맞춤형 퀵 버튼 브랜드 컬러 대응 */
.cq-btn { background: var(--sf-btn-cc-bg); color: var(--sf-btn-cc-text) !important; border-color: var(--sf-btn-cc-border); }
.cq-btn:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.2); }

/* 카카오톡 */
.btn-kakao { background: #FEE500 !important; color: #191919 !important; border: none; }
.btn-kakao:hover { box-shadow: 0 10px 25px rgba(254, 229, 0, 0.4); }
/* 네이버 톡톡 */
.btn-talktalk { background: #03C75A !important; color: #FFFFFF !important; border: none; }
.btn-talktalk:hover { box-shadow: 0 10px 25px rgba(3, 199, 90, 0.4); }
/* 유튜브 */
.btn-youtube { background: #FF0000 !important; color: #FFFFFF !important; border: none; }
.btn-youtube:hover { box-shadow: 0 10px 25px rgba(255, 0, 0, 0.4); }
/* 페이스북 */
.btn-facebook { background: #1877F2 !important; color: #FFFFFF !important; border: none; }
.btn-facebook:hover { box-shadow: 0 10px 25px rgba(24, 119, 242, 0.4); }
/* 인스타그램 */
.btn-instagram { background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%) !important; color: #FFFFFF !important; border: none; }
.btn-instagram:hover { box-shadow: 0 10px 25px rgba(220, 39, 67, 0.4); }

/* PC에서 접기 버튼 숨김 */
.btn-toggle-bar { display: none !important; }

/*// 2. 모달 스타일 (가시성 및 z-index 극대화) */
.zzan-special-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999 !important; /* 모든 요소보다 위에 */
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* 비활성 시 클릭 방지 */
}
.zzan-special-modal.active { 
    display: flex !important; 
    pointer-events: auto !important;
}

.modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: #0f0f0f;
    border: 1px solid rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.3);
    border-radius: 32px;
    overflow: hidden;
    z-index: 2;
    animation: modalPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 40px 100px rgba(0,0,0,0.8);
}
html[data-theme="light"] .modal-content {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 40px 100px rgba(0,0,0,0.2);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.8) translateY(50px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}
.modal-header h3 { margin: 0; font-size: 24px; font-weight: 900; color: var(--zzan-neon, #fff); }
html[data-theme="light"] .modal-header h3 { color: #000; }

.btn-close {
    background: rgba(128, 128, 128, 0.1);
    border: none;
    color: inherit;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
}

.modal-body {
    padding: 30px;
    max-height: 85vh; /* 높이 약간 조절 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* 모바일 부드러운 스크롤 */
}

/* 첫 번째 그룹을 제외한 모든 그룹 상단 여백 추가 */
.form-group + .form-group { margin-top: 25px; }

.form-group label { display: block; margin-bottom: 12px; font-size: 15px; color: #aaa; font-weight: 700; }
html[data-theme="light"] .form-group label { color: #666; }

#interestModal .form-group input, 
#interestModal .form-group select {
    display: block !important;
    width: 100% !important;
    height: 56px !important;
    min-height: 56px !important;
    background: #1a1a1a !important;
    border: 1px solid #333 !important;
    border-radius: 16px !important;
    padding: 0 20px !important;
    color: #fff !important;
    font-size: 16px !important;
    transition: all 0.3s !important;
    box-sizing: border-box !important;
}
html[data-theme="light"] #interestModal .form-group input,
html[data-theme="light"] #interestModal .form-group select {
    background: #f8f8f8 !important;
    border: 1px solid #eee !important;
    color: #000 !important;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--zzan-neon);
    box-shadow: 0 0 20px rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.3);
    background: #222;
}
html[data-theme="light"] .form-group input:focus { background: #fff; }

/* 지역 선택 가로 배치 (PC 전용) */
.select-row {
    display: flex;
    gap: 10px;
}
.select-row select {
    flex: 1;
    min-width: 0; /* flex 아이템 압축 방지 */
}

.privacy-area { background: #1a1a1a; border-radius: 24px; padding: 20px; margin-top: 35px; }
html[data-theme="light"] .privacy-area { background: #f9f9f9; border: 1px solid #f0f0f0; }

.privacy-item + .privacy-item { margin-top: 15px; }

.privacy-flex { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check-label input { width: 18px; height: 18px; margin: 0; }
.check-label span { font-size: 14px; color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-theme="light"] .check-label span { color: #000; }

.btn-privacy-detail {
    background: #333;
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
}
html[data-theme="light"] .btn-privacy-detail { background: #eee; color: #666; }

/* 약관 상세 레이어 */
.privacy-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    outline: none; /* 흰 테두리 방지 */
    border: none; /* 기본 보더 제거 */
}
.privacy-layer.active { display: flex; }

.privacy-layer .layer-inner {
    background: #1a1a1a;
    width: 100%;
    max-width: 420px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    max-height: 70vh; /* 부모 모달 안에서 적절한 높이 유지 */
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    outline: none;
}
html[data-theme="light"] .privacy-layer .layer-inner { 
    background: #fff; 
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
}

.layer-header { padding: 20px 25px; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; }
html[data-theme="light"] .layer-header { border-bottom: 1px solid rgba(0,0,0,0.05); }
.layer-header h4 { margin: 0; font-size: 16px; color: var(--zzan-neon); }
.btn-layer-close { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; }
html[data-theme="light"] .btn-layer-close { color: #000; }

.layer-body { 
    padding: 25px; 
    overflow-y: auto; 
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.privacy-text-content { 
    font-size: 14px; 
    color: #aaa; 
    line-height: 1.7; 
    white-space: pre-wrap; 
    word-break: break-all;
}
html[data-theme="light"] .privacy-text-content { color: #555; }

/* 레이어 내부 스크롤바 디자인 */
.layer-body::-webkit-scrollbar { width: 6px; }
.layer-body::-webkit-scrollbar-track { background: transparent; }
.layer-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
html[data-theme="light"] .layer-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); }

.form-footer {
    margin-top: 35px;
    padding-bottom: 20px; /* 하단 여백 확보 */
}

.btn-submit {
    width: 100%;
    height: 64px;
    background: var(--zzan-neon, #a3ff00);
    border: none;
    border-radius: 20px;
    font-size: 19px;
    font-weight: 900;
    color: #000;
    cursor: pointer;
    box-shadow: 0 15px 40px rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.4);
    transition: all 0.3s;
}
.btn-submit:hover { transform: translateY(-4px); filter: brightness(1.1); box-shadow: 0 20px 50px rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.6); }

/*// 3. 모바일 대응 */
@media screen and (max-width: 768px) {
    .zzan-special-bar { right: 0; bottom: 0; width: 100%; transform: translateY(0) !important; }
    .special-bar-inner { 
        border-radius: 35px 35px 0 0; 
        padding: 20px 25px calc(20px + env(safe-area-inset-bottom)); 
        gap: 15px;
        border-top: 1px solid rgba(var(--zzan-neon-rgb, 163, 255, 0), 0.3);
    }
    .special-btn-group { flex-direction: row; gap: 10px; width: 100%; }
    .btn-special { 
        flex: 1; 
        min-width: 0; 
        flex-direction: column;
        justify-content: center; 
        height: auto;
        padding: 12px 5px;
        gap: 6px;
        border-radius: 18px; 
    }
    .btn-special .icon { width: 20px; height: 20px; }
    .btn-special .icon svg { width: 18px; height: 18px; }
    .btn-special .txt { 
        font-size: 12px; 
        line-height: 1.2;
        text-align: center;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        white-space: normal;
    }
    
    .btn-toggle-bar { display: flex !important; align-self: center; background: none; border: none; width: 100%; height: 20px; justify-content: center; align-items: center; }
    .bar-handle { 
        width: 50px; 
        height: 6px; 
        background: var(--zzan-neon, rgba(128,128,128,0.3)); 
        opacity: 0.6;
        border-radius: 10px; 
    }
    
    .zzan-special-bar.collapsed { transform: translateY(calc(100% - 75px - env(safe-area-inset-bottom))) !important; }
    .zzan-special-bar.collapsed .bar-handle { opacity: 1; }

    /* 모바일 모달 전체 화면화 */
    .modal-content {
        width: 100%; height: 100%;
        max-width: none;
        border-radius: 0;
        border: none;
        display: flex;
        flex-direction: column;
    }
    .modal-header h3 { margin: 0; font-size: 20px; font-weight: 900; color: var(--zzan-neon, #fff); }
    .modal-body { 
        flex: 1;
        padding: 25px; 
        max-height: none; /* 전체 화면이므로 높이 제한 해제 */
    }

    /* 모바일 지역 선택 병렬 구조(Wrap) 및 스타일 보정 */
    .select-row {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    #interestModal .select-row select {
        display: block !important;
        flex: 1 1 calc(50% - 5px) !important; /* 가로 병렬 배치 (2개) */
        width: auto !important;
        height: 56px !important;
        min-height: 56px !important;
        background-color: #1a1a1a !important;
        border: 1px solid #333 !important;
        border-radius: 16px !important;
        padding: 0 15px !important;
        color: #fff !important;
        font-size: 15px !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 10px center !important;
        background-size: 16px !important;
        box-sizing: border-box !important;
    }
    /* 읍/면/동은 다음 줄에 꽉 차게 배치 */
    #interestModal .select-row select[name="addr_dong"] {
        flex: 1 1 100% !important;
    }
    html[data-theme="light"] #interestModal .select-row select {
        background-color: #f8f8f8 !important;
        border: 1px solid #eee !important;
        color: #000 !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 10px center !important;
        background-size: 16px !important;
    }

    /* 모바일 하단 여백 추가 (브라우저 하단 바 대응 및 신청하기 버튼 잘림 방지) */
    .form-footer {
        margin-top: 40px;
        padding-bottom: 120px; /* 대폭 늘려 스크롤 여유 확보 */
    }
}
