/* BNC 인쇄 파일 업로드 - 프론트엔드 스타일 */

/* 업로드 영역 컨테이너 */
.bnc-pu-container {
    margin: 20px 0;
    border: none !important;
    border-radius: 8px;
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    outline: none !important;
    box-shadow: none !important;
}

.bnc-pu-container * {
    box-sizing: border-box;
}

/* Elementor Add to Cart 위젯 내부 테두리 강제 제거 */
.elementor-widget-wc-add-to-cart .bnc-pu-container,
.elementor-widget-wc-add-to-cart .bnc-pu-toggle,
.elementor-add-to-cart .bnc-pu-container,
.elementor-add-to-cart .bnc-pu-toggle,
.cart .bnc-pu-container,
.cart .bnc-pu-toggle {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* 토글 버튼 (항상 보이는 헤더) */
.bnc-pu-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 18px;
    background: #6b7b8d;
    border: none !important;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    color: #fff;
    transition: background 0.2s;
    gap: 8px;
    text-align: left;
    outline: none !important;
    box-shadow: none !important;
}

.bnc-pu-toggle:hover {
    background: #A72018;
}

.bnc-pu-toggle.open {
    border-radius: 6px 6px 0 0;
}

.bnc-pu-toggle-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.bnc-pu-toggle-text {
    font-weight: 600;
}

.bnc-pu-toggle-required {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #e74c3c;
    padding: 1px 6px;
    border-radius: 3px;
}

.bnc-pu-toggle-badge {
    font-size: 12px;
    font-weight: 500;
    color: #6b7b8d;
    background: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 4px;
}

.bnc-pu-toggle-arrow {
    margin-left: auto;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    transition: transform 0.3s;
    flex-shrink: 0;
}

.bnc-pu-toggle.open .bnc-pu-toggle-arrow {
    transform: rotate(180deg);
}

/* 펼쳐지는 본문 */
.bnc-pu-body {
    padding: 16px 18px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

/* 드래그&드롭 + 파일선택 영역 (label로 네이티브 파일선택 트리거) */
.bnc-pu-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    border: 2px dashed #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 56px;
}

.bnc-pu-dropzone:hover {
    border-color: #A72018;
    background: #fdf5f4;
}

.bnc-pu-dropzone:hover .bnc-pu-dropzone-icon,
.bnc-pu-dropzone:hover .bnc-pu-dropzone-text {
    color: #A72018;
}

.bnc-pu-dropzone:hover .bnc-pu-browse-btn {
    background: #A72018;
}

.bnc-pu-dropzone.dragging {
    border-color: #A72018;
    background: #fdf5f4;
}

.bnc-pu-dropzone-icon {
    font-size: 22px;
    color: #999;
    flex-shrink: 0;
}

.bnc-pu-dropzone.dragging .bnc-pu-dropzone-icon {
    color: #A72018;
}

.bnc-pu-dropzone-text {
    font-size: 14px;
    color: #666;
}

.bnc-pu-dropzone.dragging .bnc-pu-dropzone-text {
    color: #A72018;
}

.bnc-pu-browse-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #555;
    color: #fff !important;
    border: none !important;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    line-height: 1.4;
}

.bnc-pu-browse-btn:hover {
    background: #333;
}

.bnc-pu-browse-btn:active {
    background: #222;
}

.bnc-pu-file-input {
    display: none !important;
}

/* 업로드 정보 (허용 파일, 크기 제한) */
.bnc-pu-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #999;
}

/* 파일 목록 */
.bnc-pu-file-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bnc-pu-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 13px;
}

.bnc-pu-file-item.uploading {
    opacity: 0.7;
}

.bnc-pu-file-item.error {
    border-color: #e74c3c;
    background: #fdf2f2;
}

.bnc-pu-file-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.bnc-pu-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.bnc-pu-file-size {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}

.bnc-pu-file-progress {
    width: 80px;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.bnc-pu-file-progress-bar {
    height: 100%;
    background: #4a90d9;
    border-radius: 2px;
    transition: width 0.3s;
    width: 0%;
}

.bnc-pu-file-progress-bar.complete {
    background: #27ae60;
}

.bnc-pu-file-progress-bar.error {
    background: #e74c3c;
}

.bnc-pu-file-status {
    font-size: 11px;
    flex-shrink: 0;
    min-width: 60px;
    text-align: right;
}

.bnc-pu-file-status.uploading {
    color: #4a90d9;
}

.bnc-pu-file-status.complete {
    color: #27ae60;
}

.bnc-pu-file-status.error {
    color: #e74c3c;
}

.bnc-pu-file-delete {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.bnc-pu-file-delete:hover {
    color: #e74c3c;
}

/* 주문제목 & 작업메모 */
.bnc-pu-fields {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bnc-pu-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.bnc-pu-field label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    min-width: 70px;
    padding-top: 7px;
    flex-shrink: 0;
}

.bnc-pu-field input[type="text"],
.bnc-pu-field textarea {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}

.bnc-pu-field input[type="text"]:focus,
.bnc-pu-field textarea:focus {
    outline: none;
    border-color: #4a90d9;
}

.bnc-pu-field textarea {
    min-height: 60px;
    resize: vertical;
}

/* 파일 필수 경고 */
.bnc-pu-required-msg {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
}

.bnc-pu-required-msg.show {
    display: block;
}

/* 마이페이지: 재접수 섹션 */
.bnc-pu-resubmit-section {
    margin: 20px 0;
    padding: 20px;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    background: #fdf2f2;
}

.bnc-pu-resubmit-title {
    font-size: 16px;
    font-weight: 700;
    color: #c0392b;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bnc-pu-resubmit-reason {
    padding: 12px;
    background: #fff;
    border: 1px solid #e5c6c6;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.bnc-pu-resubmit-reason strong {
    color: #c0392b;
}

.bnc-pu-resubmit-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bnc-pu-resubmit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.bnc-pu-resubmit-btn:hover {
    background: #c0392b;
}

.bnc-pu-resubmit-status {
    font-size: 13px;
    color: #666;
}

.bnc-pu-resubmit-complete {
    padding: 15px;
    background: #d5f5e3;
    border: 1px solid #27ae60;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    color: #1e8449;
    font-weight: 500;
}

/* 기존 파일 목록 (마이페이지) */
.bnc-pu-existing-files {
    margin-top: 12px;
}

.bnc-pu-existing-files h4 {
    font-size: 13px;
    color: #666;
    margin: 0 0 6px 0;
}

.bnc-pu-existing-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    margin-bottom: 4px;
}

.bnc-pu-existing-file .status-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.bnc-pu-existing-file .status-uploaded {
    background: #d5f5e3;
    color: #27ae60;
}

.bnc-pu-existing-file .status-resubmit_requested {
    background: #fdebd0;
    color: #e67e22;
}

.bnc-pu-existing-file .status-resubmitted {
    background: #d6eaf8;
    color: #2980b9;
}

/* 반응형 */
@media (max-width: 600px) {
    .bnc-pu-container {
        padding: 14px;
    }
    
    .bnc-pu-dropzone {
        flex-direction: column;
        padding: 14px;
        gap: 8px;
    }
    
    .bnc-pu-field {
        flex-direction: column;
        gap: 4px;
    }
    
    .bnc-pu-field label {
        padding-top: 0;
    }
    
    .bnc-pu-file-item {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .bnc-pu-file-progress {
        width: 50px;
    }
    
    .bnc-pu-info {
        flex-direction: column;
        gap: 2px;
    }
}
