.checkout-page {
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, .08), transparent 28%),
        linear-gradient(180deg, #f6f9fe 0%, #eef3fb 100%);
}

.checkout-dashboard {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    padding: 24px 0 42px;
}

.checkout-hero {
    margin-bottom: 18px;
}

.checkout-kicker {
    color: var(--primary);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.checkout-hero h1 {
    margin: 8px 0 6px;
    color: var(--text);
    font-size: clamp(2.2rem, 3.5vw, 3rem);
    line-height: 1.02;
}

.checkout-hero p {
    max-width: 560px;
    color: #63758e;
    font-size: .96rem;
    line-height: 1.45;
}

.checkout-timeline {
    position: sticky;
    top: 96px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 0 0 18px;
    padding: 18px 26px 14px;
    border: 1px solid rgba(214, 227, 244, .95);
    border-radius: 24px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 16px 40px rgba(19, 44, 82, .08);
    backdrop-filter: blur(14px);
}

.timeline-track {
    position: absolute;
    left: calc(12.5% + 48px);
    right: calc(12.5% + 48px);
    top: 40px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #d8e2ee, #e4ecf6);
}

.timeline-progress {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0d6efd, #0a5ad4);
    transition: width .3s ease;
}

.timeline-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 0;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: #7a8da5;
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.timeline-step.is-locked {
    cursor: not-allowed;
    opacity: .64;
}

.timeline-dot {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    border: 2px solid #cfe0f2;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffffff, #f7faff);
    color: #5f7796;
    font-size: .9rem;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(29, 55, 93, .08);
    transition: border-color .2s, background .2s, color .2s, box-shadow .2s, transform .2s;
}

.timeline-check {
    display: none;
    font-size: 18px;
}

.timeline-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.timeline-copy strong {
    overflow: hidden;
    color: #17314e;
    font-size: .92rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-copy small {
    overflow: hidden;
    color: #8297b0;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-step.is-current .timeline-dot {
    border-color: #0d6efd;
    color: #0d6efd;
    box-shadow: 0 0 0 7px rgba(13, 110, 253, .12);
    transform: translateY(-1px);
}

.timeline-step.is-current .timeline-copy strong {
    color: #0d6efd;
}

.timeline-step.is-complete .timeline-dot {
    border-color: #0d6efd;
    background: #0d6efd;
    color: #fff;
    box-shadow: 0 10px 22px rgba(13, 110, 253, .22);
}

.timeline-step.is-complete .timeline-number {
    display: none;
}

.timeline-step.is-complete .timeline-check {
    display: block;
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 18px;
    align-items: start;
}

.checkout-layout.is-review-step {
    grid-template-columns: 1fr;
    margin-top: 10px;
}

.checkout-main,
.checkout-sidebar {
    display: grid;
    gap: 14px;
}

.checkout-sidebar {
    position: sticky;
    top: 214px;
}

.checkout-sidebar.is-hidden-for-review {
    display: none;
}

.checkout-card {
    padding: 22px;
    border: 1px solid #d9e6f4;
    border-radius: 24px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 18px 38px rgba(22, 43, 74, .06);
}

.checkout-side-card {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 14px 26px rgba(29, 48, 79, .04);
}

.checkout-step-card {
    position: relative;
    display: none;
    min-height: 316px;
    scroll-margin-top: 110px;
    transition: border-color .2s, box-shadow .2s, transform .2s, opacity .2s;
}

.checkout-step-card.is-active {
    display: block;
}

.checkout-step-card.is-current {
    border-color: #b9d4ff;
    box-shadow: 0 24px 52px rgba(13, 110, 253, .09);
}

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

.review-panel {
    padding: 16px 18px;
    border: 1px solid #e1eaf5;
    border-radius: 20px;
    background: linear-gradient(180deg, #fbfdff, #f5f9ff);
}

.review-panel--full {
    grid-column: 1 / -1;
}

.review-kicker {
    display: block;
    margin-bottom: 8px;
    color: #748aa7;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.review-panel strong {
    display: block;
    color: #17314e;
    font-size: .98rem;
    line-height: 1.25;
}

.review-panel p {
    margin-top: 5px;
    color: #61748f;
    font-size: .84rem;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.review-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.review-item-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid #e4edf8;
}

.review-item-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.review-item-row strong {
    font-size: .88rem;
}

.review-item-row strong small {
    color: #7a8ea8;
    font-size: .76rem;
    font-weight: 500;
}

.review-item-row p {
    margin-top: 4px;
    font-size: .76rem;
}

.review-item-row > span {
    color: #0d6efd;
    font-size: .86rem;
    font-weight: 800;
    white-space: nowrap;
}

.review-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #dbe7f4;
}

.review-delivery-fee {
    display: none;
}

.checkout-dashboard.is-delivery-selected .review-delivery-fee:not([hidden]) {
    display: flex;
}

.review-total span {
    color: #56708f;
    font-size: .84rem;
    font-weight: 700;
}

.review-total strong {
    color: #0d6efd;
    font-size: 1rem;
    font-weight: 800;
}

.checkout-card-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 16px;
    color: #1c2e44;
    font-size: 1.18rem;
    font-weight: 800;
}

.checkout-card-title .material-icons {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #0d6efd;
    background: linear-gradient(180deg, #eef5ff, #e6effd);
    border-radius: 14px;
    font-size: 20px;
    flex-shrink: 0;
}

.checkout-step-alert {
    margin: -4px 0 12px;
    padding: 10px 12px;
    border-radius: 14px;
    color: #b7373f;
    background: #fff2f3;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.35;
}

.checkout-step-alert[hidden] {
    display: none;
}

.checkout-card.has-step-error {
    border-color: #ed9da5;
    box-shadow: 0 18px 32px rgba(196, 63, 71, .09);
}

.checkout-quick-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 11px;
    border-radius: 999px;
    background: #fff4dc;
    color: #946200;
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.checkout-inline-note {
    margin: -4px 0 18px;
    color: #63758e;
    font-size: .85rem;
    line-height: 1.45;
}

.delivery-method,
.payment-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.payment-options {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.payment-options[inert] {
    pointer-events: none;
}

.payment-cash-change {
    margin-top: 16px;
    padding: 18px;
    border: 1.5px solid #cfe0fb;
    border-radius: 20px;
    background: linear-gradient(180deg, #f7fbff, #ecf4ff);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.cash-change-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cash-change-head strong {
    display: block;
    color: #1557c0;
    font-size: .96rem;
    line-height: 1.2;
}

.cash-change-head p {
    margin: 6px 0 0;
    color: #5a78a4;
    font-size: .8rem;
    line-height: 1.45;
}

.cash-change-choice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cash-change-chip {
    min-height: 40px;
    padding: 0 16px;
    border: 1.5px solid #cfe0fb;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff, #f3f8ff);
    color: #3f6595;
    font-size: .84rem;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .18s, background .18s, color .18s, box-shadow .18s, transform .18s;
}

.cash-change-chip:hover {
    border-color: #7fb0f8;
    color: #1659c7;
    transform: translateY(-1px);
}

.cash-change-chip.is-active {
    border-color: #0d6efd;
    background: linear-gradient(180deg, #2f80f8, #0d6efd);
    color: #fff;
    box-shadow: 0 12px 20px rgba(13, 110, 253, .18);
}

.payment-cash-change .cash-change-field,
.payment-cash-change .cash-change-field[hidden] {
    display: none !important;
    margin-top: 16px;
}

.payment-cash-change .cash-change-field.is-visible:not([hidden]) {
    display: flex !important;
}

.method-option,
.payment-option {
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1.5px solid #dfe8f3;
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    transition: border-color .18s, background .18s, box-shadow .18s, transform .18s;
}

.payment-option {
    align-items: center;
    padding-right: 52px;
}

.method-option {
    min-height: 192px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    gap: 18px;
    padding: 22px;
}

.method-option:hover,
.payment-option:hover {
    border-color: #a9c8f5;
    background: linear-gradient(180deg, #ffffff, #f6faff);
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(27, 57, 101, .08);
}

.method-option input[type="radio"],
.payment-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.method-option:has(input:checked),
.payment-option:has(input:checked) {
    border-color: #0d6efd;
    background: linear-gradient(180deg, #f2f7ff, #e9f1ff);
    box-shadow: 0 20px 34px rgba(13, 110, 253, .16);
    transform: translateY(-3px);
}

.method-icon,
.payment-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #7a8da5;
    background: #eef4fb;
    border-radius: 14px;
    font-size: 21px;
    flex-shrink: 0;
    transition: color .18s, background .18s;
}

.method-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    font-size: 30px;
}

.method-option:has(input:checked) .method-icon,
.payment-option:has(input:checked) .payment-icon {
    color: #0d6efd;
    background: #dceaff;
}

.method-info {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 6px;
}

.method-info strong {
    display: block;
    color: #1c2e44;
    font-size: 1.14rem;
    line-height: 1.15;
}

.method-info small {
    color: #778ba4;
    font-size: .86rem;
    line-height: 1.35;
    max-width: 18ch;
}

.payment-copy {
    flex: 1;
    min-width: 0;
    color: #1c2e44;
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
    max-width: 11ch;
}

.method-check {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef4fb;
    border: 2px solid #d0dded;
    transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}

.payment-option .method-check {
    top: 50%;
    transform: translateY(-50%);
}

.method-check::after {
    content: "";
    width: 8px;
    height: 4px;
    border-left: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(-45deg) translateY(-1px);
    transition: border-color .18s;
}

.method-option:has(input:checked) .method-check,
.payment-option:has(input:checked) .method-check {
    background: #0d6efd;
    border-color: #0d6efd;
    box-shadow: 0 10px 18px rgba(13, 110, 253, .18);
    transform: scale(1.04);
}

.payment-option:has(input:checked) .method-check {
    transform: translateY(-50%) scale(1.04);
}

.method-option:has(input:checked) .method-check::after,
.payment-option:has(input:checked) .method-check::after {
    border-left-color: #fff;
    border-bottom-color: #fff;
}

.checkout-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group--full {
    grid-column: 1 / -1;
}

.form-group label {
    color: #566f90;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.form-helper {
    color: #7b8da6;
    font-size: .72rem;
    line-height: 1.4;
}

.form-helper.is-required {
    color: #0d6efd;
    font-weight: 800;
}

.form-helper.is-required.is-error {
    color: #c43f47;
}

.input-wrap {
    height: 50px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 14px;
    border: 1.5px solid #dbe6f2;
    border-radius: 16px;
    background: #f8fbff;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.input-wrap:focus-within {
    border-color: #0d6efd;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .1);
}

.input-wrap .material-icons {
    color: #9eb3cc;
    font-size: 18px;
    flex-shrink: 0;
}

.input-wrap input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #1c2e44;
    font: inherit;
    font-size: .94rem;
}

.input-wrap input::placeholder,
.textarea-wrap textarea::placeholder {
    color: #afc1d5;
}

.alert {
    display: block;
    margin-top: 4px;
    color: #c43f47;
    font-size: .72rem;
    font-weight: 700;
}

.input-wrap.has-error {
    border-color: #e8a0a4;
    background: #fff8f8;
}

.checkout-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 14px;
    color: #1c2e44;
    font-size: .92rem;
}

.checkout-subtitle .material-icons {
    color: #0d6efd;
    font-size: 20px;
}

.delivery-fields {
    display: none;
}

.delivery-fields.is-visible {
    display: block;
    padding-top: 6px;
}

.checkout-card--pickup {
    display: none;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px 18px;
    border: 1px solid #d9e8fb;
    border-radius: 18px;
    background: linear-gradient(180deg, #f7fbff, #f2f8ff);
}

.checkout-card--pickup.is-visible {
    display: flex;
}

.pickup-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    color: #0d6efd;
    background: #e5f0ff;
    border-radius: 16px;
    font-size: 24px;
    flex-shrink: 0;
}

.checkout-card--pickup strong {
    display: block;
    color: #1c2e44;
    font-size: .95rem;
    margin-bottom: 4px;
}

.checkout-card--pickup p {
    color: #63758e;
    font-size: .82rem;
    line-height: 1.45;
}

.checkout-order-summary {
    max-height: 42vh;
    overflow: auto;
}

.summary-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.summary-item-row {
    padding: 10px 12px;
    border: 1px solid #e6eef8;
    border-radius: 16px;
    background: #f8fbff;
}

.summary-item-info {
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.summary-item-qty {
    color: #0d6efd;
    font-size: .78rem;
    font-weight: 800;
    flex-shrink: 0;
}

.summary-item-name {
    color: #1c2e44;
    font-size: .84rem;
    font-weight: 700;
}

.summary-item-name small {
    color: #778ba4;
    font-weight: 400;
    font-size: .75rem;
}

.summary-item-obs {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 6px 0 0;
    color: #566f90;
    font-size: .75rem;
    font-style: italic;
}

.summary-item-obs .material-icons {
    font-size: 13px;
    color: #0d6efd;
    flex-shrink: 0;
}

.summary-item-price {
    margin-top: 8px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.summary-item-price small {
    color: #7a8ea8;
    font-size: .74rem;
}

.summary-item-price strong {
    color: #17314e;
    font-size: .86rem;
    font-weight: 800;
}

.summary-total {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e6eef8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.summary-delivery-fee {
    display: none;
}

.checkout-dashboard.is-delivery-selected .summary-delivery-fee:not([hidden]) {
    display: flex;
}

.summary-total span {
    color: #5f7796;
    font-size: .84rem;
    font-weight: 700;
}

.summary-total strong {
    color: #0d6efd;
    font-size: 1rem;
    font-weight: 800;
}

.obs-label {
    display: block;
    color: #566f90;
    font-size: .78rem;
    margin-bottom: 8px;
}

.obs-label small {
    color: #9aaec5;
    font-weight: 400;
    margin-left: 4px;
}

.textarea-wrap {
    border: 1.5px solid #dbe6f2;
    border-radius: 16px;
    background: #f8fbff;
    transition: border-color .18s, box-shadow .18s, background .18s;
    overflow: hidden;
}

.textarea-wrap:focus-within {
    border-color: #0d6efd;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .1);
}

.textarea-wrap textarea {
    width: 100%;
    min-height: 72px;
    padding: 14px;
    border: 0;
    outline: none;
    background: transparent;
    color: #1c2e44;
    font: inherit;
    font-size: .88rem;
    resize: vertical;
}

.obs-count {
    display: block;
    text-align: right;
    margin-top: 5px;
    color: #9aaec5;
    font-size: .72rem;
}

.checkout-actions {
    width: 100%;
    display: flex;
    gap: 10px;
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding-top: 6px;
}

.checkout-actions [hidden] {
    display: none !important;
}

.btn-voltar,
.btn-finalizar {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 24px;
    border: 0;
    border-radius: 18px;
    font: inherit;
    font-size: .96rem;
    font-weight: 800;
    cursor: pointer;
    transition: opacity .2s, box-shadow .2s, transform .15s, background .2s;
}

.btn-voltar {
    flex: 0 0 162px;
    border: 1.5px solid #d9e5f2;
    background: rgba(255, 255, 255, .96);
    color: #45627f;
}

.btn-finalizar {
    flex: 1;
    background: linear-gradient(115deg, #075fe4, #1484ff);
    color: #fff;
    box-shadow: 0 14px 26px rgba(13, 110, 253, .24);
}

.btn-voltar:hover,
.btn-finalizar:hover {
    opacity: .94;
}

.btn-finalizar:hover {
    box-shadow: 0 18px 34px rgba(13, 110, 253, .28);
}

.btn-voltar:hover {
    background: #f8fbff;
}

.btn-voltar:active,
.btn-finalizar:active {
    transform: scale(.99);
}

.btn-finalizar:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.btn-finalizar.is-guiding {
    color: #fff;
    background: linear-gradient(115deg, #0b63ea, #1484ff);
    box-shadow: 0 14px 26px rgba(13, 110, 253, .2);
    opacity: .88;
}

.btn-finalizar .material-icons {
    font-size: 20px;
}

@media (max-width: 900px) {
    .checkout-dashboard {
        width: calc(100% - 28px);
        padding-top: 18px;
    }

    .checkout-timeline {
        top: 88px;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-sidebar {
        position: static;
        order: 2;
    }

    .checkout-main {
        order: 1;
    }
}

@media (max-width: 680px) {
    .checkout-timeline {
        padding: 16px 12px 12px;
        border-radius: 20px;
    }

    .timeline-track {
        left: calc(12.5% + 20px);
        right: calc(12.5% + 20px);
        top: 35px;
    }

    .timeline-step {
        gap: 6px;
    }

    .timeline-dot {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .timeline-copy strong {
        font-size: .76rem;
    }

    .timeline-copy small {
        font-size: .66rem;
        white-space: normal;
        line-height: 1.25;
    }

    .delivery-method,
    .payment-options,
    .checkout-form,
    .review-grid {
        grid-template-columns: 1fr;
    }

    .method-option {
        min-height: 168px;
        padding: 20px 18px;
    }

    .checkout-actions {
        flex-direction: column-reverse;
    }

    .btn-voltar {
        flex-basis: auto;
    }

    .checkout-card,
    .checkout-side-card {
        border-radius: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .timeline-progress,
    .timeline-dot,
    .method-option,
    .payment-option,
    .input-wrap,
    .textarea-wrap,
    .btn-finalizar,
    .btn-voltar,
    .checkout-step-card {
        transition: none !important;
    }
}
