﻿.checkout-page {
    width: min(100%, 86rem);
    min-height: 100vh;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2.5rem);
}

.checkout-shell {
    position: relative;
    overflow: hidden;
    padding: clamp(1rem, 2.4vw, 2.25rem);
    background: var(--store-white-92);
    border: 1px solid var(--store-white-92);
    border-radius: var(--store-radius-lg);
    box-shadow: var(--store-shadow-md);
    backdrop-filter: blur(12px);
}

    .checkout-shell::before {
        display: block;
        height: 0.38rem;
        margin: calc(clamp(1rem, 2.4vw, 2.25rem) * -1) calc(clamp(1rem, 2.4vw, 2.25rem) * -1) clamp(1.25rem, 2.5vw, 2rem);
        content: "";
        background: linear-gradient( 90deg, var(--store-main-color) 0 78%, var(--store-tan) 78% 100% );
    }

.checkout-header {
    max-width: 47rem;
    margin-bottom: 1.5rem;
}

.checkout-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    margin-bottom: 0.65rem;
    padding: 0.25rem 0.7rem;
    color: var(--store-white);
    background: var(--store-main-color-dark);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.checkout-title {
    margin-bottom: 0.35rem;
    color: var(--store-text-main);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.checkout-subtitle {
    color: var(--store-text-muted);
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    line-height: 1.6;
}

.checkout-progress {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 42rem;
    margin-bottom: 1.75rem;
    padding: 0.85rem 1rem;
    background: var(--store-white);
    border: 1px solid var(--store-border);
    border-radius: 0.95rem;
}

.checkout-progress-step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--store-text-muted);
    font-size: 0.85rem;
    font-weight: 750;
}


.checkout-progress-number {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: var(--store-text-muted);
    background: var(--store-white);
    border: 1px solid var(--store-border);
    border-radius: 50%;
    font-weight: 900;
}

.checkout-progress-step.is-active {
    color: var(--store-text-main);
}

.checkout-progress-step.is-active .checkout-progress-number,
.checkout-progress-step.is-complete .checkout-progress-number {
    color: var(--store-white);
    background: var(--store-main-color);
    border-color: var(--store-main-color);
}

.checkout-layout {
    align-items: flex-start;
    margin: 0 -0.65rem !important;
}

.checkout-main-column,
.checkout-summary-column {
    padding: 0 0.65rem !important;
}

.checkout-stack {
    display: grid;
    gap: 1rem;
}

.checkout-promo-card {
    padding: 1.15rem;
    background: linear-gradient( 135deg, color-mix(in srgb, var(--store-main-color) 5%, transparent), var(--store-white) 95% );
}

.checkout-promo-label {
    margin-bottom: 0.75rem;
    color: var(--store-text-main);
    font-size: 0.9rem;
    font-weight: 850;
    line-height: 1.4;
}

.checkout-promo-grid .mud-input-control {
    margin: 0;
}

.checkout-promo-grid {
    align-items: center;
    margin: -0.35rem !important;
}

.checkout-promo-grid > .mud-grid-item {
    padding: 0.35rem !important;
}

.checkout-section-title {
    color: var(--store-text-main);
    font-size: 1.05rem;
    font-weight: 900;
}

.checkout-count {
    color: var(--store-text-muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.checkout-cart-body {
    padding: 0.35rem 0;
}

.checkout-page .mud-expand-panel {
    background: var(--store-white);
    border-bottom: 1px solid var(--store-border);
    box-shadow: none;
}

.checkout-page .mud-expand-panel:last-child {
    border-bottom: 0;
}

.checkout-page .mud-expand-panel-header {
    min-height: 4.5rem;
    padding: 0.45rem 0.65rem !important;
    background: var(--store-white);
}

.checkout-page .mud-expand-panel-header:hover {
    background: var(--store-grey);
}

.checkout-page .mud-expand-panel-content {
    padding: 0.2rem 1rem 1rem 4rem !important;
    color: var(--store-text-muted);
    background: var(--store-background-off-white);
}

.cart-line-grid {
    align-items: center;
    width: 100%;
    margin: 0 !important;
}

.cart-remove-cell,
.cart-name-cell,
.cart-product-cell,
.cart-price-cell {
    padding: 0.35rem !important;
}

.cart-line-name {
    color: var(--store-text-main);
    font-weight: 800;
    line-height: 1.35;
}

.cart-line-product {
    color: var(--store-text-muted);
    line-height: 1.35;
}

.cart-line-price {
    color: var(--store-main-color-dark);
    font-weight: 900;
    white-space: nowrap;
}

.cart-detail-list {
    display: grid;
    gap: 0.35rem;
}

.cart-detail-row {
    color: var(--store-text-muted);
    line-height: 1.45;
}

.checkout-form-card {
    padding: 0;
}

.checkout-form-header {
    min-width: 0;
}

.address-heading {
    color: var(--store-text-main);
    font-size: 1.15rem;
    font-weight: 900;
    text-decoration: none !important;
}

.address-subtitle {
    margin-top: 0.25rem;
    color: var(--store-text-muted);
    line-height: 1.5;
}

.checkout-form-grid {
    margin: 0 !important;
    padding: 0.55rem 0.9rem 1.15rem;
}

.checkout-form-grid > .mud-grid-item {
    padding: 0.42rem !important;
}

.checkout-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.15rem;
}

.checkout-actions .store-btn {
    min-width: 10.5rem;
}

.checkout-loading-card {
    padding: 2rem;
}

.checkout-page .mud-input-control {
    margin-top: 0.1rem;
}

.checkout-page .mud-input-outlined-border,
.checkout-page .mud-input-filled,
.checkout-page .mud-input-filled-input-control,
.checkout-page .mud-input-filled .mud-input-slot {
    border-color: var(--store-border);
    border-radius: 0.7rem;
}

.checkout-page .mud-input-filled {
    overflow: hidden;
}


.checkout-page .mud-input-control:focus-within .mud-input-outlined-border {
    border-color: var(--store-main-color);
    border-width: 2px;
}

.checkout-page .mud-input-label {
    color: var(--store-text-muted);
    font-weight: 700;
}

.checkout-page .mud-icon-button-root {
    color: var(--store-danger);
    border-radius: 0.65rem;
}

.checkout-page .mud-icon-button-root:hover {
    background: var(--store-danger-soft);
}

.checkout-form-card {
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 0;
    overflow: visible;
}

.checkout-form-header {
    min-width: 0;
}

.address-heading {
    margin: 0;
    color: var(--store-text-main);
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.25;
}

.address-subtitle {
    max-width: 23rem;
    margin: 0;
    color: var(--store-text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
    text-align: right;
}

.checkout-form-grid {
    width: 100%;
    min-width: 0;
    height: auto;
    margin: 0 !important;
    padding: 0.35rem 0.65rem 0.8rem;
    box-sizing: border-box;
}

.checkout-form-grid > .mud-grid-item {
    min-width: 0;
    padding: 0.3rem !important;
    box-sizing: border-box;
}

.checkout-form-grid .mud-input-control,
.checkout-form-grid .mud-input-root,
.checkout-form-grid .mud-input-slot {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 959.98px) {
    .checkout-page {
        padding: 0.75rem;
    }

    .checkout-shell {
        padding: 1rem;
        border-radius: var(--store-radius-md);
    }

        .checkout-shell::before {
            margin: -1rem -1rem 1.25rem;
        }
}

@media (max-width: 599.98px) {
    .checkout-promo-card {
        padding-left: 0.5rem;
        padding-right: 1.25rem;
    }

    .checkout-form-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .address-subtitle {
        max-width: none;
        text-align: left;
    }

    .checkout-form-grid {
        padding: 0.35rem 0.6rem 0.75rem;
    }

    .checkout-page {
        padding: 0;
    }

    .checkout-shell {
        min-height: 100vh;
        padding: 0.85rem;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

        .checkout-shell::before {
            margin: -0.85rem -0.85rem 1rem;
        }

    .checkout-progress {
        padding: 0.7rem;
    }

    .checkout-progress-step {
        gap: 0.45rem;
        font-size: 0.76rem;
    }

        .checkout-progress-step + .checkout-progress-step::before {
            display: none;
        }

    .checkout-section-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .checkout-promo-grid > .mud-grid-item {
        flex-basis: 100%;
        max-width: 100%;
        margin-bottom: 0.55rem;
    }

        .checkout-promo-grid > .mud-grid-item:last-child {
            margin-bottom: 0;
        }

    /* Keep the expansion chevron isolated from the cart controls. */
    .checkout-page .mud-expand-panel-header {
        min-height: 0rem;
    }

    .checkout-page .mud-expand-panel-header > .mud-icon-root {
        position: absolute;
        right: 0.74rem;
        top: 30%;
        transform: translateY(-50%);
    }

    .cart-line-grid {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        row-gap: 0.3rem;
        width: 100%;
    }

    .cart-name-cell {
        order: 1;
        flex-basis: 62%;
        max-width: 40%;
    }

    .cart-price-cell {
        order: 1;
        padding-right: 0.76rem;
        flex-basis: 3%;
        max-width: 4%;
    }

    /* Put delete on the left side of its own row, away from the chevron. */
    .cart-remove-cell {
        order: 1;
        display: flex;
        flex: 0 0 3.25rem;
        align-items: center;
        justify-content: flex-start;
        max-width: 3.25rem;
        padding: 0.15rem 0.35rem 0.15rem 0 !important;
    }

    .cart-product-cell {
        order: 4;
        flex: 1 1 calc(100% - 3.5rem);
        max-width: calc(100% - 3.5rem);
        padding: 0.35rem 0.5rem !important;
    }

    .cart-remove-cell .mud-icon-button-root {
        width: 2.75rem;
        min-width: 2.75rem;
        height: 2.75rem;
        padding: 0.55rem;
        background: var(--store-danger-soft);
        border: 1px solid color-mix(in srgb, var(--store-danger) 24%, transparent);
    }

    .cart-remove-cell .mud-icon-button-root:focus-visible {
        outline: 3px solid color-mix(in srgb, var(--store-danger) 35%, transparent);
        outline-offset: 2px;
    }

    .checkout-page .mud-expand-panel-content {
        padding: 0.75rem 1rem 1rem !important;
    }

    .checkout-actions {
        flex-direction: column-reverse;
    }

        .checkout-actions .store-btn {
            width: 100%;
        }
}

@media (prefers-reduced-motion: reduce) {
    .checkout-page .mud-expand-panel-header {
        transition: none !important;
    }
}
