body.page-checkout .app-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px;
}

body.page-checkout .checkout-page,
body.page-order-confirmation .app-main,
body.page-order-confirmation .order-confirmation {
    max-width: 1180px;
    margin: 0 auto;
}

.checkout-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.checkout-panel-head h2 {
    margin: 0 0 6px;
}

.checkout-address-limit {
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
}

.checkout-address-card-wrap {
    display: grid;
    gap: 8px;
}

.checkout-address-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.checkout-address-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(8, 40, 74, 0.1);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.checkout-address-map-link {
    display: inline-block;
    margin-top: 4px;
    color: #2563eb;
    font-size: 0.82rem;
    font-weight: 600;
}

.checkout-set-default-btn {
    justify-self: start;
}

.checkout-address-modal {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: grid;
    place-items: center;
    padding: 16px;
}

.checkout-address-modal[hidden] {
    display: none;
}

.checkout-address-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 12, 27, 0.55);
}

.checkout-address-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: 92vh;
    overflow: auto;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 60px rgba(8, 40, 74, 0.26);
}

.checkout-address-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.checkout-address-modal-head h2 {
    margin: 0 0 6px;
}

.checkout-address-modal-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.checkout-address-form {
    padding: 18px 20px 20px;
    display: grid;
    gap: 16px;
}

.checkout-address-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.checkout-address-form-grid .checkout-field:first-child,
.checkout-address-form-grid .checkout-field:nth-child(2),
.checkout-address-form-grid .checkout-field:nth-child(3) {
    grid-column: 1 / -1;
}

.checkout-map-panel {
    display: grid;
    gap: 10px;
}

.checkout-map-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.checkout-map-head span {
    color: var(--muted);
    font-size: 0.84rem;
}

.checkout-address-map {
    width: 100%;
    height: 260px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #eef2f7;
}

.checkout-default-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    color: #334155;
}

.checkout-address-form-error {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.88rem;
}

.checkout-address-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.checkout-page-head,
.order-confirmation-card {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.checkout-page-head h1,
.order-confirmation-card h1 {
    margin: 0 0 8px;
}

.checkout-eyebrow,
.order-confirmation-eyebrow {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.checkout-panel,
.checkout-summary,
.order-confirmation-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 18px;
}

.checkout-panel + .checkout-panel,
.direct-checkout-panel {
    margin-top: 16px;
}

.direct-checkout-panel .checkout-payment-item {
    margin: 0;
}

.direct-checkout-panel[hidden],
#paymentMethodPanel[hidden] {
    display: none !important;
}

.checkout-panel h2,
.checkout-summary h2 {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.checkout-hint,
.checkout-empty,
.order-confirmation-lead {
    color: var(--muted);
    font-size: 0.9rem;
}

.checkout-address-list,
.checkout-payment-list {
    display: grid;
    gap: 10px;
}

.checkout-address-card,
.checkout-payment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
}

.checkout-address-card:has(input:checked),
.checkout-payment-item:has(input:checked) {
    border-color: var(--primary);
    background: #f5f9fc;
}

.checkout-address-body {
    display: grid;
    gap: 4px;
}

.checkout-address-type {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
}

.checkout-field {
    display: grid;
    gap: 6px;
    margin-top: 14px;
}

.checkout-field > span {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
}

.checkout-address-form-grid .checkout-field {
    margin-top: 0;
}

.checkout-field select,
.checkout-field textarea,
.checkout-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.checkout-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    color: var(--text, #0f172a);
    background: #fff;
    min-height: 44px;
}

.checkout-field select:focus,
.checkout-field textarea:focus,
.checkout-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.checkout-input:focus {
    outline: none;
    border-color: var(--primary, #08284a);
    box-shadow: 0 0 0 3px rgba(8, 40, 74, 0.1);
}

.checkout-field textarea {
    min-height: 88px;
    resize: vertical;
}

.checkout-coupon-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.checkout-coupon-row .checkout-input {
    flex: 1;
    min-width: 160px;
}

.checkout-coupon-status {
    margin: 10px 0 0;
    font-size: 0.86rem;
    color: #0f766e;
}

.checkout-coupon-status.is-error {
    color: #b91c1c;
}

.checkout-credit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.checkout-credit-grid div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
}

.checkout-credit-grid span {
    font-size: 0.78rem;
    color: var(--muted);
}

.checkout-lines {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
    max-height: 280px;
    overflow: auto;
}

.checkout-line-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.88rem;
}

.checkout-line-item span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.checkout-summary-row[hidden] {
    display: none !important;
}

.checkout-summary-actions {
    margin-bottom: 12px;
}

.checkout-line-stock {
    color: #0f766e;
}

.checkout-line-stock.is-low {
    color: #b91c1c;
    font-weight: 600;
}

.checkout-summary-total strong {
    color: var(--primary);
    font-size: 1.1rem;
}

.checkout-submit {
    width: 100%;
    margin-top: 14px;
}

.checkout-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
}

.checkout-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 12, 27, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
}

.checkout-popup-backdrop.is-visible {
    display: flex;
}

.checkout-popup {
    width: min(760px, 100%);
    max-height: min(88vh, 900px);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 28px 60px rgba(8, 40, 74, 0.26);
}

.checkout-popup-head,
.checkout-popup-actions {
    padding: 18px 20px;
}

.checkout-popup-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border);
}

.checkout-popup-head h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.checkout-popup-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 52ch;
}

.checkout-popup-status {
    margin-top: 10px !important;
}

.checkout-popup-status.is-error {
    color: #b91c1c;
}

.checkout-popup-close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.checkout-popup-list {
    overflow: auto;
    padding: 16px 20px;
    display: grid;
    gap: 14px;
    align-content: start;
}

.checkout-issue-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    box-shadow: 0 8px 20px rgba(8, 40, 74, 0.05);
}

.checkout-issue-media {
    width: 88px;
    height: 88px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #fff;
    display: grid;
    place-items: center;
}

.checkout-issue-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.checkout-issue-body {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.checkout-issue-title {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.4;
    font-weight: 700;
    color: var(--primary);
}

.checkout-issue-code {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.3;
}

.checkout-issue-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.checkout-issue-stat {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.checkout-issue-stat.is-warning {
    background: #fff7ed;
    border-color: #fed7aa;
}

.checkout-issue-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.checkout-issue-stat-value {
    font-size: 1.1rem;
    line-height: 1;
    color: var(--primary);
}

.checkout-issue-stat.is-warning .checkout-issue-stat-value {
    color: #c2410c;
}

.checkout-issue-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkout-issue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-top: 2px;
}

.checkout-issue-actions .btn {
    min-height: 34px;
    padding: 6px 12px;
}

.checkout-issue-remove {
    color: #b91c1c;
}

.checkout-issue-price {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
}

.checkout-issue-price.is-increase {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.checkout-issue-price.is-decrease {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.checkout-no-issues {
    color: var(--muted);
    font-size: 0.88rem;
}

.checkout-popup-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    border-top: 1px solid var(--border);
}

.checkout-popup-actions .btn {
    width: 100%;
    min-height: 42px;
    white-space: normal;
    text-align: center;
}

.checkout-popup--confirm {
    width: min(440px, 100%);
    max-height: none;
    grid-template-rows: auto auto auto;
}

.checkout-confirm-eyebrow {
    margin: 0 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.checkout-confirm-body {
    padding: 16px 20px 4px;
}

.checkout-confirm-meta {
    display: grid;
    gap: 10px;
}

.checkout-confirm-meta div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafc;
}

.checkout-confirm-meta span {
    font-size: 0.8rem;
    color: var(--muted);
}

.checkout-confirm-meta strong {
    font-size: 0.95rem;
    color: var(--primary);
    text-align: right;
}

body.checkout-confirm-open {
    overflow: hidden;
}

.order-confirmation-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 20px;
}

.order-confirmation-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #dcfce7;
    color: #166534;
    font-size: 1.8rem;
    font-weight: 800;
}

.order-confirmation-meta {
    display: grid;
    gap: 14px;
    width: 100%;
    margin: 20px 0;
    text-align: left;
}

.order-confirmation-meta div {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafbfc;
}

.order-confirmation-meta span {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.order-confirmation-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.support-page {
    max-width: 1100px;
    margin: 0 auto;
}

.support-hero {
    margin-bottom: 20px;
}

.support-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.support-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
}

.support-card h2 {
    margin: 0 0 10px;
}

.support-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

@media (min-width: 900px) {
    body.page-checkout .app-main {
        padding: 24px;
    }
}

@media (max-width: 899px) {
    .checkout-layout,
    .support-grid,
    .checkout-credit-grid {
        grid-template-columns: 1fr;
    }

    .checkout-page-head,
    .checkout-panel-head {
        flex-direction: column;
    }

    .checkout-address-form-grid {
        grid-template-columns: 1fr;
    }

    .checkout-address-modal-actions {
        flex-direction: column;
    }

    .checkout-popup-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .checkout-popup {
        width: 100%;
        max-height: 92vh;
        border-radius: 22px 22px 0 0;
    }

    .checkout-popup-head,
    .checkout-popup-actions,
    .checkout-popup-list {
        padding-left: 16px;
        padding-right: 16px;
    }

    .checkout-issue-card {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .checkout-issue-media {
        width: 72px;
        height: 72px;
    }

    .checkout-issue-title {
        font-size: 0.92rem;
    }

    .checkout-issue-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .checkout-issue-actions .btn {
        width: 100%;
    }

    .checkout-popup-actions {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .checkout-popup-actions .btn {
        min-height: 44px;
    }
}
