.pay-dialog { width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 22px; background: transparent; color: #3f3028; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.pay-dialog::backdrop { background: #2b231e8c; }
.pay-box { position: relative; display: grid; gap: 12px; padding: 26px 22px 22px; border: 1px solid #dfd1bf; border-radius: 22px; background: linear-gradient(145deg,#fffaf0,#f4eadb); font-family: var(--sans, sans-serif); }
.pay-close { position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border: 0; background: transparent; color: #7a6350; font-size: 24px; line-height: 1; cursor: pointer; }
.pay-title { margin: 0; padding-right: 36px; font: 700 20px/1.4 var(--serif, serif); color: #2b231e; }
.pay-price { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.pay-price del { color: #9b8a76; font-size: 13px; }
.pay-price strong { color: #55312d; font: 800 26px/1.2 var(--sans, sans-serif); font-variant-numeric: tabular-nums; }
.pay-note { margin: 0; color: #6a5245; font-size: 13px; line-height: 1.7; word-break: keep-all; }
.pay-consents { display: grid; gap: 5px; padding: 9px 11px; border: 1px solid #e8d8c0; border-radius: 14px; background: #fffaf0b8; }
.pay-consent { display: flex; align-items: flex-start; gap: 8px; color: #6a5648; font-size: 11px; line-height: 1.5; word-break: keep-all; cursor: pointer; }
.pay-consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: #55312d; }
.pay-beta { margin: 0; padding: 8px 10px; border-radius: 10px; background: #f3ead9; color: #795c47; font-size: 12px; line-height: 1.6; }
.pay-message { margin: 0; min-height: 0; color: #9a3d32; font-size: 12px; line-height: 1.6; }
.pay-message:empty { display: none; }
.pay-submit { min-height: 50px; border: 1px solid #55312d; border-radius: 14px; background: #55312d; color: #fff8e9; font: 600 15px/1.5 var(--sans, sans-serif); cursor: pointer; }
.pay-submit:disabled { border-color: #decdbd; background: #efe4d2; color: #9b8a76; cursor: default; }
.pay-close:focus-visible, .pay-submit:focus-visible { outline: 2px solid #a58b66; outline-offset: 3px; }
.pay-coins-dialog { width: min(500px, calc(100vw - 24px)); overflow-y: auto; overscroll-behavior: contain; }
.pay-coins-dialog .pay-price strong { font-size: 20px; }
.pay-coin-products { display: grid; gap: 10px; }
.pay-coin-product { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 1.5px solid #e3d5c1; border-radius: 12px; background: #fffdf8; color: #3f3028; font-family: var(--sans, sans-serif); text-align: left; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.pay-coin-product:hover:not(:disabled) { border-color: #b99a72; }
.pay-coin-product.is-selected { border-color: #55312d; background: #fff5e2; box-shadow: 0 0 0 1px #55312d, 0 4px 14px rgba(85, 49, 45, .12); }
.pay-coin-product:disabled { opacity: .5; cursor: default; }
.pay-coin-left { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.pay-coin-badge { padding: 3px 8px; border-radius: 999px; background: #f0e6d4; color: #6a5245; font: 800 11px/1.2 var(--sans, sans-serif); letter-spacing: .02em; }
.pay-coin-badge.is-popular { background: #a3392b; color: #fff8e9; }
.pay-coin-badge.is-once { background: #fff; border: 1px solid #a3392b; color: #a3392b; }
.pay-coin-amount { margin: 0; color: #2b231e; font: 800 19px/1.3 var(--sans, sans-serif); letter-spacing: -.02em; }
.pay-coin-detail { margin: 0; color: #7a6350; font-size: 12px; line-height: 1.5; }
.pay-coin-side { display: grid; justify-items: end; gap: 4px; }
.pay-coin-price { color: #55312d; font: 800 17px/1.2 var(--sans, sans-serif); font-variant-numeric: tabular-nums; }
.pay-coin-rate { padding: 2px 7px; border-radius: 999px; background: #efe7d2; color: #55712f; font: 800 11.5px/1.3 var(--sans, sans-serif); }
.pay-coin-product.is-selected .pay-coin-price::before { content: "✓ "; color: #a3392b; }
.pay-coin-login { color: #55312d; font-size: 13px; line-height: 1.6; text-align: center; }
.pay-coin-retry { padding: 12px; border: 1px solid #decdbd; border-radius: 12px; background: #fffaf0; color: #55312d; cursor: pointer; }
.pay-coin-product:focus-visible, .pay-coin-login:focus-visible, .pay-coin-retry:focus-visible { outline: 2px solid #a58b66; outline-offset: 3px; }
@media (max-width: 380px) { .pay-coins-dialog .pay-box { padding: 24px 15px 18px; } .pay-coin-amount { font-size: 17px; } .pay-coin-price { font-size: 15px; } }
.pay-report-products { display: grid; gap: 10px; }
.pay-report-product { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 14px; border: 1px solid #d8c9b6; border-radius: 12px; background: #fffaf1; color: #55312d; text-align: left; cursor: pointer; }
.pay-report-product.is-selected { border-color: #916043; background: #f5e7d2; box-shadow: 0 0 0 1px #916043; }
.pay-report-name { font-weight: 700; }
.pay-report-amount { white-space: nowrap; }
.pay-report-discount { grid-column: 1 / -1; color: #b34c2f; font-size: 12px; font-weight: 700; }

.pay-phone { display: grid; gap: 6px; color: #55312d; font-size: 13px; font-weight: 700; }
.pay-phone input { padding: 11px 12px; border: 1px solid #d8c9b6; border-radius: 10px; background: #fffaf1; color: #3a2a24; font: inherit; font-size: 16px; font-weight: 400; }
.pay-phone-note { color: #7a6558; font-size: 12px; font-weight: 400; line-height: 1.6; }

/* 팝업이 열려 있는 동안 뒤 본문은 움직이지 않는다. 팝업 안에서만 스크롤한다. */
html:has(dialog.pay-dialog[open]), body:has(dialog.pay-dialog[open]) { overflow: hidden; overscroll-behavior: none; }
/* 키보드가 올라와도 결제 버튼에 닿을 수 있게 팝업 아래에 붙여 둔다. */
.pay-dialog:not(.pay-coins-dialog) .pay-actions { position: sticky; bottom: 0; z-index: 1; display: grid; gap: 8px; padding-top: 8px; background: #f4eadb; box-shadow: 0 -10px 10px -4px #f4eadb; }

/* 결제창에서 받는 것 3줄 */
.pay-includes { display: grid; gap: 7px; margin: 2px 0 0; padding: 12px 14px; list-style: none; border: 1px solid #ecd9cc; border-radius: 12px; background: #fff8f3; }
.pay-includes[hidden] { display: none; }
.pay-includes li { position: relative; padding-left: 18px; color: #4a3a2c; font-size: 13.5px; font-weight: 600; line-height: 1.5; word-break: keep-all; }
.pay-includes li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 1px; background: #b83458; }
.pay-kakao-link { display: block; width: 100%; margin-top: 8px; padding: 10px; border: 0; background: none; color: #6a5245; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.pay-guest-consent[hidden], .pay-kakao-link[hidden] { display: none; }

.pay-guest-hint { margin: -4px 0 8px; padding: 8px 12px; border-radius: 10px; background: #f3efe6; color: #55312d; font-size: 13px; font-weight: 700; text-align: center; }
.pay-guest-hint[hidden] { display: none; }
.pay-consent-all { font-weight: 700; color: #55312d; padding-bottom: 6px; border-bottom: 1px solid #e8dccb; }
.pay-submit.is-incomplete { background: #8a6d62; border-color: #8a6d62; }

.pay-breakdown { display: grid; gap: 4px; margin: 2px 0 8px; padding: 10px 12px; border-radius: 10px; background: #f8f4ec; color: #5a463b; font-size: 13px; }
.pay-breakdown:empty { display: none; }
.pay-breakdown-row { display: flex; justify-content: space-between; gap: 10px; }
.pay-breakdown-row.is-cut span:last-child { color: #3b6ea8; font-weight: 700; }

.pay-price:empty { display: none; }
.pay-breakdown { gap: 6px; padding: 14px 14px 12px; }
.pay-breakdown-row.is-list { align-items: baseline; color: #3a2a24; }
.pay-breakdown-row.is-list span:first-child { font-size: 15px; font-weight: 700; }
.pay-breakdown-row.is-list span:last-child { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.pay-breakdown-row.is-total { margin-top: 6px; padding-top: 10px; border-top: 1px dashed #d8c9b6; align-items: baseline; }
.pay-breakdown-row.is-total span:first-child { font-size: 15px; font-weight: 700; color: #55312d; }
.pay-breakdown-row.is-total span:last-child { font-size: 28px; font-weight: 800; color: #b3345a; }

.pay-report-amount { display: inline-flex; align-items: baseline; gap: 8px; }
.pay-report-was { color: #a8a096; font-size: 13px; font-weight: 500; text-decoration: line-through; text-decoration-thickness: 1px; }
.pay-report-sale { color: inherit; }


/* 간편결제 따로 가기: 카카오페이·네이버페이 단추(결제 단추 아래 한 줄) */
.pay-easy-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-easy { min-height: 46px; border: 0; border-radius: 12px; font: 700 14px/1.4 var(--sans, sans-serif); cursor: pointer; }
.pay-easy-kakao { background: #fee500; color: #191919; }
.pay-easy-naver { background: #03c75a; color: #fff; }
.pay-easy:disabled { opacity: .45; cursor: default; }
.pay-easy:focus-visible { outline: 2px solid #a58b66; outline-offset: 3px; }
.pay-easy-row[hidden] { display: none; }

/* 결제창(나이스페이 층) 위에 두는 탈출 단추 */
.pay-layer-exit { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 100000; transform: translateX(-50%); padding: 10px 18px; border: 0; border-radius: 999px; background: rgba(30, 24, 20, .86); color: #fff; font: 600 14px/1.4 var(--sans, sans-serif); cursor: pointer; }
.pay-layer-exit[hidden] { display: none; }

/* 팝업 좌상단 로고 */
.pay-logo-row { display: flex; align-items: center; gap: 6px; margin: -12px 0 -2px -6px; padding-right: 44px; }
.pay-logo-tag { color: #8a6941; font: 700 12.5px/1.35 var(--sans, Pretendard, system-ui, sans-serif); letter-spacing: -.02em; word-break: keep-all; }
.pay-logo { display: block; flex: none; width: 48px; height: 48px; margin: 0; object-fit: contain; pointer-events: none; user-select: none; }
