/**
 * 견적서 계산기 모달 스타일
 *
 * 제품 선택 시 계산기를 iframe으로 띄우는 모달
 * SP (Style Protocol) 준수
 */

/* 모달 컨테이너 */
.calc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

/* 오버레이 (배경) */
.calc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

/* 모달 콘텐츠 박스 */
.calc-modal-content {
    position: relative;
    z-index: 2;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    max-height: 900px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 모달 헤더 */
.calc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(180deg, #1E4E79 0%, #153A5A 100%);
    color: #fff;
    flex-shrink: 0;
}

.calc-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* 닫기 버튼 */
.calc-modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.calc-modal-close:hover {
    opacity: 1;
}

/* 모달 바디 (iframe 영역) */
.calc-modal-body {
    flex: 1;
    overflow: hidden;
    background: #f5f5f5;
}

.calc-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 모달 푸터 */
.calc-modal-footer {
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    text-align: center;
    flex-shrink: 0;
}

.calc-modal-footer .help-text {
    color: #666;
    font-size: 14px;
}

/* 로딩 상태 */
.calc-modal-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #666;
}

.calc-modal-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1E4E79;
    border-radius: 50%;
    animation: calc-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes calc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 반응형 */
@media (max-width: 768px) {
    .calc-modal-content {
        width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }

    .calc-modal-header {
        padding: 10px 15px;
    }

    .calc-modal-header h3 {
        font-size: 14px;
    }
}

/* 모달이 열렸을 때 body 스크롤 방지 (JS에서 처리하지만 CSS로도 보조) */
body.calc-modal-open {
    overflow: hidden;
}
