:root {
    --rp-green: #96c11f;
    --rp-green-dark: #779a00;
    --rp-ink: #21252a;
    --rp-muted: #6c7280;
    --rp-line: #e4e6e8;
    --rp-soft: #f8f8f8;
}

body.local-checkout {
    color: var(--rp-ink);
    background: #feffff;
    padding: 0;
}

.checkout-header {
    background: #feffff;
    border-bottom: 1px solid var(--rp-line);
}

.checkout-header-main {
    min-height: 86px;
}

.checkout-logo img {
    width: 174px;
    height: auto;
}

.checkout-header-link {
    color: var(--rp-ink);
    text-decoration: none;
    white-space: nowrap;
}

.checkout-header-link:hover {
    color: var(--rp-green-dark);
}

.checkout-cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    margin-left: 6px;
    padding: 0 7px;
    border-radius: 999px;
    color: #feffff;
    background: var(--rp-green);
    font-weight: 700;
}

.checkout-subbar {
    background: linear-gradient(90deg, #a8d128, #96c11f);
}

.checkout-subbar a {
    color: #182000;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 18px;
}

.checkout-subbar a:hover {
    background: rgba(255, 255, 255, .22);
}

.checkout-main {
    padding-top: 36px;
    padding-bottom: 72px;
}

.checkout-title {
    text-align: center;
    margin-bottom: 8px;
    font-weight: 500;
}

.checkout-lead {
    max-width: 720px;
    margin: 0 auto 28px;
    color: var(--rp-muted);
    text-align: center;
}

.checkout-progress {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: 720px;
    margin: 0 auto 42px;
}

.checkout-progress::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 16.66%;
    right: 16.66%;
    height: 3px;
    background: #dee4e7;
}

.checkout-step {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--rp-muted);
}

.checkout-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0 auto 8px;
    border: 3px solid #dee4e7;
    border-radius: 50%;
    background: #feffff;
    font-weight: 700;
}

.checkout-step.done .checkout-step-number,
.checkout-step.active .checkout-step-number {
    border-color: var(--rp-green);
    color: #feffff;
    background: var(--rp-green);
}

.checkout-step.active {
    color: var(--rp-ink);
    font-weight: 600;
}

.checkout-card {
    overflow: hidden;
    border: 1px solid var(--rp-line);
    border-radius: 14px;
    background: #feffff;
    box-shadow: 0 10px 30px rgba(31, 41, 55, .05);
}

.checkout-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--rp-line);
    background: var(--rp-soft);
}

.checkout-card-header h2,
.checkout-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.checkout-card-body {
    padding: 24px;
}

.checkout-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px;
}

.checkout-field-wide {
    grid-column: 1 / -1;
}

.checkout-field label,
.checkout-choice-label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.checkout-field .form-control,
.checkout-field .form-select {
    min-height: 46px;
    border-color: #ced5d9;
}

.checkout-field .form-control:focus,
.checkout-field .form-select:focus {
    border-color: var(--rp-green);
    box-shadow: 0 0 0 .2rem rgba(149, 193, 31, .18);
}

.checkout-choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
}

.checkout-choice-row .form-check-input:checked {
    border-color: var(--rp-green-dark);
    background-color: var(--rp-green);
}

.checkout-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 26px;
}

.btn-rp-primary {
    min-height: 48px;
    padding: 11px 26px;
    border: 1px solid var(--rp-green-dark);
    border-radius: 6px;
    color: #feffff;
    background: linear-gradient(180deg, #a3ce25, #87ad09);
    font-weight: 700;
}

.btn-rp-primary:hover,
.btn-rp-primary:focus {
    color: #feffff;
    background: linear-gradient(180deg, #93bb18, #749500);
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr);
    gap: 28px;
    align-items: start;
}

.checkout-stack {
    display: grid;
    gap: 24px;
}

.checkout-summary {
    position: sticky;
    top: 20px;
}

.checkout-product-row,
.checkout-summary-line {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid var(--rp-line);
}

.checkout-cart-layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, .7fr);
}

.checkout-cart-count {
    color: var(--rp-muted);
    font-size: .9rem;
    white-space: nowrap;
}

.checkout-cart-items {
    padding-top: 4px;
    padding-bottom: 4px;
}

.checkout-cart-row {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--rp-line);
}

.checkout-cart-row:last-child {
    border-bottom: 0;
}

.checkout-cart-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 116px;
    height: 96px;
    overflow: hidden;
    border: 1px solid var(--rp-line);
    border-radius: 10px;
    background: var(--rp-soft);
}

.checkout-cart-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.checkout-cart-product {
    min-width: 0;
}

.checkout-cart-product h3 {
    margin: 0 0 7px;
    font-size: 1.08rem;
    font-weight: 600;
}

.checkout-cart-product a {
    color: var(--rp-ink);
    text-decoration: none;
}

.checkout-cart-product a:hover {
    color: var(--rp-green-dark);
}

.checkout-cart-meta {
    margin: 0;
    color: var(--rp-muted);
    font-size: .9rem;
    line-height: 1.55;
}

.checkout-cart-price {
    min-width: 110px;
    text-align: right;
    white-space: nowrap;
    font-size: 1.05rem;
    font-weight: 700;
}

.checkout-cart-empty {
    padding: 54px 20px;
    color: var(--rp-muted);
    text-align: center;
}

.checkout-cart-empty strong {
    display: block;
    margin-bottom: 8px;
    color: var(--rp-ink);
    font-size: 1.15rem;
}

.checkout-primary-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
}

.checkout-primary-link:hover,
.checkout-primary-link:focus {
    text-decoration: none;
}

.checkout-local-note {
    color: var(--rp-muted);
    font-size: .8rem;
    line-height: 1.5;
    text-align: center;
}

.checkout-cart-actions {
    margin-top: 24px;
}

.checkout-back-link {
    color: var(--rp-ink);
    text-decoration: none;
    font-weight: 600;
}

.checkout-back-link:hover {
    color: var(--rp-green-dark);
}

.checkout-product-row small {
    display: block;
    margin-top: 3px;
    color: var(--rp-muted);
}

.checkout-summary-total {
    padding-top: 18px;
    font-size: 1.25rem;
    font-weight: 700;
}

.payment-method {
    display: flex;
    gap: 13px;
    padding: 18px;
    border: 2px solid var(--rp-green);
    border-radius: 10px;
    background: rgba(149, 193, 31, .06);
}

.payment-method input {
    margin-top: 5px;
    accent-color: var(--rp-green-dark);
}

.payment-note {
    padding: 18px;
    border-left: 4px solid var(--rp-green);
    background: var(--rp-soft);
}

.bank-test-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fef1c7;
    color: #755500;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.bank-details {
    margin-bottom: 0;
    padding: 0;
    border: 1px solid var(--rp-line);
    border-radius: 8px;
    background: #feffff;
    overflow: hidden;
}

.bank-detail-row {
    display: grid;
    grid-template-columns: minmax(120px, .35fr) minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-height: 54px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rp-line);
}

.bank-detail-row:last-child {
    border-bottom: 0;
}

.bank-detail-row dt,
.bank-detail-row dd {
    margin: 0;
}

.bank-detail-row dt {
    color: var(--rp-muted);
    font-weight: 500;
}

.bank-detail-row dd {
    color: var(--rp-ink);
    font-weight: 600;
}

.bank-detail-emphasis {
    background: #f5f8f5;
}

.bank-help-text {
    color: var(--rp-muted);
    font-size: .86rem;
}

.bank-code {
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    letter-spacing: 0.04em;
}

.checkout-address {
    line-height: 1.7;
}

.checkout-success {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
}

.checkout-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    color: #577300;
    background: #eaf7c9;
    font-size: 34px;
    font-weight: 700;
}

.checkout-order-number {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    background: var(--rp-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700;
}

.receipt-upload {
    padding: 24px;
    border: 1px solid var(--rp-line);
    border-radius: 12px;
    background: var(--rp-soft);
    text-align: center;
}

.receipt-upload h2 {
    margin: 0 0 8px;
    font-size: 1.55rem;
    font-weight: 500;
}

.receipt-upload > p {
    max-width: 590px;
    margin: 0 auto 18px;
    color: var(--rp-muted);
}

.receipt-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 176px;
    padding: 24px;
    border: 2px dashed #c8cdd1;
    border-radius: 10px;
    background: #feffff;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.receipt-dropzone:hover,
.receipt-dropzone:focus-within,
.receipt-dropzone.is-dragover {
    border-color: var(--rp-green-dark);
    background: rgba(149, 193, 31, .07);
}

.receipt-dropzone.is-dragover {
    transform: translateY(-2px);
}

.receipt-dropzone.is-uploading {
    cursor: wait;
    opacity: .72;
}

.receipt-upload-icon {
    margin-bottom: 9px;
    color: var(--rp-green-dark);
    font-size: 42px;
    line-height: 1;
}

.receipt-dropzone strong {
    color: var(--rp-ink);
    overflow-wrap: anywhere;
}

.receipt-dropzone > span:last-child {
    margin-top: 6px;
    color: var(--rp-muted);
    font-size: .84rem;
}

.receipt-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.receipt-submit {
    margin-top: 18px;
}

.receipt-submit:disabled {
    border-color: #afb5b9;
    background: #c9cdd0;
    cursor: not-allowed;
    opacity: 1;
}

.receipt-status {
    min-height: 24px;
    margin: 12px 0 0;
    font-weight: 600;
}

.receipt-status.is-ready,
.receipt-status.is-pending {
    color: #576500;
}

.receipt-status.is-success {
    color: #256b36;
}

.receipt-status.is-error {
    color: #a62828;
}

.receipt-upload form.is-success .receipt-dropzone {
    border-style: solid;
    border-color: #69a778;
    background: #f2faf3;
}

.receipt-upload form.is-success .receipt-submit {
    display: none;
}

.confirmation-email {
    color: var(--rp-muted);
    font-size: .9rem;
}

.checkout-footer {
    padding: 32px 0;
    border-top: 1px solid var(--rp-line);
    color: var(--rp-muted);
    background: var(--rp-soft);
}

.checkout-footer a {
    color: var(--rp-ink);
    text-decoration: none;
}

@media (max-width: 991.98px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    .checkout-summary {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .checkout-header-main {
        min-height: 70px;
    }
    .checkout-logo img {
        width: 145px;
    }
    .checkout-subbar {
        display: none;
    }
    .checkout-main {
        padding-top: 24px;
    }
    .checkout-form-grid {
        grid-template-columns: 1fr;
    }
    .checkout-field-wide {
        grid-column: auto;
    }
    .checkout-card-body,
    .checkout-card-header {
        padding-left: 18px;
        padding-right: 18px;
    }
    .checkout-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }
    .checkout-actions .btn,
    .checkout-actions .btn-rp-primary {
        width: 100%;
    }
    .checkout-step-label {
        font-size: .82rem;
    }
    .checkout-cart-row {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 15px;
    }
    .checkout-cart-image-wrap {
        width: 82px;
        height: 74px;
    }
    .checkout-cart-price {
        grid-column: 2;
        min-width: 0;
        margin-top: -8px;
        text-align: left;
    }
    .bank-detail-row {
        grid-template-columns: minmax(94px, .42fr) minmax(0, 1fr);
        gap: 10px;
        padding-right: 12px;
        padding-left: 12px;
    }
    .receipt-upload {
        padding: 18px;
    }
    .receipt-dropzone {
        min-height: 154px;
        padding: 18px 12px;
    }
}
