/**
 * BNC 포스터 계산기 스타일 v1.3.2
 */

/* 메인 컨테이너 */
.bnc-poster-calculator {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    padding: 0;
    margin-bottom: 20px;
}

/* 섹션 공통 */
.bnc-poster-calculator .bnc-section {
    background: #efefef;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 15px;
}

/* 인라인 행 - flexbox */
.bnc-poster-calculator .bnc-inline-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 15px;
}

/* 섹션 라벨 (인쇄, 용지, 코팅) */
.bnc-poster-calculator .bnc-section-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    min-width: 40px;
    flex-shrink: 0;
}

/* 필드 라벨 (사이즈, 수량) */
.bnc-poster-calculator .bnc-field-label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    min-width: 35px;
    flex-shrink: 0;
}

/* 필드 그룹 */
.bnc-poster-calculator .bnc-field-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-height: 44px;
}

/* has-label 필드 그룹: 라벨 + select 가로 배치, 높이 통일 */
.bnc-poster-calculator .bnc-field-group.has-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

/* 라벨은 가운데 정렬 유지 */
.bnc-poster-calculator .bnc-section-label,
.bnc-poster-calculator .bnc-field-label {
    align-self: center;
    line-height: 44px;
}

/* 셀렉트 박스 - 크로스 브라우저 강화 */
.bnc-poster-calculator select {
    flex: 1;
    width: 100%;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 32px 0 12px !important;
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    line-height: 42px !important;
    background-color: #fff !important;
    cursor: pointer;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px 12px !important;
    box-sizing: border-box !important;
    -webkit-border-radius: 6px !important;
    vertical-align: middle !important;
    display: block !important;
    float: none !important;
}

/* Firefox select 높이 수정 */
@-moz-document url-prefix() {
    .bnc-poster-calculator select {
        padding-top: 11px !important;
        padding-bottom: 11px !important;
        line-height: normal !important;
    }
}

/* Safari specific fix */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        .bnc-poster-calculator select {
            height: 44px !important;
            line-height: 44px !important;
            padding-top: 0 !important;
            padding-bottom: 0 !important;
        }
    }
}

.bnc-poster-calculator select:hover {
    border-color: #aaa;
}

.bnc-poster-calculator select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

/* 아코디언 섹션 */
.bnc-poster-calculator .bnc-accordion-section {
    padding: 0;
}

.bnc-poster-calculator .bnc-accordion-header {
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    user-select: none;
}

.bnc-poster-calculator .bnc-accordion-header:hover {
    background-color: #e5e5e5;
}

.bnc-poster-calculator .bnc-accordion-icon {
    font-size: 10px;
    color: #667eea;
    margin-right: 10px;
    transition: transform 0.2s;
}

.bnc-poster-calculator .bnc-accordion-section.open .bnc-accordion-icon {
    transform: rotate(90deg);
}

.bnc-poster-calculator .bnc-accordion-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.bnc-poster-calculator .bnc-accordion-summary {
    margin-left: auto;
    font-size: 13px;
    color: #667eea;
    font-weight: 500;
}

.bnc-poster-calculator .bnc-accordion-content {
    display: none;
    padding: 15px;
    border-top: 1px solid #ddd;
}

.bnc-poster-calculator .bnc-accordion-section.open .bnc-accordion-content {
    display: block;
}

/* 가격 표시 영역 */
.bnc-poster-calculator .bnc-price-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    overflow: hidden;
    color: #fff;
    margin-top: 15px;
}

.bnc-poster-calculator .bnc-price-header {
    padding: 18px 24px;
    cursor: pointer;
}

/* 테마/빌더가 font-weight를 덮어써도 총합계 라인 typography 유지 */
.bnc-poster-calculator .bnc-price-header,
.bnc-poster-calculator .bnc-price-header * {
    font-weight: 400 !important;
}
.bnc-poster-calculator .bnc-total-amount {
    font-size: 23px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}
.bnc-poster-calculator .bnc-total-label {
    font-size: 14px !important;
    font-weight: 400 !important;
}
.bnc-poster-calculator .bnc-total-unit {
    font-size: 14px !important;
    font-weight: 400 !important;
}
.bnc-poster-calculator .bnc-vat-info {
    font-size: 12px !important;
    font-weight: 400 !important;
    opacity: 0.85 !important;
}


.bnc-poster-calculator .bnc-collapsible-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bnc-poster-calculator .bnc-collapsible-header:hover {
    background: transparent !important;
}

.bnc-poster-calculator .bnc-toggle-icon {
    font-size: 10px;
    color: rgba(255,255,255,0.8);
    flex-shrink: 0;
}

.bnc-poster-calculator .bnc-price-summary {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    /* Avoid flex-shrink + word-break effects that can stack each syllable vertically */
    flex-shrink: 0;
    white-space: nowrap;
}

.bnc-poster-calculator .bnc-total-label {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
    margin-right: 10px;
    white-space: nowrap;
    word-break: keep-all;
}

.bnc-poster-calculator .bnc-total-amount {
    font-size: 23px;
    font-weight: 700;
    line-height: 1;
}

.bnc-poster-calculator .bnc-total-unit {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
    margin-left: 0;
}

.bnc-poster-calculator .bnc-vat-info {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 400;
    white-space: nowrap;
    margin-left: 8px;
}

/* 총 합계 라인: 작은 화면에서는 넘침 방지 */
@media (max-width: 480px) {
    .bnc-poster-calculator .bnc-total-amount {
        font-size: 23px;
    }
    .bnc-poster-calculator .bnc-vat-info {
        font-size: 11px;
    }
}

/* 가격 세부내역 - 기본 접힘 */
.bnc-poster-calculator .bnc-collapsible-content {
    display: none;
    background: rgba(0,0,0,0.15);
    border-top: 1px solid rgba(255,255,255,0.15);
    padding: 18px 24px;
}

.bnc-poster-calculator .bnc-collapsible-content.open {
    display: block;
}

.bnc-poster-calculator .bnc-price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bnc-poster-calculator .bnc-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    opacity: 0.95;
}

/* 예상 무게 */
.bnc-poster-calculator .bnc-weight-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: rgba(0,0,0,0.2);
    font-size: 14px;
}

.bnc-poster-calculator .bnc-weight-icon {
    font-size: 18px;
}

.bnc-poster-calculator .bnc-weight-label {
    opacity: 0.85;
}

.bnc-poster-calculator .bnc-weight-value {
    margin-left: auto;
}

/* 반응형 - 모바일에서도 한 줄 유지 */
@media (max-width: 600px) {
    /* 인라인 행 한 줄 유지 */
    .bnc-poster-calculator .bnc-inline-row {
        flex-wrap: nowrap;
        gap: 10px;
    }
    
    .bnc-poster-calculator .bnc-field-group {
        min-width: 0;
        flex: 1;
    }
    
    /* 셀렉트 박스 크기 조정 */
    .bnc-poster-calculator select {
        min-width: 0;
        padding: 0 28px 0 8px;
        font-size: 13px;
    }
    
    /* 라벨 크기 조정 */
    .bnc-poster-calculator .bnc-section-label {
        min-width: 35px;
        font-size: 13px;
    }
    
    .bnc-poster-calculator .bnc-field-label {
        min-width: 30px;
        font-size: 13px;
    }
}
