.checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
}

.checkout-main {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.checkout-items-table {
    table-layout: fixed;
    min-width: 560px;
}

.checkout-product-col {
    width: 58%;
}

.checkout-qty-col {
    width: 112px;
}

.checkout-total-col {
    width: 180px;
}

.checkout-items-table thead th {
    text-align: center;
}

.checkout-items-table th,
.checkout-items-table td {
    vertical-align: middle;
}

.checkout-items-table tbody td:first-child,
.checkout-items-table tbody td:last-child {
    text-align: center;
}

.checkout-items-table tbody td:first-child {
    overflow-wrap: anywhere;
}

.checkout-items-table tbody td:nth-child(2) {
    text-align: center;
}

.checkout-summary {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.checkout-customer-panel {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.checkout-customer-panel h2 {
    margin: 0;
    font-size: 22px;
}

.checkout-customer-form label {
    display: grid;
    gap: 6px;
    color: var(--color-ink);
    font-weight: 700;
}

.checkout-customer-form input,
.checkout-customer-form select,
.checkout-customer-form textarea {
    font-weight: 600;
}

.checkout-customer-form input:not([type="checkbox"]),
.checkout-customer-form select {
    box-sizing: border-box;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    font-size: 16px;
    line-height: 1.2;
}

.checkout-customer-form input:not([type="checkbox"]) {
    padding: 8px 12px;
}

.checkout-customer-form select {
    appearance: none;
    padding: 8px 42px 8px 12px;
    background-color: #ffffff;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--color-ink) 50%),
        linear-gradient(135deg, var(--color-ink) 50%, transparent 50%);
    background-position:
        calc(100% - 22px) calc(50% - 3px),
        calc(100% - 15px) calc(50% - 3px);
    background-size: 7px 7px, 7px 7px;
    background-repeat: no-repeat;
}

.checkout-customer-form select:disabled,
.checkout-customer-form input:read-only {
    background-color: #f8fafc;
    color: var(--color-muted);
}

.checkout-customer-form [aria-invalid="true"] {
    border-color: var(--color-red);
    box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.12);
}

.checkout-address-picker {
    margin-top: 2px;
}

.checkout-document-grid {
    align-items: end;
}

.checkout-tax-request {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.checkout-tax-toggle {
    min-height: 40px;
    padding: 8px 14px;
}

.tax-invoice-panel {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px dashed var(--color-line);
    border-radius: var(--radius);
    background: #f8fafc;
}

.tax-invoice-panel[hidden] {
    display: none;
}

.tax-invoice-panel h3 {
    margin: 0;
    font-size: 18px;
}

.checkout-customer-form .checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
}

.checkout-customer-form .checkbox-row input {
    flex: 0 0 auto;
    width: 18px;
    min-height: 18px;
    margin: 0;
}

.checkout-summary form,
.stack-form {
    display: grid;
    gap: 14px;
}

.shipping-options {
    display: grid;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.shipping-options > span {
    color: var(--color-muted);
    font-weight: 700;
}

.shipping-options-dropdown label {
    display: grid;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.shipping-options-dropdown select {
    min-height: 64px;
    overflow: hidden;
    padding: 12px 48px 12px 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shipping-options-dropdown label > span {
    color: var(--color-muted);
    font-weight: 700;
}

.shipping-selected-note {
    display: grid;
    gap: 6px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: rgba(13, 116, 216, 0.05);
}

.shipping-selected-note strong {
    line-height: 1.3;
}

.shipping-selected-note span {
    color: var(--color-muted);
    font-size: 13px;
}

.shipping-option {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: #ffffff;
}

.shipping-option.is-selected {
    border-color: var(--color-blue);
    background: rgba(13, 116, 216, 0.06);
}

.shipping-option input {
    width: 18px;
    min-height: 18px;
    margin: 3px 0 0;
}

.shipping-option span {
    display: grid;
    gap: 4px;
}

.shipping-option small,
.shipping-option em {
    color: var(--color-muted);
    font-size: 13px;
    font-style: normal;
}

.shipping-option > span:last-child {
    justify-items: end;
    text-align: right;
}

.checkout-coupon-field {
    display: grid;
    gap: 6px;
}

.checkout-coupon-field > span {
    color: var(--color-muted);
    font-weight: 700;
}

.checkout-coupon-field small {
    color: var(--color-muted);
    font-size: 12px;
}

.checkout-summary dl {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.checkout-summary dl div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.checkout-summary .total {
    padding-top: 12px;
    border-top: 1px solid var(--color-line);
    font-size: 20px;
}

.checkout-combo-note {
    display: block;
    margin-top: 4px;
    color: var(--color-accent);
    font-weight: 800;
}

.checkout-combo-application {
    color: var(--color-muted);
    font-size: 0.92em;
}

.checkout-action-footer {
    display: grid;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
}

.checkout-summary [data-checkout-message] {
    margin: 0;
    color: var(--color-muted);
}

.checkout-actions {
    display: grid;
    gap: 12px;
}

.checkout-actions button {
    position: relative;
    overflow: hidden;
}

.checkout-actions button.is-loading,
.checkout-actions button.is-downloading {
    pointer-events: none;
}

.checkout-actions button.is-loading::after,
.checkout-actions button.is-downloading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.38) 45%, transparent 80%);
    transform: translateX(-100%);
    animation: checkout-button-sweep 900ms linear infinite;
}

.checkout-actions .checkout-download-quotation {
    border-color: var(--color-green);
    background: linear-gradient(135deg, var(--color-green), #5cbf78);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(44, 140, 85, 0.22);
}

.checkout-actions .checkout-download-quotation:hover {
    box-shadow: 0 14px 30px rgba(44, 140, 85, 0.28);
}

@keyframes checkout-button-sweep {
    to {
        transform: translateX(100%);
    }
}

.checkout-payment-note {
    margin: 10px 0 0;
    color: var(--color-muted);
    font-size: 13px;
}

.checkout-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.checkout-auth-modal[hidden],
.checkout-auth-form[hidden] {
    display: none;
}

.checkout-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(8, 25, 41, 0.58);
}

.checkout-auth-panel {
    position: relative;
    display: grid;
    gap: 14px;
    width: min(560px, 100%);
    max-height: min(92vh, 760px);
    overflow: auto;
    padding: 24px;
    border: 1px solid rgba(13, 116, 216, 0.18);
    border-radius: 8px;
    background: #ffffff;
    color: var(--color-ink);
    box-shadow: 0 26px 60px rgba(8, 25, 41, 0.28);
}

.checkout-auth-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    min-height: 34px;
    padding: 0;
    border: 0;
    background: rgba(13, 116, 216, 0.08);
    color: var(--color-ink);
    box-shadow: none;
    font-size: 20px;
}

.checkout-auth-panel > span {
    color: var(--color-cyan);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.checkout-auth-panel h2,
.checkout-auth-panel p {
    margin: 0;
}

.checkout-auth-panel h2 {
    padding-right: 34px;
    font-size: 24px;
}

.checkout-auth-panel p {
    color: var(--color-muted);
    font-size: 14px;
}

.checkout-auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 4px;
    border-radius: var(--radius);
    background: var(--color-soft);
}

.checkout-auth-tabs button {
    min-height: 40px;
    border-color: transparent;
    background: transparent;
    color: var(--color-muted);
    box-shadow: none;
}

.checkout-auth-tabs button.is-active {
    border-color: var(--color-blue);
    background: #ffffff;
    color: var(--color-blue);
}

.checkout-auth-form {
    display: grid;
    gap: 12px;
}

.checkout-auth-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.checkout-auth-form .checkbox-row {
    display: flex;
    align-items: flex-start;
}

.checkout-auth-form .checkbox-row input {
    flex: 0 0 auto;
}

.checkout-auth-message {
    min-height: 22px;
}

.checkout-auth-message.success {
    color: var(--color-green);
}

.checkout-auth-social {
    display: grid;
    gap: 10px;
    padding-top: 2px;
}

.checkout-auth-social > span {
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.checkout-auth-social .social-login-list {
    margin-top: 0;
}

.auth-panel {
    max-width: 560px;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.auth-links a,
.auth-register-footer a {
    color: var(--color-cyan);
    font-weight: 600;
}

.auth-links-login {
    justify-content: flex-end;
}

.auth-register-footer {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.social-login-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.social-login-list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    background: var(--provider-color, #fff);
    color: #fff;
    font-weight: 700;
    text-align: center;
}

.social-login-list a[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

.social-login-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.18);
}

.social-login-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.social-login-google .social-login-icon img {
    width: 24px;
    height: 24px;
}

.social-login-facebook .social-login-icon img {
    width: 25px;
    height: 25px;
}

.social-login-line .social-login-icon img {
    width: 28px;
    height: 28px;
}

.social-login-microsoft .social-login-icon img {
    width: 24px;
    height: 24px;
}

.social-login-google {
    --provider-color: #ea4436;
}

.social-login-facebook {
    --provider-color: #1877f2;
}

.social-login-line {
    --provider-color: #2ccf54;
}

.social-login-microsoft {
    --provider-color: #2f2f2f;
}

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