/*
 * TEDI_CHECKOUT_FLOW_V3
 * Mobile-first purchase flow presentation.
 * Business/payment/reservation logic is untouched.
 */

.checkout-flow-v3-page {
    --flow-purple: var(--tedi-purple, #8e3a96);
    --flow-purple-soft: #f8f1f9;
    --flow-border: #e7e1e9;
    --flow-muted: #817985;
    --flow-text: #2e2930;
    --flow-success: #18733a;
    min-width: 0;
}


/* ==========================================================
   SHARED STEPPER
   ========================================================== */

.checkout-flow-v3-page
.tedi-checkout-steps {
    width: min(100%, 920px);
    margin: 0 auto 24px;
    padding: 0 4px;
    box-sizing: border-box;
}

.checkout-flow-v3-page
.tedi-checkout-steps ol {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.checkout-flow-v3-page
.tedi-checkout-steps ol::before {
    content: "";
    position: absolute;
    top: 19px;
    right: calc(12.5% + 20px);
    left: calc(12.5% + 20px);
    height: 2px;
    background: #e5dfe7;
}

.checkout-flow-v3-page
.tedi-checkout-step {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 7px;
    min-width: 0;
    text-align: center;
}

.checkout-flow-v3-page
.tedi-checkout-step__number {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 2px solid #ded7e1;
    border-radius: 50%;
    background: #fff;
    color: #918995;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 0 0 5px #fff;
    box-sizing: border-box;
}

.checkout-flow-v3-page
.tedi-checkout-step.is-current
.tedi-checkout-step__number {
    border-color: var(--flow-purple);
    background: var(--flow-purple);
    color: #fff;
    box-shadow:
        0 0 0 5px #fff,
        0 5px 16px rgba(126, 49, 135, .18);
}

.checkout-flow-v3-page
.tedi-checkout-step.is-complete
.tedi-checkout-step__number {
    border-color: #bc91c1;
    background: var(--flow-purple-soft);
    color: var(--flow-purple);
}

.checkout-flow-v3-page
.tedi-checkout-step__copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.checkout-flow-v3-page
.tedi-checkout-step__copy strong {
    color: #756d78;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
}

.checkout-flow-v3-page
.tedi-checkout-step.is-current
.tedi-checkout-step__copy strong {
    color: var(--flow-text);
    font-weight: 800;
}

.checkout-flow-v3-page
.tedi-checkout-step__copy small {
    color: #a29aa5;
    font-size: 10px;
    line-height: 1.5;
}


/* ==========================================================
   CART
   ========================================================== */

.checkout-flow-v3-page.checkout-flow-v3-cart {
    margin-top: 24px;
}

.checkout-flow-v3-cart
.cart-page-header {
    margin-bottom: 20px;
}

.checkout-flow-v3-title p {
    margin: 4px 0 0;
    color: var(--flow-muted);
    font-size: 12px;
    line-height: 1.8;
}

.checkout-flow-v3-cart-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(310px, 355px);
    gap: 22px;
    align-items: start;
    min-width: 0;
}

.checkout-flow-v3-cart
.cart-lines {
    min-width: 0;
}

.checkout-flow-v3-cart
.cart-line {
    min-width: 0;
    border-color: var(--flow-border);
    border-radius: 15px;
    box-shadow: 0 4px 18px rgba(42, 32, 45, .035);
}

.checkout-flow-v3-cart
.cart-line-image {
    border-radius: 12px;
}

.checkout-flow-v3-cart
.cart-summary {
    position: sticky;
    top: 96px;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 19px;
    border: 1px solid var(--flow-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(45, 32, 49, .055);
}

.checkout-flow-v3-cart
.checkout-flow-v3-summary-head {
    display: grid;
    gap: 2px;
    min-height: 0;
    padding: 0 0 13px;
    border-top: 0;
}

.checkout-flow-v3-summary-head strong {
    color: var(--flow-text);
    font-size: 17px;
    font-weight: 700;
}

.checkout-flow-v3-summary-head small {
    color: var(--flow-muted);
    font-size: 11px;
    line-height: 1.7;
}

.checkout-flow-v3-cart
.checkout-button {
    min-height: 52px;
    border-radius: 11px;
    font-weight: 700;
}

.checkout-flow-v3-cart-note {
    margin: 11px 0 0;
    color: var(--flow-muted);
    font-size: 11px;
    line-height: 1.8;
    text-align: center;
}


/* ==========================================================
   SHIPPING
   ========================================================== */

.checkout-flow-v3-page.checkout-flow-v3-shipping {
    margin-top: 24px;
}

.checkout-flow-v3-shipping
.checkout-v2-step {
    display: none;
}

.checkout-flow-v3-shipping
.checkout-v2-section-head {
    gap: 0;
}

.checkout-flow-v3-shipping
.checkout-v2-section,
.checkout-flow-v3-shipping
.checkout-summary-card {
    border-radius: 16px;
}

.checkout-flow-v3-shipping
.checkout-v2-section {
    box-shadow: 0 4px 18px rgba(42, 32, 45, .03);
}

.checkout-flow-v3-shipping
.checkout-summary-card {
    box-shadow: 0 10px 30px rgba(45, 32, 49, .055);
}


/* ==========================================================
   PAYMENT / RESULT
   ========================================================== */

.checkout-flow-v3-page.checkout-flow-v3-payment,
.checkout-flow-v3-page.checkout-flow-v3-result {
    width: min(1040px, calc(100% - 32px));
    max-width: none;
    margin: 24px auto 58px;
}

.checkout-flow-v3-payment
.checkout-main,
.checkout-flow-v3-result
.checkout-main {
    padding: 0;
    border: 0;
    background: transparent;
}

.checkout-flow-v3-payment
.checkout-flow-v3-order-card,
.checkout-flow-v3-result
.checkout-flow-v3-order-card {
    width: min(100%, 820px);
    margin: 0 auto;
    padding: 22px;
    border: 1px solid var(--flow-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(44, 31, 48, .06);
    text-align: right;
    box-sizing: border-box;
}

.checkout-flow-v3-payment
.checkout-flow-v3-order-card > h1,
.checkout-flow-v3-result
.checkout-flow-v3-order-card > h1 {
    margin: 0 0 12px;
    color: var(--flow-text);
    font-size: 24px;
    line-height: 1.6;
}

.checkout-flow-v3-payment
.checkout-flow-v3-order-card > p,
.checkout-flow-v3-result
.checkout-flow-v3-order-card > p {
    margin: 6px 0;
    color: #625b66;
    line-height: 1.8;
}

.checkout-flow-v3-payment
.checkout-flow-v3-payment-card {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--flow-border);
    border-radius: 15px;
    background: #fbfafc;
}

.checkout-flow-v3-payment-head {
    margin-bottom: 14px;
}

.checkout-flow-v3-payment-head span {
    display: block;
    margin-bottom: 3px;
    color: var(--flow-purple);
    font-size: 11px;
    font-weight: 700;
}

.checkout-flow-v3-payment-head h2 {
    margin: 0;
    color: var(--flow-text);
    font-size: 18px;
}

.checkout-flow-v3-payment-head p {
    margin: 5px 0 0;
    color: var(--flow-muted);
    font-size: 12px;
    line-height: 1.8;
}

.checkout-flow-v3-payment
.checkout-flow-v3-provider-options ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.checkout-flow-v3-payment
.checkout-flow-v3-provider-options li {
    margin: 0;
}

.checkout-flow-v3-payment
.checkout-flow-v3-provider-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 11px 13px;
    border: 1px solid #dfd7e2;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
    cursor: pointer;
}

.checkout-flow-v3-payment
.checkout-flow-v3-provider-options label:has(input:checked) {
    border-color: var(--flow-purple);
    background: var(--flow-purple-soft);
    box-shadow: 0 0 0 2px rgba(126, 49, 135, .07);
}

.checkout-flow-v3-payment
.checkout-flow-v3-provider-options input[type="radio"] {
    flex: 0 0 auto;
    margin: 0;
    accent-color: var(--flow-purple);
}

.checkout-flow-v3-payment
.checkout-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 14px;
    border-radius: 11px;
    font-weight: 700;
}

.checkout-flow-v3-payment
.checkout-notice,
.checkout-flow-v3-result
.checkout-notice {
    margin-top: 14px;
    border-radius: 12px;
    line-height: 1.9;
}

.checkout-flow-v3-result
.checkout-flow-v3-order-card > h1 {
    color: var(--flow-success);
}


/* ==========================================================
   TABLET + MOBILE
   ========================================================== */

@media (max-width: 860px) {

    .checkout-flow-v3-cart-grid {
        grid-template-columns: 1fr;
    }

    .checkout-flow-v3-cart
    .cart-summary {
        position: static;
        top: auto;
        width: 100%;
    }

    .checkout-flow-v3-shipping
    .checkout-v2-form {
        grid-template-columns: 1fr;
    }

    .checkout-flow-v3-shipping
    .checkout-summary-card {
        position: static;
        top: auto;
        width: 100%;
    }

    .checkout-flow-v3-shipping
    .checkout-v2-shipping-options ul {
        grid-template-columns: 1fr;
    }

    .checkout-flow-v3-payment
    .checkout-flow-v3-provider-options ul {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 760px) {

    .checkout-flow-v3-page.checkout-flow-v3-cart,
    .checkout-flow-v3-page.checkout-flow-v3-shipping,
    .checkout-flow-v3-page.checkout-flow-v3-payment,
    .checkout-flow-v3-page.checkout-flow-v3-result {
        width: calc(100% - 20px);
        margin-top: 16px;
        margin-right: auto;
        margin-left: auto;
        box-sizing: border-box;
    }

    .checkout-flow-v3-page
    .tedi-checkout-steps {
        margin-bottom: 18px;
        padding: 0;
    }

    .checkout-flow-v3-page
    .tedi-checkout-steps ol::before {
        top: 14px;
        right: calc(12.5% + 15px);
        left: calc(12.5% + 15px);
    }

    .checkout-flow-v3-page
    .tedi-checkout-step {
        gap: 5px;
    }

    .checkout-flow-v3-page
    .tedi-checkout-step__number {
        width: 28px;
        height: 28px;
        border-width: 1px;
        font-size: 11px;
        box-shadow: 0 0 0 4px #fff;
    }

    .checkout-flow-v3-page
    .tedi-checkout-step.is-current
    .tedi-checkout-step__number {
        box-shadow: 0 0 0 4px #fff;
    }

    .checkout-flow-v3-page
    .tedi-checkout-step__copy strong {
        font-size: 10px;
        line-height: 1.45;
    }

    .checkout-flow-v3-page
    .tedi-checkout-step__copy small {
        display: none;
    }

    .checkout-flow-v3-cart
    .cart-page-header {
        gap: 10px;
        margin-bottom: 16px;
    }

    .checkout-flow-v3-title p {
        display: none;
    }

    .checkout-flow-v3-cart
    .cart-line {
        min-width: 0;
        padding: 12px;
    }

    .checkout-flow-v3-cart
    .cart-line-info,
    .checkout-flow-v3-cart
    .cart-line-controls {
        min-width: 0;
    }

    .checkout-flow-v3-cart
    .cart-summary {
        padding: 16px;
    }

    .checkout-flow-v3-shipping
    .checkout-v2-section {
        padding: 15px;
    }

    .checkout-flow-v3-shipping
    .checkout-address-options label {
        min-height: 50px;
        padding: 11px 12px;
    }

    .checkout-flow-v3-shipping
    .checkout-v2-manage-link {
        min-height: 44px;
    }

    .checkout-flow-v3-payment
    .checkout-flow-v3-order-card,
    .checkout-flow-v3-result
    .checkout-flow-v3-order-card {
        padding: 16px;
        border-radius: 14px;
    }

    .checkout-flow-v3-payment
    .checkout-flow-v3-order-card > h1,
    .checkout-flow-v3-result
    .checkout-flow-v3-order-card > h1 {
        font-size: 20px;
    }

    .checkout-flow-v3-payment
    .checkout-flow-v3-payment-card {
        padding: 14px;
    }

    .checkout-flow-v3-payment
    .checkout-flow-v3-provider-options label {
        min-height: 54px;
    }

    .checkout-flow-v3-payment
    .checkout-submit,
    .checkout-flow-v3-cart
    .checkout-button {
        min-height: 54px;
        font-size: 14px;
    }

    .checkout-flow-v3-payment,
    .checkout-flow-v3-result {
        padding-bottom:
            env(
                safe-area-inset-bottom
            );
    }
}


@media (max-width: 480px) {

    .checkout-flow-v3-page
    .tedi-checkout-step__copy strong {
        font-size: 9px;
    }

    .checkout-flow-v3-cart
    .cart-page-header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .checkout-flow-v3-cart
    .cart-continue-link {
        width: 100%;
        min-height: 44px;
        box-sizing: border-box;
    }

    .checkout-flow-v3-cart
    .cart-line {
        grid-template-columns:
            76px
            minmax(0, 1fr);
    }

    .checkout-flow-v3-cart
    .cart-line-image {
        width: 76px;
        height: 94px;
    }

    .checkout-flow-v3-cart
    .cart-line-controls,
    .checkout-flow-v3-cart
    .cart-line-total {
        grid-column: 1 / -1;
    }

    .checkout-flow-v3-shipping
    .checkout-page-head h1 {
        font-size: 21px;
    }

    .checkout-flow-v3-payment-head h2 {
        font-size: 17px;
    }
}

/* TEDI_PAYMENT_PICKER_EXPLICIT_V2 */
.checkout-flow-v3-provider-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.checkout-flow-v3-provider-option > strong {
    min-width: 0;
    flex: 1 1 auto;
}

.checkout-flow-v3-provider-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 76px;
    height: 38px;
    padding: 0 10px;
    margin-inline-start: auto;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.05);
    direction: ltr;
    line-height: 1;
}

.checkout-flow-v3-provider-brand__zp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f4b41a;
    color: #171717;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.checkout-flow-v3-provider-brand__sep {
    color: #087bc1;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.checkout-flow-v3-provider-brand__digipay {
    color: #1f2937;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.checkout-flow-v3-provider-brand__digipay span {
    color: #2563eb;
}

.checkout-flow-v3-provider-brand__snappay {
    color: #00a651;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.checkout-flow-v3-provider-brand__snappay span {
    color: #2563eb;
}

.checkout-flow-v3-provider-brand__card,
.checkout-flow-v3-provider-brand__fallback {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 480px) {
    .checkout-flow-v3-provider-option {
        gap: 9px;
    }

    .checkout-flow-v3-provider-brand {
        min-width: 62px;
        height: 34px;
        padding-inline: 7px;
        border-radius: 10px;
    }

    .checkout-flow-v3-provider-brand__zp {
        width: 27px;
        height: 27px;
        font-size: 11px;
    }

    .checkout-flow-v3-provider-brand__sep {
        font-size: 15px;
    }

    .checkout-flow-v3-provider-brand__digipay,
    .checkout-flow-v3-provider-brand__snappay {
        font-size: 12px;
    }
}

/* TEDI_PAYMENT_PICKER_UX_V4_R3 */

.tedi-payment-option--enhanced {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tedi-payment-option--enhanced
.checkout-flow-v3-provider-brand {
    display: none !important;
}

.tedi-payment-provider-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 72px;
    width: 72px;
    height: 44px;
    padding: 4px;
    margin-inline-start: 8px;
    border: 1px solid #e8e4e8;
    border-radius: 11px;
    background: #ffffff;
    overflow: hidden;
    box-shadow:
        0 2px 8px
        rgba(17, 24, 39, 0.05);
}

.tedi-payment-provider-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tedi-payment-picker-toast {
    position: fixed;
    z-index: 100000;
    left: 12px;
    right: 12px;
    bottom:
        calc(
            92px
            + env(safe-area-inset-bottom)
        );
    padding: 14px 16px;
    border-radius: 16px;
    background: #252127;
    color: #ffffff;
    direction: rtl;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.8;
    box-shadow:
        0 14px 36px
        rgba(0, 0, 0, 0.24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px);
    pointer-events: none;
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        visibility 180ms ease;
}

.tedi-payment-picker-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tedi-payment-picker-attention {
    animation:
        tedi-payment-picker-pulse
        1.3s ease;
    scroll-margin-block: 120px;
}

@keyframes tedi-payment-picker-pulse {
    0% {
        box-shadow:
            0 0 0 0
            rgba(197, 43, 143, 0);
    }

    40% {
        box-shadow:
            0 0 0 8px
            rgba(197, 43, 143, 0.16);
    }

    100% {
        box-shadow:
            0 0 0 0
            rgba(197, 43, 143, 0);
    }
}

@media (min-width: 768px) {
    .tedi-payment-picker-toast {
        left: 24px;
        right: auto;
        bottom: 24px;
        width:
            min(
                390px,
                calc(100vw - 48px)
            );
    }
}

@media (max-width: 480px) {
    .tedi-payment-provider-thumb {
        flex-basis: 64px;
        width: 64px;
        height: 40px;
        margin-inline-start: 5px;
    }

    .tedi-payment-picker-toast {
        font-size: 13px;
        padding: 13px 14px;
        border-radius: 14px;
    }
}

/* ==========================================================
   TEDI_CHECKOUT_ADDRESS_ACTION_V1
   Address management action inside shipping checkout only.
   ========================================================== */

.checkout-flow-v3-shipping
.checkout-v2-section--address
a.checkout-v2-manage-link,
.checkout-flow-v3-shipping
.checkout-v2-section--address
a.checkout-v2-manage-link:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    max-width: 100%;
    width: fit-content;
    margin: 12px 0 0;
    padding: 10px 17px;
    border: 1.5px solid #8e3a96;
    border-radius: 11px;
    background: #faf3fb;
    color: #7d2f86;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    cursor: pointer;
    transition:
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

.checkout-flow-v3-shipping
.checkout-v2-section--address
a.checkout-v2-manage-link:hover {
    background: #f2e4f4;
    border-color: #7d2f86;
    color: #722a7a;
}

.checkout-flow-v3-shipping
.checkout-v2-section--address
a.checkout-v2-manage-link:focus-visible {
    outline: 3px solid rgba(142, 58, 150, .25);
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .checkout-flow-v3-shipping
    .checkout-v2-section--address
    a.checkout-v2-manage-link {
        display: flex;
        width: 100%;
        min-height: 46px;
        font-size: 14px;
        margin-top: 12px;
    }
}
