/* ================================================================
   Billing Page Styles
================================================================ */

#page-billing .snap-section.billing-snap {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 100vh !important;
    padding-top: 110px !important;
    padding-bottom: 180px !important;
    box-sizing: border-box;
}

/* 비로그인 상태: 헤더/푸터 제외 세로 가운데 정렬 */
#page-billing .billing-snap:has(.billing-login-required) {
    justify-content: center !important;
    padding-top: 80px !important;
    padding-bottom: 100px !important;
}

#page-billing .sub-header {
    text-align: center;
    margin-top: 0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}
#page-billing .sub-header h1 { margin-bottom: 14px; }
.billing-page-title { font-size: 2.4rem !important; }

/* ----------------------------------------------------------------
   Container
---------------------------------------------------------------- */
.billing-container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ----------------------------------------------------------------
   비로그인 상태
---------------------------------------------------------------- */
.billing-login-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 80px 40px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0;
    text-align: center;
}

.billing-lock-icon {
    width: 64px;
    height: 64px;
    color: #888;
}
.billing-lock-icon svg { width: 100%; height: 100%; }

.billing-login-msg {
    font-size: 17px;
    color: #aaa;
    margin: 0;
}

.billing-btn-login {
    padding: 14px 40px;
    background: #ff2c2c;
    color: #fff;
    border: none;
    border-radius: 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.billing-btn-login:hover { background: #e01f1f; }

/* ----------------------------------------------------------------
   Card Wrapper
---------------------------------------------------------------- */
.billing-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
    overflow: hidden;
}

/* ----------------------------------------------------------------
   Section
---------------------------------------------------------------- */
.billing-section {
    padding: 32px 40px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.billing-section:last-child { border-bottom: none; }

.billing-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 20px;
}

/* ----------------------------------------------------------------
   금액 선택
---------------------------------------------------------------- */
.billing-amount-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.billing-amount-option {
    position: relative;
    cursor: pointer;
}
.billing-amount-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

.billing-amount-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 0;
    font-size: 15px;
    font-weight: 600;
    color: #ccc;
    transition: all 0.2s;
    text-align: center;
}
.billing-amount-option:hover .billing-amount-label {
    border-color: rgba(255,44,44,0.5);
    color: #fff;
}
.billing-amount-option input:checked + .billing-amount-label {
    background: rgba(255,44,44,0.12);
    border-color: #ff2c2c;
    color: #ff2c2c;
}

/* 직접 입력 필드 */
.billing-custom-input {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    position: relative;
}
.billing-custom-input.visible { display: flex; }

.billing-custom-input input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 0;
    padding: 13px 50px 13px 16px;
    font-size: 15px;
    color: #fff;
    outline: none;
    transition: border-color 0.2s;
}
.billing-custom-input input:focus { border-color: #ff2c2c; }
.billing-custom-input input::placeholder { color: #555; }
/* 숫자 스피너 제거 */
.billing-custom-input input::-webkit-outer-spin-button,
.billing-custom-input input::-webkit-inner-spin-button { -webkit-appearance: none; }
.billing-custom-input input[type=number] { -moz-appearance: textfield; }

.billing-currency {
    position: absolute;
    right: 16px;
    font-size: 14px;
    color: #666;
    pointer-events: none;
}

/* ----------------------------------------------------------------
   결제 안내
---------------------------------------------------------------- */
.billing-info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.billing-info-row {
    display: flex;
    gap: 20px;
}
.billing-info-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    min-width: 130px;
    flex-shrink: 0;
}
.billing-info-value {
    font-size: 13px;
    color: #aaa;
    line-height: 1.6;
}

/* ----------------------------------------------------------------
   약관 박스
---------------------------------------------------------------- */
.billing-terms-box {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 0;
    padding: 20px;
    font-size: 12px;
    color: #666;
    line-height: 1.8;
    max-height: 160px;
    overflow-y: auto;
}
.billing-terms-box strong { color: #888; }
/* 스크롤바 */
.billing-terms-box::-webkit-scrollbar { width: 4px; }
.billing-terms-box::-webkit-scrollbar-track { background: transparent; }
.billing-terms-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 0; }

/* ----------------------------------------------------------------
   필수 동의
---------------------------------------------------------------- */
.billing-agree-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.billing-agree-all-wrap {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.billing-checkbox--all {
    font-weight: 700;
    color: #fff !important;
}
.billing-checkbox--all .billing-checkmark {
    border-color: rgba(255,255,255,0.4);
}

body.light-mode .billing-agree-all-wrap {
    border-top-color: rgba(0,0,0,0.1);
}
body.light-mode .billing-checkbox--all { color: #111 !important; }

.billing-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    color: #aaa;
    line-height: 1.5;
    user-select: none;
}
.billing-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}
.billing-checkmark {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 0;
    background: rgba(255,255,255,0.03);
    position: relative;
    transition: all 0.2s;
}
.billing-checkbox input:checked ~ .billing-checkmark {
    background: #ff2c2c;
    border-color: #ff2c2c;
}
.billing-checkbox input:checked ~ .billing-checkmark::after {
    content: '';
    position: absolute;
    left: 5px; top: 2px;
    width: 5px; height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* ----------------------------------------------------------------
   액션 버튼
---------------------------------------------------------------- */
.billing-action {
    padding: 32px 40px 36px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.billing-btn-submit {
    width: 100%;
    padding: 16px;
    background: #ff2c2c;
    color: #fff;
    border: none;
    border-radius: 0;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}
.billing-btn-submit:disabled {
    background: rgba(255,255,255,0.08);
    color: #555;
    cursor: not-allowed;
}
.billing-btn-submit:not(:disabled):hover { background: #e01f1f; }

.billing-action-desc {
    text-align: center;
    font-size: 12px;
    color: #555;
    margin: 0;
    min-height: 16px;
}

/* ----------------------------------------------------------------
   Light Mode
---------------------------------------------------------------- */
body.light-mode .billing-card,
body.light-mode .billing-login-required {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
}
body.light-mode .billing-section { border-bottom-color: rgba(0,0,0,0.06); }
body.light-mode .billing-section-title { color: #999; }
body.light-mode .billing-amount-label { background: #f5f5f5; border-color: #ddd; color: #333; }
body.light-mode .billing-amount-option:hover .billing-amount-label { border-color: rgba(255,44,44,0.4); }
body.light-mode .billing-custom-input input { background: #f5f5f5; border-color: #ddd; color: #111; }
body.light-mode .billing-info-label { color: #999; }
body.light-mode .billing-info-value { color: #555; }
body.light-mode .billing-terms-box { background: #f5f5f5; border-color: #e0e0e0; color: #888; }
body.light-mode .billing-terms-box strong { color: #555; }
body.light-mode .billing-checkbox { color: #555; }
body.light-mode .billing-checkmark { border-color: #ccc; background: #fff; }
body.light-mode .billing-login-msg { color: #555; }
body.light-mode .billing-lock-icon { color: #ccc; }
body.light-mode #page-billing .sub-header p { color: #999; }
body.light-mode .billing-btn-submit:disabled { background: #e0e0e0; color: #aaa; }
body.light-mode .billing-action-desc { color: #aaa; }

/* ----------------------------------------------------------------
   Mobile
---------------------------------------------------------------- */
@media (max-width: 768px) {
    #page-billing .snap-section.billing-snap { padding-top: 100px !important; }
    .billing-section { padding: 24px 20px; }
    .billing-action { padding: 24px 20px 28px; }
    .billing-amount-grid { grid-template-columns: repeat(2, 1fr); }
    .billing-info-row { flex-direction: column; gap: 4px; }
    .billing-info-label { min-width: unset; }
}
