@charset "UTF-8";

/* ==========================================================================
   화천(HWACHEON) 주문 및 결제 페이지 스타일
   ========================================================================== */

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    background-color: #ffffff !important;
    color: #111111;
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.main-container {
    width: 100%;
    overflow-x: hidden;
    padding-top: 4.5rem;
    box-sizing: border-box;
}

.max-layout-width {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main-section-padding {
    padding: 4.5rem 0 8rem;
}

/* ──────────────────────────────────────────────────────────────────────────
   1. 서브 히어로 배너
   ────────────────────────────────────────────────────────────────────────── */
.sub-hero-banner {
    width: 100%;
    background: #fafafa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 4.5rem 2rem 4rem;
    text-align: center;
    box-sizing: border-box;
}

.banner-inner {
    max-width: 800px;
    margin: 0 auto;
}

.sub-category-tag {
    font-family: 'Jost', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    color: #888888;
    display: block;
    margin-bottom: 0.8rem;
}

.sub-page-title {
    font-family: 'Jost', sans-serif;
    font-size: 2.6rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #111111;
    margin: 0 0 0.8rem 0;
}

.sub-page-desc {
    font-size: 0.95rem;
    color: #666666;
    margin: 0;
    word-break: keep-all;
}

/* ──────────────────────────────────────────────────────────────────────────
   2. 주문 레이아웃 2단 그리드
   ────────────────────────────────────────────────────────────────────────── */
.order-layout-grid {
    display: grid;
    grid-template-columns: 1fr 390px;
    gap: 3.5rem;
    align-items: flex-start;
}

.order-form-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.order-section-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem 2.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111111;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #f1f3f5;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #f1f3f5;
}

.card-header-flex .card-title {
    margin: 0;
    padding: 0;
    border: none;
}

/* ──────────────────────────────────────────────────────────────────────────
   3. 주문 상품 프리뷰 리스트
   ────────────────────────────────────────────────────────────────────────── */
.order-items-preview-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.order-preview-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #f1f3f5;
}

.order-preview-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.item-thumb-box {
    width: 72px;
    height: 72px;
    min-width: 72px;
    max-width: 72px;
    min-height: 72px;
    max-height: 72px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-thumb {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block;
}

.order-preview-item .item-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-preview-item .item-cate {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #888888;
}

.order-preview-item .item-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: #111111;
    margin: 0;
}

.order-preview-item .item-desc {
    font-size: 0.82rem;
    color: #666666;
}

.order-preview-item .item-price {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Jost', sans-serif;
    color: #111111;
    white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────────────────────
   4. 폼 인풋 & 주소 검색
   ────────────────────────────────────────────────────────────────────────── */
.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.2rem;
}

.input-group:last-child {
    margin-bottom: 0;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #333333;
}

.form-label .required {
    color: #e03131;
}

.form-input, .form-select {
    height: 44px;
    padding: 0 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.92rem;
    font-family: inherit;
    color: #111111;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    background-color: #ffffff;
}

.form-input:focus, .form-select:focus {
    border-color: #111111;
}

.address-postcode-row {
    display: grid;
    grid-template-columns: 1fr 130px;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.btn-search-address {
    height: 44px;
    background: #111111;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-search-address:hover {
    background: #333333;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: #111111;
    border-color: #111111;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: bold;
}

.checkbox-text {
    font-size: 0.88rem;
    color: #495057;
}

/* ──────────────────────────────────────────────────────────────────────────
   5. 우측: 결제 요약 카드
   ────────────────────────────────────────────────────────────────────────── */
.order-summary-container {
    position: sticky;
    top: 6rem;
}

.summary-card {
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 2.2rem;
    background: #fafafa;
    box-sizing: border-box;
}

.summary-title {
    font-family: 'Jost', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #111111;
    margin: 0 0 1.6rem 0;
    padding-bottom: 0.9rem;
    border-bottom: 2px solid #111111;
}

.summary-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #555555;
    margin-bottom: 0.9rem;
}

.summary-price-row span:last-child {
    color: #111111;
    font-weight: 600;
    font-family: 'Jost', sans-serif;
}

.delivery-notice {
    font-size: 0.8rem;
    color: #888888;
    margin: 0 0 1.4rem 0;
}

.summary-divider {
    height: 1px;
    background: #e2e2e2;
    margin: 1.4rem 0;
}

.total-row {
    font-size: 1.05rem;
    color: #111111;
    align-items: center;
}

.total-row strong {
    font-size: 1.55rem;
    font-weight: 700;
    color: #111111;
    font-family: 'Jost', sans-serif;
}

.agreement-box {
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid #e9ecef;
}

.agreement-list {
    margin: 0.8rem 0 0 0;
    padding-left: 0;
    list-style: none;
}

.agreement-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: #718096;
    margin-bottom: 0.45rem;
}

.btn-term-view {
    background: none;
    border: none;
    font-size: 0.76rem;
    color: #888888;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.btn-term-view:hover {
    color: #111111;
}

.btn-pay-now {
    width: 100%;
    height: 54px;
    background: #111111;
    color: #ffffff;
    border: none;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    margin-top: 1.6rem;
    border-radius: 4px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-pay-now:hover {
    background: #333333;
    transform: translateY(-2px);
}

.btn-back-to-cart {
    display: block;
    text-align: center;
    margin-top: 1.1rem;
    font-size: 0.86rem;
    color: #666666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.btn-back-to-cart:hover {
    color: #111111;
    text-decoration: underline;
}

/* ──────────────────────────────────────────────────────────────────────────
   6. 간이 약관 모달 레이어
   ────────────────────────────────────────────────────────────────────────── */
.term-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.term-modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.term-modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.term-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #e9ecef;
}

.term-modal-header h4 {
    margin: 0;
    font-size: 1.05rem;
    color: #111111;
}

.btn-close-term-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888888;
    line-height: 1;
}

.term-modal-body {
    font-size: 0.88rem;
    color: #555555;
    line-height: 1.6;
    max-height: 320px;
    overflow-y: auto;
}

.reveal-element {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1023px) {
    .order-layout-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .order-summary-container {
        position: static;
    }
}

@media (max-width: 767px) {
    .sub-page-title {
        font-size: 2.1rem;
    }
    .form-grid-2col {
        grid-template-columns: 1fr;
    }
}