/* 📘 책자 상품 페이지 전용 스타일시트 */

/* 메인 폼 컨테이너 스타일 */
.s_form {
    background: #f8f9fa;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.left_table {
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08) !important;
    padding: 10px !important; /* 12px → 10px 여백만 줄임 */
    margin-bottom: 5px !important; /* 6px → 5px 간격만 줄임 */
    border: 1px solid #e9ecef !important;
}

/* 섹션 제목 스타일 */
.left_table h2 {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 3px solid #3498db;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

/* 테이블 스타일 */
.tb1 {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-bottom: 3px !important; /* 4px → 3px 테이블 간격만 줄임 */
    background: white !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #dee2e6 !important;
}

.tb1 th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    color: #495057 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    padding: 4px 12px !important; /* 6px → 4px 높이만 줄임 */
    text-align: left !important;
    border-bottom: 1px solid #dee2e6 !important;
    white-space: nowrap !important;
    min-width: 120px !important;
    letter-spacing: -0.3px !important;
    line-height: 1.2 !important;
    height: auto !important; /* autobook.css의 height:24px 덮어쓰기 */
}

.tb1 td {
    padding: 4px 12px !important; /* 6px → 4px 높이만 줄임 */
    background: white !important;
    border-bottom: 1px solid #f1f3f4 !important;
    vertical-align: middle !important;
    line-height: 1.2 !important;
    height: auto !important; /* autobook.css의 height:24px 덮어쓰기 */
}

.tb1 tr:last-child th,
.tb1 tr:last-child td {
    border-bottom: none;
}

/* 입력 필드 스타일 */
.tb_input {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 0 8px !important;
    font-size: 13px !important;
    color: #333 !important;
    background-color: #fff !important;
    font-family: inherit !important;
    outline: none !important;
    box-sizing: border-box !important;
    height: 30px !important; /* 34px → 30px 높이만 줄임 */
    line-height: normal !important;
    vertical-align: middle !important;
    display: inline-flex;
    align-items: center;
}

.tb_input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.tb_input:hover {
    border-color: #aaa;
}

.tb_input[readonly] {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

/* 셀렉트박스 스타일 - autobook.css 덮어쓰기 */
.s_form select,
select {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 22px 0 8px;
    font-size: 13px;
    color: #333;
    background-color: #fff;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 6px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    height: 30px !important; /* 34px → 30px 높이만 줄임, autobook.css 덮어쓰기 */
    line-height: normal !important;
    vertical-align: middle !important;
    display: inline-flex;
    align-items: center;
}

select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

select:hover {
    border-color: #aaa;
}

/* 규격 선택 영역 */
.size-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.size-input-group input[type="text"] {
    width: 60px;
    text-align: center;
}

.size-input-group span {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    line-height: 1.1;
}

/* 제본 방식 영역 */
.binding-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

/* 파일 업로드 컨테이너 */
.file-upload-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 0;
    margin: 6px 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    border: none;
}

.file-upload-container .tb1 {
    margin: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

.file-upload-container .tb1 th {
    background: linear-gradient(135deg, #343a40 0%, #495057 100%) !important;
    color: white !important;
    font-weight: 600;
    font-size: 14px;
    border: none !important;
    padding: 12px 16px;
}

/* 더 강력한 셀렉터로 추가 */
div.file-upload-container table.tb1 th {
    background: linear-gradient(135deg, #343a40 0%, #495057 100%) !important;
    color: white !important;
}

.file-upload-container td {
    background: rgba(255, 255, 255, 0.95) !important;
    border: none !important;
    padding: 12px;
}

/* 커스텀 파일 입력 버튼 */
.custom-file-upload {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.file-upload-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.3);
}

.file-upload-btn:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-1px);
}

.file-status {
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: #4a5568;
    min-width: 170px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.file-status.has-file {
    background: #f0fff4;
    border-color: #68d391;
    color: #276749;
}

.file-delete-btn {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-delete-btn:hover {
    background: #fc8181;
    color: white;
    border-color: #f56565;
}

.file-note {
    color: #718096;
    font-size: 11px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* 견적 비교 카드 스타일 */
.estimate-comparison-wrapper {
    margin: 10px 0;
    padding: 0;
}

.estimate-cards-container {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.estimate-card {
    flex: 1;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9;
}

.estimate-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.card-header {
    padding: 12px 16px 8px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

.digital-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.offset-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* 최저가 배지 */
.best-price-badge {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #8b4513;
    padding: 5px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
    border: 2px solid #fff;
    animation: bestPricePulse 2s infinite;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 3px;
}

@keyframes bestPricePulse {
    0%, 100% {
        transform: translateY(-50%) scale(1);
        box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
    }
    50% {
        transform: translateY(-50%) scale(1.05);
        box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
    }
}

.card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.card-content {
    padding: 12px;
}

.price-section {
    margin-bottom: 16px;
}

.main-price {
    margin-bottom: 4px;
}

.price-amount {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.05;
    letter-spacing: -0.025em;
    display: block;
}

.unit-price {
    margin-top: 2px;
}

.unit-text {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    line-height: 1.1;
}

.button-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.estimate-card button {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    line-height: 1.1;
}

.btn-estimate {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0 !important;
}

.btn-estimate:hover {
    background: #f1f5f9;
    color: #334155;
    transform: translateY(-1px);
}

.btn-cart {
    color: white;
    border: none !important;
}

.btn-digital {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-digital:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
}

.btn-offset {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-offset:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
}

.btn-order {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none !important;
}

.btn-order:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}

/* 상품 이미지 스타일 */
.right_table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 16px;
    margin-bottom: 6px;
    border: 1px solid #e9ecef;
}

.item-nav2 {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #dee2e6;
}

.itn_txt {
    font-size: 13px;
    color: #495057;
    font-weight: 500;
}

.itn_txt a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.itn_txt a:hover {
    text-decoration: underline;
}

.imgframe {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.img-wrap {
    position: relative;
    width: 100%;
    background: #f8f9fa;
}

#sit_pvi_big {
    width: 100%;
    height: 100%;
}

#sit_pvi_big a {
    display: none;
    width: 100%;
    height: 100%;
}

#sit_pvi_big a.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

#sit_pvi_big img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

#sit_pvi_thumb {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow-x: auto;
}

.img_thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.img_thumb:hover {
    border-color: #007bff;
}

.img_thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 🔧 div.price 클릭 방해 문제 해결 */
.price {
    pointer-events: none !important;
    z-index: -1 !important;
}

/* 견적 카드는 정상 클릭 가능 */
.estimate-section,
.estimate-card,
.estimate-card button {
    pointer-events: auto !important;
    z-index: 1000 !important;
    position: relative !important;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .left_table {
        padding: 8px;
        margin: 4px;
    }
    
    .tb1 th,
    .tb1 td {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .estimate-cards-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .card-content {
        padding: 8px;
    }
    
    .price-amount {
        font-size: 24px;
    }
} 