.product-step-dialog {
    width: min(100% - 1rem, 660px);
    max-width: 660px;
}

.product-step-modal {
    height: min(780px, calc(100dvh - 1rem));
    max-height: calc(100dvh - 1rem);
    overflow: hidden;
    border: 1px solid var(--brand-border);
    border-radius: 27px;
    background: var(--brand-cream);
    box-shadow: 0 30px 90px rgba(65, 0, 12, .24);
}

.product-step-content {
    display: grid;
    min-height: 0;
    height: 100%;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

.product-step-hero {
    display: grid;
    min-height: 142px;
    grid-template-columns: 128px minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    padding: 1rem 4.75rem 1rem 1.25rem;
    border-bottom: 1px solid var(--brand-border);
    background: white;
}

.product-step-hero img {
    width: 128px;
    height: 110px;
    object-fit: contain;
}

.product-step-hero-copy {
    min-width: 0;
}

.product-step-hero h2 {
    margin: 0;
    color: var(--brand-red);
    font-size: 1.35rem;
    font-weight: 950;
    line-height: 1.2;
}

.product-step-hero p {
    display: -webkit-box;
    margin: .35rem 0;
    overflow: hidden;
    color: var(--brand-muted);
    font-size: .76rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-step-hero strong {
    color: var(--brand-red);
    font-size: 1rem;
    font-weight: 950;
}

.product-step-progress-wrap {
    padding: .85rem 1.15rem .75rem;
    border-bottom: 1px solid #ead8c6;
    background: #fffaf2;
}

.product-step-progress-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .55rem;
}

.product-step-progress-copy span {
    color: var(--brand-red);
    font-size: .66rem;
    font-weight: 950;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.product-step-progress-copy strong {
    overflow: hidden;
    color: var(--brand-ink);
    font-size: .82rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-step-progress {
    height: 7px;
    border-radius: 999px;
    background: #f1dfc7;
}

.product-step-progress .progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-red), #d21635);
    transition: width .25s ease;
}

.product-step-body {
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
    overscroll-behavior: contain;
    scrollbar-color: var(--brand-red) transparent;
}

.product-step-panel {
    animation: product-step-enter .2s ease both;
}

@keyframes product-step-enter {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.product-step-panel .option-block {
    margin-bottom: 0;
}

.product-step-panel .option-row.is-selected {
    border-color: var(--brand-red);
    background: #fff4df;
    box-shadow: 0 0 0 2px rgba(153, 4, 30, .07);
}

.product-step-panel .option-row input:focus-visible {
    outline: 3px solid rgba(255, 194, 87, .7);
    outline-offset: 3px;
}

.product-step-review {
    display: grid;
    gap: .85rem;
}

.product-step-review-heading h3 {
    margin: 0;
    color: var(--brand-red);
    font-size: 1.2rem;
    font-weight: 950;
}

.product-step-review-heading p {
    margin: .25rem 0 0;
    color: var(--brand-muted);
    font-size: .76rem;
}

.product-step-review-list {
    overflow: hidden;
    border: 1px solid var(--brand-border);
    border-radius: 18px;
    background: white;
}

.product-step-review-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: .8rem;
    padding: .75rem .9rem;
    border-bottom: 1px solid #f0e1d3;
}

.product-step-review-row:last-child {
    border-bottom: 0;
}

.product-step-review-row > span {
    color: var(--brand-muted);
    font-size: .7rem;
    font-weight: 850;
}

.product-step-review-row > strong {
    color: var(--brand-ink);
    font-size: .76rem;
    font-weight: 900;
    line-height: 1.45;
}

.product-step-quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem;
    border: 1px solid var(--brand-border);
    border-radius: 18px;
    background: #fffaf2;
}

.product-step-quantity-copy strong,
.product-step-quantity-copy small {
    display: block;
}

.product-step-quantity-copy strong {
    color: var(--brand-ink);
    font-size: .9rem;
    font-weight: 950;
}

.product-step-quantity-copy small {
    margin-top: .15rem;
    color: var(--brand-muted);
    font-size: .68rem;
}

.product-step-footer {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom));
    border-top: 1px solid #e5a93e;
    background: var(--brand-yellow);
    box-shadow: 0 -12px 34px rgba(50, 24, 16, .13);
}

.product-step-footer .btn {
    display: inline-flex;
    min-height: 49px;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border-radius: 999px;
    /* font-size: .8rem; */
    font-weight: 950;
}

.product-step-back {
    flex: 0 0 116px;
    border: 1px solid rgba(153, 4, 30, .28);
    color: var(--brand-red);
    background: rgba(255, 255, 255, .7);
}

.product-step-back:hover,
.product-step-back:focus-visible {
    border-color: var(--brand-red);
    color: var(--brand-red);
    background: white;
}

.product-step-back:disabled {
    border-color: transparent;
    color: #9e8577;
    background: rgba(255, 255, 255, .35);
    opacity: .65;
}

.product-step-next,
.product-step-add {
    flex: 1;
    color: white;
    background: var(--brand-red);
    box-shadow: 0 5px 0 var(--brand-red-dark);
}

.product-step-next:hover,
.product-step-next:focus-visible,
.product-step-add:hover,
.product-step-add:focus-visible {
    color: white;
    background: #7f0318;
}

.product-step-next:disabled,
.product-step-add:disabled {
    color: white;
    background: #9d737a;
    box-shadow: none;
}

.product-step-body .step-validation-error {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(153, 4, 30, .09);
}

.product-step-validation {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin: 0 1rem .85rem;
    padding: .75rem .85rem;
    border: 1px solid rgba(153, 4, 30, .24);
    border-left: 4px solid var(--brand-red);
    border-radius: 14px;
    background: linear-gradient(135deg, #fff3d9, #fffaf0);
    color: var(--brand-ink);
    box-shadow: 0 7px 18px rgba(91, 0, 16, .08);
    animation: product-step-validation-in .22s ease both;
}

.product-step-validation-icon {
    display: inline-flex;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-yellow);
    color: var(--brand-red);
    font-size: 1rem;
    box-shadow: inset 0 0 0 1px rgba(153, 4, 30, .12);
}

.product-step-validation-copy {
    min-width: 0;
    padding-top: .05rem;
}

.product-step-validation-copy strong {
    display: block;
    margin-bottom: .12rem;
    color: var(--brand-red);
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.product-step-validation-copy p {
    margin: 0;
    color: #5f4034;
    font-size: .78rem;
    font-weight: 750;
    line-height: 1.4;
}

@keyframes product-step-validation-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 575.98px) {
    .product-step-dialog {
        width: calc(100% - .5rem);
        margin: .25rem auto;
    }

    .product-step-modal {
        height: calc(100dvh - .5rem);
        max-height: calc(100dvh - .5rem);
        border-radius: 22px;
    }

    .product-step-hero {
        min-height: 120px;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: .7rem;
        padding: .8rem 3.8rem .8rem .85rem;
    }

    .product-step-hero img {
        width: 92px;
        height: 88px;
    }

    .product-step-hero h2 {
        font-size: 1rem;
    }

    .product-step-hero p {
        font-size: .76rem;
        -webkit-line-clamp: 2;
    }

    .product-step-progress-wrap {
        padding: .7rem .85rem .65rem;
    }

    .product-step-progress-copy strong {
        max-width: 62%;
        font-size: .85rem;
    }

    .product-step-body {
        padding: .75rem;
    }

    .product-step-validation {
        gap: .6rem;
        margin: 0 .75rem .7rem;
        padding: .65rem .7rem;
        border-radius: 12px;
    }

    .product-step-validation-icon {
        flex-basis: 30px;
        width: 30px;
        height: 30px;
    }

    .product-step-validation-copy p {
        font-size: .72rem;
    }

    .product-step-panel .option-block {
        padding: .85rem;
        border-radius: 17px;
    }

    .product-step-panel .option-row {
        padding: .7rem;
    }

    .product-step-review-row {
        grid-template-columns: 95px minmax(0, 1fr);
    }

    .product-step-footer {
        padding-right: .75rem;
        padding-left: .75rem;
    }

    .product-step-back {
        flex-basis: 98px;
    }
}
