/*
 * 상품 상세·장바구니·주문·마이 화면과 단독 안내 화면.
 * 토큰과 구간(1199 / 899 / 599)은 skin.css를 따른다. 좁은 화면에서도 본문 글자는 줄이지 않는다.
 */

/* 공통 알림·이동 */
.local-notice { background: var(--surface-tint); color: var(--brand-strong); padding: 7px 20px; text-align: center; font-size: var(--fs-xs); font-weight: 650; letter-spacing: .01em; }
.local-notice a { text-decoration: underline; margin-left: var(--sp-3); }
.skip-link { position: fixed; left: 20px; top: -100px; z-index: 20; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-pill); background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-sm); }
.skip-link:focus { top: 10px; }

/* 이미지 */
.product-media { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--surface-soft); }
.product-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-picture > .product-media { position: absolute; inset: 0; }
.image-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--faint); font: 800 var(--fs-3xl)/1 Arial, sans-serif; letter-spacing: -.04em; }
.image-placeholder span { margin-top: var(--sp-3); font: var(--fs-xs) var(--font); letter-spacing: 0; }

/* 페이지 틀 */
.page-shell { padding-block: 56px 96px; min-height: 560px; }
.page-heading { max-width: 680px; margin: 0 0 40px; }
.page-heading h1 { margin: 10px 0 8px; font-size: var(--fs-3xl); line-height: 1.3; font-weight: 800; letter-spacing: -.05em; text-wrap: balance; }
.page-heading p { margin: 0; color: var(--muted); font-size: var(--fs-md); line-height: 1.8; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 0 28px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.7; }
.breadcrumbs a { color: var(--brand); font-weight: 700; }

/* 버튼 */
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-4); min-height: var(--control-h); padding: 12px 22px; border: 1px solid var(--brand); border-radius: var(--r-md); background: var(--brand); color: var(--on-brand); font: inherit; font-size: var(--fs-md); font-weight: 700; line-height: 1.5; text-align: center; cursor: pointer; transition: background .18s ease, box-shadow .18s ease; }
.button:hover { background: var(--brand-hover); box-shadow: 0 10px 24px rgba(7, 93, 120, .16); }
.button:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.button.secondary { background: var(--surface); color: var(--brand); border-color: var(--border-strong); box-shadow: none; }
.button.secondary:hover { background: var(--brand-soft); border-color: rgba(7, 93, 120, .2); }
.button.full { display: flex; width: 100%; min-height: 52px; }
.button + .button { margin-top: 10px; }
.button span { margin-left: auto; font-size: var(--fs-xl); }
.text-button { min-height: 44px; padding: 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--brand); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
.text-button:hover { background: var(--brand-soft); }
.continue-link { display: inline-block; margin: 4px 0 24px; color: var(--brand); font-size: var(--fs-sm); font-weight: 700; }

/* 안내 상자 */
.notice { margin-block: 20px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-soft); font-size: var(--fs-md); line-height: 1.75; }
.notice.error { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.notice.success { border-color: var(--success-line); background: var(--success-soft); color: var(--success); }
.notice ul { margin: 5px 0 0; padding-left: 20px; }
.field-error { color: var(--danger); font-size: var(--fs-sm); line-height: 1.6; }
.fine-print { margin: 18px 0 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.9; }

.empty-state { position: relative; overflow: hidden; padding: 80px 28px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); text-align: center; box-shadow: var(--shadow-sm); }
.empty-state::before { content: ""; position: absolute; inset: auto -60px -100px auto; width: 230px; height: 230px; border-radius: 50%; background: var(--brand-soft); opacity: .75; }
.empty-state > * { position: relative; z-index: 1; }
.empty-state h1, .empty-state h2, .empty-state h3 { margin: 16px 0 8px; font-weight: 750; letter-spacing: -.045em; text-wrap: balance; }
.empty-state h1 { font-size: var(--fs-3xl); }
.empty-state h2, .empty-state h3 { font-size: var(--fs-xl); }
.empty-state p { max-width: 580px; margin: 0 auto 28px; color: var(--muted); font-size: var(--fs-md); line-height: 1.8; }
.empty-symbol { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: var(--fs-3xl); }

/* 상품 상세 */
.product-detail { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); gap: clamp(40px, 6vw, 72px); align-items: start; }
.product-detail > *, .commerce-grid > *, .cart-row-info { min-width: 0; }
.detail-photo { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); }
.detail-photo::after { content: "WIDI CURATION"; position: absolute; left: 20px; bottom: 18px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(255,255,255,.86); color: var(--brand); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; backdrop-filter: blur(8px); pointer-events: none; }
.detail-summary { position: sticky; top: 24px; padding: 20px 0; }
.detail-tag { display: inline-block; margin-top: 18px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-strong); font-size: var(--fs-xs); font-weight: 700; }
.detail-summary h1 { margin: 16px 0 10px; font-size: var(--fs-3xl); line-height: 1.35; font-weight: 800; letter-spacing: -.05em; overflow-wrap: anywhere; text-wrap: balance; }
.detail-lead { margin: 0; color: var(--muted); font-size: var(--fs-md); line-height: 1.8; }
.detail-price { margin: 28px 0 24px; }
.detail-price strong { display: block; font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.detail-price del { display: block; margin-bottom: 6px; color: var(--muted); font-size: var(--fs-sm); }
.detail-facts { margin: 0 0 24px; padding: 18px 18px 8px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.detail-facts > div { display: flex; margin-bottom: 10px; font-size: var(--fs-md); line-height: 1.7; }
.detail-facts dt { flex: none; width: 100px; color: var(--muted); font-size: var(--fs-sm); font-weight: 650; line-height: 1.95; }
.detail-facts dd { margin: 0; }
.quantity-field { display: flex; align-items: center; justify-content: space-between; margin: 22px 0; padding: 14px 0; border-block: 1px solid var(--border); font-size: var(--fs-md); }
.stepper { display: flex; align-items: stretch; height: var(--control-h); overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); }
.stepper button { width: 46px; border: 0; background: transparent; color: var(--brand); font-size: 18px; cursor: pointer; }
.stepper input { width: 62px; min-width: 0; border: 0; border-inline: 1px solid var(--border); background: transparent; text-align: center; font-size: 16px; font-weight: 750; appearance: textfield; }
.stepper input::-webkit-inner-spin-button { appearance: none; }
.product-description { margin-top: 80px; padding-top: 48px; border-top: 1px solid var(--border); }
.product-description h2 { font-size: var(--fs-2xl); font-weight: 750; letter-spacing: -.05em; }
.description-text { padding: clamp(24px, 5vw, 48px); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); font-size: var(--fs-md); line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.description-text img { display: block; max-width: 100%; height: auto; margin-inline: auto; }

/* 장바구니·주문 공통 틀 */
.commerce-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.summary-card { position: sticky; top: 24px; padding: 28px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.summary-card h2 { margin: 0 0 22px; font-size: var(--fs-xl); font-weight: 750; }
.summary-card dl { margin: 0 0 22px; font-size: var(--fs-md); }
.summary-card dl > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.summary-card dt { color: var(--muted); font-size: var(--fs-sm); line-height: 1.9; }
.summary-card dd { margin: 0; text-align: right; }
.summary-card .summary-total { align-items: center; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.summary-total dt { color: var(--brand); font-size: var(--fs-sm); font-weight: 700; }
.summary-total dd { color: var(--brand-strong); font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.04em; }
.summary-total dd, .row-price { font-variant-numeric: tabular-nums; }

.cart-items { padding: 0 24px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.cart-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 22px; align-items: start; padding: 24px 0; border-bottom: 1px solid var(--border); }
.cart-row:last-of-type { border-bottom: 0; }
.thumb { display: block; flex: none; width: 90px; height: 90px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-soft); }
.cart-row > .thumb { width: 112px; height: 112px; }
.item-title { font-size: var(--fs-md); font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; }
.cart-row-info > p { margin: 6px 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.7; }
.cart-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px; }
.cart-row-actions form { display: flex; align-items: center; gap: var(--sp-2); margin: 0; }
.cart-row-actions input { width: 64px; height: 44px; padding: 5px 7px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--canvas); font-size: 16px; }
.row-price { margin-top: 4px; font-size: var(--fs-lg); font-weight: 800; white-space: nowrap; }

/* 주문서 */
.form-section { margin-bottom: var(--sp-4); padding: 28px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.form-section h2 { margin: 0 0 22px; font-size: var(--fs-xl); font-weight: 750; }
.form-section h2 small, .orders-heading small { margin-left: var(--sp-2); color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.order-product { display: flex; align-items: center; gap: var(--sp-4); padding: 18px 0; border-bottom: 1px solid var(--border); }
.order-product:last-child { border: 0; }
.order-product > div:not(.thumb) { flex: 1; min-width: 0; }
.order-product strong, .order-product .item-title { font-size: var(--fs-md); font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; }
.order-product p { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.7; }
.order-product > b { font-size: var(--fs-md); font-weight: 750; white-space: nowrap; }
.buyer-info { margin: 0; font-size: var(--fs-md); font-weight: 700; }
.buyer-info span { margin-left: 14px; color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.form-field { display: flex; flex-direction: column; gap: var(--sp-2); }
.form-field.wide { grid-column: 1 / -1; }
.form-field label { font-size: var(--fs-sm); font-weight: 700; }
.form-field em { margin-left: 6px; color: var(--danger); font-size: var(--fs-xs); font-style: normal; }
.form-field input, .form-field textarea, .form-field select { width: 100%; min-width: 0; max-width: 100%; min-height: var(--control-h); padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-size: var(--fs-md); line-height: 1.5; transition: border-color .18s ease, box-shadow .18s ease; }
.form-field textarea { resize: vertical; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.form-field .postal-input { max-width: 190px; }
.form-field small { color: var(--muted); font-size: var(--fs-sm); line-height: 1.7; }
.payment-method { display: flex; align-items: center; gap: var(--sp-3); padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--brand-soft); font-size: var(--fs-md); }
.payment-method b { font-weight: 600; }
.payment-method small { margin-left: auto; color: var(--muted); font-size: var(--fs-sm); }
.payment-method > span { width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-size: var(--fs-xs); line-height: 20px; text-align: center; }
.bank-info { display: flex; flex-direction: column; gap: var(--sp-2); margin: 18px 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-soft); font-size: var(--fs-md); }
.bank-info strong { font-size: var(--fs-sm); font-weight: 600; }
.bank-info small { color: var(--muted); font-size: var(--fs-sm); }
.bank-info .field-error { font-weight: 400; }
.agreement { display: flex; gap: 9px; margin: 24px 0; padding: 16px; border-radius: var(--r-md); background: var(--surface-soft); font-size: var(--fs-sm); line-height: 1.8; cursor: pointer; }
.agreement input { flex: none; width: 18px; height: 18px; margin: 3px 0; accent-color: var(--brand); }
[data-mixed-payment] { margin-block: 20px; padding: 16px 18px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface-soft); }
[data-mixed-payment] summary { padding-block: var(--sp-2); color: var(--brand); font-size: var(--fs-md); font-weight: 750; cursor: pointer; }
[data-mixed-payment][open] summary { margin-bottom: var(--sp-4); }

/* 마이·주문 내역 */
.my-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 32px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface-tint); }
.my-intro > div { display: flex; align-items: center; gap: 20px; }
.member-avatar { display: flex; flex: none; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface); color: var(--brand); font: 850 28px Arial, sans-serif; box-shadow: var(--shadow-sm); }
.my-intro h2 { margin: 0 0 8px; font-size: var(--fs-xl); font-weight: 750; }
.my-intro p { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.7; }
.orders-heading { margin: 48px 0 20px; }
.orders-heading h2 { margin: 0; font-size: var(--fs-2xl); font-weight: 750; }
.history-card { margin-bottom: 20px; padding: 28px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.history-card > header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.history-card > header span { margin-left: 16px; color: var(--muted); font-size: var(--fs-sm); }
.history-card > header a { color: var(--brand); font-size: var(--fs-sm); font-weight: 750; white-space: nowrap; }
.history-card > footer { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.history-card > footer span { color: var(--muted); font-size: var(--fs-sm); }
.history-card > footer strong { font-size: var(--fs-xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.status-badge { display: inline-block; padding: 4px 10px; border: 1px solid rgba(7, 93, 120, .11); border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.info-list { margin: 0; }
.info-list > div { display: grid; grid-template-columns: 90px 1fr; gap: 14px; padding: 4px 0 12px; margin-bottom: 12px; border-bottom: 1px dashed var(--border); font-size: var(--fs-md); line-height: 1.8; }
.info-list > div:last-child { border-bottom: 0; }
.info-list dt { color: var(--muted); font-size: var(--fs-sm); line-height: 2.05; }
.info-list dd { margin: 0; overflow-wrap: anywhere; }
.completion { margin: 0 0 48px; padding: 32px 20px 40px; border-radius: var(--r-xl); background: var(--surface-tint); text-align: center; }
.completion > span { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin: 0 auto 24px; border-radius: 50%; background: var(--surface); color: var(--brand); font-size: var(--fs-3xl); font-weight: 800; box-shadow: var(--shadow-sm); }
.completion h1 { margin: 14px 0; font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -.05em; text-wrap: balance; }
.completion p { margin-bottom: 20px; color: var(--muted); font-size: var(--fs-md); }
.completion > strong { display: inline-block; padding: 10px 18px; border-radius: var(--r-pill); background: var(--surface); font-size: var(--fs-sm); font-weight: 400; }
.order-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.order-section-title h2 { margin: 0; }

/* 페이지 이동 */
.pagination nav { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-6); font-size: var(--fs-sm); }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 10px; border-radius: var(--r-pill); }
.pagination a { border: 1px solid var(--border); background: var(--surface); }
.pagination span { color: var(--muted); }
.pagination [aria-current] { color: var(--brand); font-weight: 700; }

/* 연결·오류·결제 등 단독 화면 */
.system-page { container-type: inline-size; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 28px; background: var(--canvas); }
.system-page .page-shell { width: min(680px, 100%); min-height: auto; padding: 0; }
.system-brand { display: flex; width: fit-content; margin: 0 auto 24px; color: var(--brand); font: 900 40px/.9 Arial, sans-serif; letter-spacing: -2.5px; }

/* 태블릿 899px 이하 */
@container (max-width: 899px) {
    .page-shell { padding-block: 36px 64px; min-height: 400px; }
    .page-heading { margin-bottom: 28px; }
    .product-detail { grid-template-columns: 1fr; gap: 28px; }
    .detail-summary { position: static; padding: 0; }
    .product-description { margin-top: 48px; padding-top: 32px; }
    .commerce-grid { grid-template-columns: 1fr; gap: 24px; }
    .summary-card { position: static; padding: 24px; }
    .cart-items { padding-inline: 18px; }
    .cart-row { grid-template-columns: 82px minmax(0, 1fr); gap: 14px; padding: 20px 0; }
    .cart-row > .thumb { width: 82px; height: 82px; }
    .cart-row .row-price { grid-column: 2; margin-top: -6px; }
    .thumb { width: 64px; height: 64px; }
    .form-section { padding: 24px; }
    .form-grid { grid-template-columns: 1fr; gap: 16px; }
    .form-field { grid-column: 1 / -1; }
    .form-field input, .form-field textarea, .form-field select { font-size: 16px; }
    .payment-method { flex-wrap: wrap; }
    .payment-method small { width: 100%; margin: 0; padding-left: 32px; line-height: 1.7; }
    .buyer-info span { display: block; margin: 6px 0 0; }
    .my-intro { flex-direction: column; align-items: flex-start; gap: 20px; padding: 24px; }
    .my-intro > div { gap: 14px; }
    .history-card { padding: 20px; }
    .history-card > header { align-items: flex-start; }
    .history-card > header span { display: block; margin: 6px 0 0; overflow-wrap: anywhere; }
    .history-card .thumb { width: 56px; height: 56px; }
    .info-list > div { grid-template-columns: 72px 1fr; gap: 12px; }
}

/* 모바일 599px 이하 */
@container (max-width: 599px) {
    .page-shell { padding-block: 28px 52px; }
    .page-heading h1, .detail-summary h1, .completion h1, .empty-state h1 { font-size: var(--fs-2xl); }
    .breadcrumbs { margin-bottom: 18px; }
    .detail-photo { border-radius: var(--r-lg); }
    .detail-price strong { font-size: var(--fs-2xl); }
    .detail-facts { padding-inline: 14px; }
    .detail-facts dt { width: 84px; }
    .product-description h2, .orders-heading h2 { font-size: var(--fs-xl); }
    .description-text { padding: 20px; border-radius: var(--r-md); }
    .cart-items { padding-inline: 14px; border-radius: var(--r-md); }
    .cart-row { grid-template-columns: 72px minmax(0, 1fr); }
    .cart-row > .thumb { width: 72px; height: 72px; }
    .form-section { padding: 20px 16px; border-radius: var(--r-md); }
    .summary-card { border-radius: var(--r-md); }
    .order-product { flex-wrap: wrap; align-items: flex-start; }
    .order-product > b { margin-left: auto; }
    .my-intro { border-radius: var(--r-lg); }
    .member-avatar { width: 50px; height: 50px; font-size: 23px; }
    .history-card { padding: 18px 16px; border-radius: var(--r-md); }
    .completion { margin-bottom: 32px; }
    .empty-state { padding: 56px 18px; border-radius: var(--r-lg); }
}

@media (max-width: 599px) {
    .system-page { padding: 16px; }
}
