/* 장바구니 견적서 CSS - #printSection 방식 */

/* === 화면용 (모달) - 기존 디자인 유지 === */

/* 장바구니 + 개별 견적서 모달 - 버튼 고정, 내용만 스크롤 */
#dialogCartEstimate .naple_modal_content_05,
#dialogPrint .naple_modal_content_05 {
    height: auto !important;
    max-height: 90vh;
    overflow: visible;
}

#dialogCartEstimate .naple_estimate,
#dialogPrint .naple_estimate {
    padding: 15px 15px 0 15px;
    width: 712px;
    height: auto;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    max-height: calc(90vh - 40px);
}

/* 스크롤 영역 (견적서 박스만) */
#dialogCartEstimate .naple_estimate_box,
#dialogPrint .naple_estimate_box {
    padding: 15px 24px 20px 24px;
    border: 5px solid #ebebeb;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    height: auto !important;
}

#dialogCartEstimate .naple_estimate_box h1,
#dialogPrint .naple_estimate_box h1 {
    font-size: 36px;
    line-height: 36px;
    text-align: center;
    letter-spacing: 10px;
    font-weight: 700;
}

#dialogCartEstimate .naple_estimate_box_01,
#dialogPrint .naple_estimate_box_01 {
    margin-top: 15px;
}

#dialogCartEstimate .naple_estimate_box_01_left,
#dialogPrint .naple_estimate_box_01_left {
    float: left;
    width: 50%;
}

#dialogCartEstimate .naple_estimate_box_01_left p,
#dialogPrint .naple_estimate_box_01_left p {
    font-size: 12px;
}

#dialogCartEstimate .naple_estimate_box_02,
#dialogPrint .naple_estimate_box_02 {
    margin-top: 2px;
}

#dialogCartEstimate .naple_estimate_box_02 li,
#dialogPrint .naple_estimate_box_02 li {
    float: left;
    display: inline;
    margin-top: 10px;
    padding: 4px 0;
    line-height: 40px;
}

#dialogCartEstimate .naple_estimate_box_02 li:first-child,
#dialogPrint .naple_estimate_box_02 li:first-child {
    margin-top: 0px;
    width: 238px;
    border-top: 2px solid #b7b7b7;
    border-bottom: 2px solid #b7b7b7;
}

#dialogCartEstimate .naple_estimate_box_02 li:last-child,
#dialogPrint .naple_estimate_box_02 li:last-child {
    margin-left: 10px;
}

#dialogCartEstimate .naple_estimate_box_02 input,
#dialogPrint .naple_estimate_box_02 input {
    height: 35px;
}

#dialogCartEstimate .naple_estimate_box_01_right,
#dialogPrint .naple_estimate_box_01_right {
    float: right;
}

#dialogCartEstimate .naple_estimate_box_01_right table,
#dialogPrint .naple_estimate_box_01_right table {
    width: 270px;
    float: right;
    border: 1px solid #707070;
}

#dialogCartEstimate .naple_estimate_box_01_right table tbody tr,
#dialogPrint .naple_estimate_box_01_right table tbody tr {
    border-bottom: 1px solid #b7b7b7;
}

#dialogCartEstimate .naple_estimate_box_01_right table tbody tr th,
#dialogPrint .naple_estimate_box_01_right table tbody tr th {
    width: 49px;
    border-right: 1px solid #b7b7b7;
    border-left: 1px solid #b7b7b7;
    background-color: #f5f5f5;
}

#dialogCartEstimate .naple_estimate_box_01_right table tbody tr td,
#dialogPrint .naple_estimate_box_01_right table tbody tr td {
    width: auto;
}

#dialogCartEstimate .naple_estimate_box_01_right table tbody tr th,
#dialogCartEstimate .naple_estimate_box_01_right table tbody tr td,
#dialogPrint .naple_estimate_box_01_right table tbody tr th,
#dialogPrint .naple_estimate_box_01_right table tbody tr td {
    padding: 3px 0 2px 6px;
    text-align: left;
    font-size: 11px;
    line-height: 16px;
    color: #404040;
}

#dialogCartEstimate .naple_estimate_box_01_right table tbody tr th:first-child,
#dialogPrint .naple_estimate_box_01_right table tbody tr th:first-child {
    border-left: 1px solid #707070;
}

#dialogCartEstimate .naple_estimate_box_01_right table tbody tr:last-child,
#dialogPrint .naple_estimate_box_01_right table tbody tr:last-child {
    border-bottom: 1px solid #707070;
}

#dialogCartEstimate .naple_estimate_box_01_right .naple_estimate_box_003,
#dialogPrint .naple_estimate_box_01_right .naple_estimate_box_003 {
    padding: 0px;
    width: 18px;
    text-align: center;
    border-right: 1px solid #b7b7b7;
}

#dialogCartEstimate .naple_estimate_box_01_right .naple_estimate_box_004,
#dialogPrint .naple_estimate_box_01_right .naple_estimate_box_004 {
    width: 32px;
}

/* 도장 이미지 - 장바구니 + 개별 견적서 공통 */
#dialogCartEstimate .naple_estimate_stamp,
#dialogPrint .naple_estimate_stamp {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 59px;
    height: 59px;
    opacity: 0.9;
}

#dialogCartEstimate .naple_estimate_box_03,
#dialogPrint .naple_estimate_box_03 {
    margin-bottom: 10px;
}

#dialogCartEstimate .naple_estimate_box_03 p,
#dialogPrint .naple_estimate_box_03 p {
    width: 100%;
    margin-bottom: 2px;
    font-weight: bold;
}

#dialogCartEstimate .naple_estimate_box_03_001,
#dialogPrint .naple_estimate_box_03_001 {
    padding: 11px 20px 10px 20px;
    color: #707070;
    font-size: 12px;
    text-align: center;
    border-top: 2px solid #000;
    background-color: #f5f5f5;
}

#dialogCartEstimate .naple_estimate_box_03_001 span,
#dialogPrint .naple_estimate_box_03_001 span {
    font-size: 14px;
    color: #000;
    font-weight: bold;
    vertical-align: baseline;
}

#dialogCartEstimate .naple_estimate_box_03_001_total,
#dialogPrint .naple_estimate_box_03_001_total {
    font-size: 17px;
    font-weight: bold;
}

#dialogCartEstimate .naple_estimate_box_04,
#dialogPrint .naple_estimate_box_04 {
    border: 1px solid #707070;
}

#dialogCartEstimate .naple_estimate_box_04 table tr,
#dialogPrint .naple_estimate_box_04 table tr {
    border-bottom: 1px solid #e5e5e5;
}

#dialogCartEstimate .naple_estimate_box_04 table tr:last-child,
#dialogPrint .naple_estimate_box_04 table tr:last-child {
    border-bottom: 0px;
}

#dialogCartEstimate .naple_estimate_box_04 table tr th,
#dialogPrint .naple_estimate_box_04 table tr th {
    width: 100px;
    text-align: center;
    color: #000;
    background-color: #f5f5f5;
}

#dialogCartEstimate .naple_estimate_box_04 table tr th,
#dialogPrint .naple_estimate_box_04 table tr th {
    padding: 3px 0 2px 0;
}

#dialogCartEstimate .naple_estimate_box_04 table tr td,
#dialogPrint .naple_estimate_box_04 table tr td {
    padding: 3px 10px 2px 10px;
    color: #000;
}

#dialogCartEstimate .naple_estimate_box_04 table tr th,
#dialogCartEstimate .naple_estimate_box_04 table tr td,
#dialogPrint .naple_estimate_box_04 table tr th,
#dialogPrint .naple_estimate_box_04 table tr td {
    font-size: 12px;
}

#dialogCartEstimate .naple_estimate_box_05,
#dialogPrint .naple_estimate_box_05 {
    margin-top: 22px;
}

#dialogCartEstimate .naple_estimate_box_05 p,
#dialogPrint .naple_estimate_box_05 p {
    padding-bottom: 3px;
    text-align: center;
}

#dialogCartEstimate .naple_estimate_box_05_text,
#dialogPrint .naple_estimate_box_05_text {
    padding: 5px 15px;
    border: 1px solid #707070;
}

#dialogCartEstimate .naple_estimate_box_05_text ul li,
#dialogPrint .naple_estimate_box_05_text ul li {
    display: block;
    font-size: 12px;
}

#dialogCartEstimate .naple_estimate_box_05_text ul li:before,
#dialogPrint .naple_estimate_box_05_text ul li:before {
    padding-right: 3px;
    content: '※';
}

/* 버튼 영역 - 스크롤 영향 없이 하단 고정 */
#dialogCartEstimate .naple_estimate_box_btns,
#dialogPrint .naple_estimate_box_btns {
    flex-shrink: 0;
    padding: 15px 0;
    margin: 0;
    text-align: center;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
}

#dialogCartEstimate .naple_estimate_box_btns button,
#dialogPrint .naple_estimate_box_btns button {
    margin: 0 8px;
    width: 110px;
    height: 35px;
    color: #707070;
}

#dialogCartEstimate .naple_estimate_box_btns .naple_background,
#dialogPrint .naple_estimate_box_btns .naple_background {
    color: #fff;
}

#dialogCartEstimate .clear,
#dialogPrint .clear {
    clear: both;
}

/* 장바구니 + 개별 견적서 공통 스타일 */
#dialogCartEstimate .cart_estimate_delivery,
#dialogPrint .cart_estimate_delivery {
    margin: 15px 0;
    padding: 10px 0 10px 10px;
    border-bottom: 1px solid #ddd;
}

#dialogCartEstimate .cart_estimate_label,
#dialogPrint .cart_estimate_label {
    font-weight: bold;
    margin-right: 10px;
    font-size: 14px;
}

#dialogCartEstimate .cart_estimate_select,
#dialogPrint .cart_estimate_select {
    padding: 5px 10px;
    border: 1px solid #b7b7b7;
    font-size: 13px;
    width: 150px;
    height: 30px;
}

#dialogCartEstimate .cart_estimate_item,
#dialogPrint .cart_estimate_item {
    margin: 0;
    padding: 12px 0 12px 10px;
    border-top: 1px solid #ddd;
    border-bottom: none;
    border-left: none;
    border-right: none;
    background: transparent;
}

#dialogCartEstimate .cart_estimate_item:first-of-type,
#dialogPrint .cart_estimate_item:first-of-type {
    border-top: 1px solid #333;
}

#dialogCartEstimate .cart_estimate_item:last-of-type,
#dialogPrint .cart_estimate_item:last-of-type {
    border-bottom: 1px solid #333;
}

#dialogCartEstimate .cart_estimate_row,
#dialogPrint .cart_estimate_row {
    margin: 6px 0;
    font-size: 12px;
    line-height: 1.5;
    min-height: 18px;
}

#dialogCartEstimate .cart_estimate_row_with_right,
#dialogPrint .cart_estimate_row_with_right {
    display: block;
}

/* 세로로 풀기 - 화면용 */
#dialogCartEstimate .cart_estimate_row_with_right .cart_estimate_left,
#dialogCartEstimate .cart_estimate_row_with_right .cart_estimate_right_fixed,
#dialogPrint .cart_estimate_row_with_right .cart_estimate_left,
#dialogPrint .cart_estimate_row_with_right .cart_estimate_right_fixed {
    display: block;
    margin: 6px 0;
    min-height: 18px;
    line-height: 1.5;
}

/* 라벨과 값 붙이기 */
#dialogCartEstimate .cart_estimate_label,
#dialogPrint .cart_estimate_label {
    display: inline-block;
    width: auto;
    font-weight: bold;
    margin-right: 5px;
    font-size: 12px;
}

#dialogCartEstimate .cart_estimate_value,
#dialogPrint .cart_estimate_value {
    font-weight: normal;
    display: inline;
    font-size: 12px;
}

/* 화면용 - 기존 스타일 유지 (수정 없음) */

/* === 인쇄용 (A4 크기) - #printSection 방식 === */
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    /* 모든 요소 숨김 */
    body > *:not(#printSection) {
        display: none !important;
    }

    /* 모달 강제 숨김 */
    .naple_modal {
        display: none !important;
    }

    /* #printSection 표시 */
    #printSection,
    #printSection * {
        visibility: visible !important;
    }

    #printSection {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        background: white;
    }

    /* 견적서 박스 - zoom 적용 */
    #printSection .naple_estimate_box {
        width: 712px;
        margin: 0 auto;
        padding: 15px 24px 20px 24px;
        border: 5px solid #ebebeb;
        box-sizing: border-box;
        background: white;
        zoom: 1.15;
        min-height: 782px;
        height: auto;
    }

    /* 제목 */
    #printSection .naple_estimate_box h1 {
        font-size: 36px;
        line-height: 36px;
        text-align: center;
        letter-spacing: 10px;
        margin: 0 0 15px 0;
        font-weight: 700;
    }

    /* 상단 정보 영역 */
    #printSection .naple_estimate_box_01 {
        margin-top: 15px;
        overflow: hidden;
    }

    #printSection .naple_estimate_box_01_left {
        float: left;
        width: 50%;
    }

    #printSection .naple_estimate_box_01_left p {
        font-size: 12px;
        margin: 0;
    }

    #printSection .naple_estimate_box_02 {
        margin-top: 2px;
        list-style: none;
        padding: 0;
    }

    #printSection .naple_estimate_box_02 li {
        float: left;
        display: inline;
        margin-top: 10px;
        padding: 4px 0;
        line-height: 40px;
    }

    #printSection .naple_estimate_box_02 li:first-child {
        margin-top: 0;
        width: 238px;
        border-top: 2px solid #b7b7b7;
        border-bottom: 2px solid #b7b7b7;
    }

    #printSection .naple_estimate_box_02 li:last-child {
        margin-left: 10px;
    }

    /* 공급자 정보 테이블 */
    #printSection .naple_estimate_box_01_right {
        float: right;
    }

    #printSection .naple_estimate_box_01_right table {
        width: 270px;
        border: 1px solid #707070;
        border-collapse: collapse;
    }

    #printSection .naple_estimate_box_01_right table tbody tr {
        border-bottom: 1px solid #b7b7b7;
    }

    #printSection .naple_estimate_box_01_right table tbody tr:last-child {
        border-bottom: 1px solid #707070;
    }

    #printSection .naple_estimate_box_01_right table tbody tr th {
        width: 49px;
        border-right: 1px solid #b7b7b7;
        border-left: 1px solid #b7b7b7;
        background-color: #f5f5f5;
        padding: 3px 0 2px 6px;
        text-align: left;
        font-size: 11px;
        line-height: 16px;
        color: #404040;
    }

    #printSection .naple_estimate_box_01_right table tbody tr th:first-child {
        border-left: 1px solid #707070;
    }

    #printSection .naple_estimate_box_01_right table tbody tr td {
        width: auto;
        padding: 3px 0 2px 6px;
        text-align: left;
        font-size: 11px;
        line-height: 16px;
        color: #404040;
    }

    #printSection .naple_estimate_box_01_right .naple_estimate_box_003 {
        padding: 0;
        width: 18px;
        text-align: center;
        border-right: 1px solid #b7b7b7;
    }

    #printSection .naple_estimate_box_01_right .naple_estimate_box_004 {
        width: 32px;
    }

    /* 도장 이미지 - 인쇄용 */
    #printSection .naple_estimate_stamp {
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
        width: 59px;
        height: 59px;
        opacity: 0.9;
    }

    #printSection .clear {
        clear: both;
    }

    /* 총 금액 영역 */
    #printSection .naple_estimate_box_03 {
        margin-bottom: 10px;
        clear: both;
    }

    #printSection .naple_estimate_box_03 p {
        width: 100%;
        margin-bottom: 2px;
        font-weight: bold;
        font-size: 12px;
    }

    #printSection .naple_estimate_box_03_001 {
        padding: 11px 20px 10px 20px;
        color: #707070;
        font-size: 12px;
        text-align: center;
        border-top: 2px solid #000;
        background-color: #f5f5f5;
    }

    #printSection .naple_estimate_box_03_001 span {
        font-size: 14px;
        color: #000;
        font-weight: bold;
        vertical-align: baseline;
    }

    #printSection .naple_estimate_box_03_001_total {
        font-size: 17px;
        font-weight: bold;
    }

    /* 배송방법 */
    #printSection .cart_estimate_delivery {
        margin: 15px 0;
        padding: 10px 0 10px 10px;
        border-bottom: 1px solid #ddd;
    }

    #printSection .cart_estimate_delivery .cart_estimate_label {
        font-weight: bold;
        margin-right: 10px;
        font-size: 14px;
    }

    #printSection .cart_estimate_select {
        padding: 5px 10px;
        border: 1px solid #b7b7b7;
        font-size: 13px;
        width: 150px;
    }

    /* 장바구니 항목 */
    #printSection .cart_estimate_item {
        margin: 0;
        padding: 12px 0 12px 10px;
        border-top: 1px solid #ddd;
        border-bottom: none;
        border-left: none;
        border-right: none;
        background: transparent;
        page-break-inside: avoid;
    }

    #printSection .cart_estimate_item:first-of-type {
        border-top: 1px solid #333;
    }

    #printSection .cart_estimate_item:last-of-type {
        border-bottom: 1px solid #333;
    }

    #printSection .cart_estimate_row {
        margin: 6px 0;
        font-size: 12px;
        line-height: 1.5;
        min-height: 18px;
    }

    #printSection .cart_estimate_row_with_right {
        display: block;
    }

    /* 세로로 풀기 - 인쇄용 */
    #printSection .cart_estimate_row_with_right .cart_estimate_left,
    #printSection .cart_estimate_row_with_right .cart_estimate_right_fixed {
        display: block;
        margin: 6px 0;
        min-height: 18px;
        line-height: 1.5;
    }

    /* 라벨과 값 붙이기 */
    #printSection .cart_estimate_label {
        display: inline-block;
        width: auto;
        font-weight: bold;
        margin-right: 5px;
        font-size: 12px;
    }

    #printSection .cart_estimate_value {
        font-weight: normal;
        display: inline;
        font-size: 12px;
    }

    /* 참고사항 */
    #printSection .naple_estimate_box_05 {
        margin-top: 22px;
        page-break-inside: avoid;
    }

    #printSection .naple_estimate_box_05 p {
        padding-bottom: 3px;
        text-align: center;
        font-size: 12px;
        font-weight: bold;
    }

    #printSection .naple_estimate_box_05_text {
        padding: 5px 15px;
        border: 1px solid #707070;
    }

    #printSection .naple_estimate_box_05_text ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    #printSection .naple_estimate_box_05_text ul li {
        display: block;
        font-size: 12px;
        line-height: 1.6;
    }

    #printSection .naple_estimate_box_05_text ul li:before {
        padding-right: 3px;
        content: '※';
    }

    /* 색상 보장 */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
