/* InteriorX Auto BD V2.1
   Cross-device stability, centered flash countdown and optional OTP/guest checkout. */

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

main,
.checkout-page-shell,
.checkout-layout,
.checkout-form,
.checkout-summary {
    min-width: 0;
}

/* Category rail: centered on desktop, swipeable on mobile. */
@media (min-width: 801px) {
    .round-categories .scroll-row {
        width: 100%;
        justify-content: center;
        align-items: flex-start;
        flex-wrap: wrap;
        overflow: visible;
        gap: 22px 26px;
    }

    .round-categories .scroll-row > a {
        flex: 0 0 94px;
    }
}

/* Flash deal header: title left, countdown centered, action always right. */
.flash-deal-head {
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    grid-template-areas: "deal-title deal-timer deal-action";
    width: 100%;
}

.flash-deal-heading {
    grid-area: deal-title;
    justify-self: start;
    min-width: 0;
}

.flash-countdown {
    grid-area: deal-timer;
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 290px;
}

.flash-countdown > div {
    min-width: 84px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    padding: 9px 13px;
    border-radius: 999px;
}

.flash-countdown b {
    display: inline;
    font-size: 24px;
    font-weight: 700;
}

.flash-countdown small {
    display: inline;
    margin-top: 0;
    font-size: 11px;
    font-weight: 700;
}

.flash-see-all {
    grid-area: deal-action;
    justify-self: end;
    align-self: center;
    white-space: nowrap;
}

/* Checkout view must always remain inside the normal site layout. */
.checkout-page-shell {
    width: 100%;
    padding: 28px 0 46px;
    background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
}

.checkout-page-shell .checkout-steps {
    margin-bottom: 22px;
}

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

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

.checkout-form > section,
.checkout-summary {
    border: 1px solid #e4e7ec;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .045);
}

.checkout-form > section {
    padding: 24px;
}

.checkout-form > section h2,
.checkout-summary h2 {
    margin-top: 0;
}

.checkout-summary {
    top: 18px;
    padding: 22px;
}

.checkout-guest-note {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
}

/* Checkout identity / phone verification modal. */
.checkout-identity-shell {
    position: fixed;
    inset: 0;
    z-index: 360;
    display: grid;
    place-items: center;
    padding: 24px;
}

.checkout-identity-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 18, 28, .68);
    backdrop-filter: blur(3px);
}

.checkout-identity-card {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: min(790px, calc(100dvh - 48px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 34px 38px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 34px 90px rgba(0, 0, 0, .30);
    text-align: center;
}

.checkout-identity-brand {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.checkout-identity-brand img {
    max-width: 210px;
    max-height: 66px;
    object-fit: contain;
}

.checkout-identity-brand b {
    font: 900 30px/1 Arial, sans-serif;
    font-style: italic;
    letter-spacing: -1px;
}

.checkout-identity-brand b span {
    color: #e30613;
}

.checkout-identity-brand small {
    margin-left: 10px;
    font: 700 9px/1 Arial, sans-serif;
    letter-spacing: 3px;
}

.checkout-identity-kicker {
    color: #e30613;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.checkout-identity-card h2 {
    margin: 8px 0;
    color: #111827;
    font-size: clamp(25px, 3vw, 32px);
    line-height: 1.25;
}

.checkout-identity-card > p {
    max-width: 470px;
    margin: 0 auto 22px;
    color: #606a78;
    font-size: 14px;
}

.checkout-identity-form {
    display: grid;
    gap: 14px;
    text-align: left;
}

.checkout-identity-form label {
    display: grid;
    gap: 7px;
    color: #263040;
    font-size: 13px;
    font-weight: 750;
}

.checkout-phone-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
    border: 1px solid #cfd5df;
    border-radius: 11px;
    background: #fbfcfd;
}

.checkout-phone-field:focus-within {
    border-color: #e30613;
    box-shadow: 0 0 0 4px rgba(227, 6, 19, .09);
    background: #fff;
}

.checkout-phone-field > span {
    padding: 0 14px;
    border-right: 1px solid #e0e4ea;
    color: #4b5563;
    font-weight: 700;
}

.checkout-phone-field input,
.checkout-identity-form > label > input {
    width: 100%;
    min-height: 52px;
    padding: 12px 15px;
    border: 1px solid #cfd5df;
    border-radius: 11px;
    background: #fbfcfd;
    outline: 0;
}

.checkout-phone-field input {
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
}

.checkout-identity-form input[name="otp"] {
    text-align: center;
    font: 800 26px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .42em;
    padding-left: calc(15px + .42em);
}

.checkout-identity-form .btn {
    width: 100%;
    min-height: 52px;
}

.checkout-identity-form .btn:disabled {
    color: #6b7280;
    background: #e7e9ee;
    border-color: #d8dce3;
}

.checkout-identity-phone {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 11px 13px;
    border: 1px solid #dfe4ea;
    border-radius: 11px;
    background: #f8fafc;
    text-align: left;
}

.checkout-identity-phone span {
    color: #777;
    font-size: 11px;
}

.checkout-identity-phone b {
    font-size: 15px;
}

.checkout-identity-phone form,
.checkout-identity-resend {
    margin: 0;
}

.checkout-identity-phone button,
.checkout-identity-resend button {
    border: 0;
    background: transparent;
    color: #e30613;
    font-weight: 800;
}

.checkout-identity-resend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 15px;
}

.checkout-identity-resend small {
    color: #777;
}

.checkout-identity-divider {
    position: relative;
    margin: 20px 0;
    color: #8b93a1;
    font-size: 12px;
}

.checkout-identity-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid #e2e6ec;
}

.checkout-identity-divider span {
    position: relative;
    padding: 0 12px;
    background: #fff;
}

.checkout-guest-button {
    width: 100%;
    min-height: 50px;
    border-color: #d4d8df;
    background: #fff;
    color: #202733;
}

.checkout-guest-button:hover {
    border-color: #e30613;
    color: #e30613;
}

.checkout-identity-security {
    margin-top: 16px;
    padding: 9px 10px;
    border-radius: 9px;
    background: #eefaf3;
    color: #087b3a;
    font-size: 11px;
}

.checkout-identity-back {
    display: inline-block;
    margin-top: 15px;
    color: #5b6471;
    font-size: 12px;
    font-weight: 700;
}

body.checkout-identity-open {
    overflow: hidden;
}

body.checkout-identity-open .contact-widget {
    z-index: 80;
}

@media (max-width: 1050px) and (min-width: 801px) {
    .flash-deal-head {
        grid-template-columns: minmax(180px, 1fr) auto minmax(150px, 1fr);
        gap: 14px;
    }

    .flash-countdown {
        min-width: 250px;
        gap: 6px;
    }

    .flash-countdown > div {
        min-width: 72px;
        padding-inline: 10px;
    }

    .flash-countdown b {
        font-size: 20px;
    }

    .checkout-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

@media (max-width: 800px) {
    .round-categories .scroll-row {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .flash-deal-head {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "deal-title deal-action"
            "deal-timer deal-timer";
        gap: 11px 10px;
    }

    .flash-countdown {
        min-width: 0;
        width: 100%;
        justify-self: stretch;
        justify-content: flex-start;
        overflow-x: auto;
        padding-top: 1px;
    }

    .flash-countdown > div {
        min-width: 76px;
        padding: 8px 11px;
    }

    .flash-countdown b {
        font-size: 19px;
    }

    .flash-see-all {
        align-self: start;
    }

    .checkout-page-shell {
        padding: 18px 0 calc(88px + env(safe-area-inset-bottom));
    }

    .checkout-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 15px;
    }

    .checkout-form > section,
    .checkout-summary {
        padding: 17px;
        border-radius: 14px;
    }

    .checkout-summary {
        position: static;
    }

    .checkout-identity-shell {
        padding: 10px;
        align-items: center;
    }

    .checkout-identity-card {
        width: min(520px, 100%);
        max-height: calc(100dvh - 20px - env(safe-area-inset-bottom));
        padding: 25px 18px calc(22px + env(safe-area-inset-bottom));
        border-radius: 19px;
    }

    .checkout-identity-card h2 {
        font-size: 25px;
    }
}

@media (max-width: 430px) {
    .flash-deal-head {
        padding: 11px;
    }

    .flash-deal-heading h2 {
        font-size: 21px;
    }

    .flash-see-all {
        padding: 7px 9px;
        font-size: 10px;
    }

    .flash-countdown {
        gap: 5px;
    }

    .flash-countdown > div {
        min-width: 67px;
        padding: 7px 8px;
    }

    .flash-countdown b {
        font-size: 17px;
    }

    .flash-countdown small {
        font-size: 9px;
    }

    .checkout-identity-card {
        padding-inline: 14px;
    }

    .checkout-identity-phone {
        grid-template-columns: 1fr auto;
    }

    .checkout-identity-phone span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .checkout-identity-card,
    .checkout-identity-backdrop {
        scroll-behavior: auto;
    }
}
