/* Mazda homepage hero background video. */
.mazda-video-hero,
.mazda-site .mz-home-hero,
.mazda-site .mz-hero-home,
.listing-site--mazda-replacement-engines .mazda-home-hero__stage {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: #071421;
}

.mazda-video-hero .mz-hero-video,
.mazda-site .mz-home-hero .mz-hero-video,
.mazda-site .mz-hero-home .mz-hero-video,
.listing-site--mazda-replacement-engines .mazda-home-hero__stage .mz-hero-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
    pointer-events: none;
}

.mazda-video-hero .mz-hero-video-overlay,
.mazda-site .mz-home-hero .mz-hero-video-overlay,
.mazda-site .mz-hero-home .mz-hero-video-overlay,
.listing-site--mazda-replacement-engines .mazda-home-hero__stage .mz-hero-video-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(3,15,29,.64) 0%, rgba(3,15,29,.42) 45%, rgba(3,15,29,.16) 100%),
        linear-gradient(180deg, rgba(3,15,29,.05) 0%, rgba(3,15,29,.03) 58%, rgba(3,15,29,.30) 100%);
    pointer-events: none;
}

.mazda-video-hero > :not(.mz-hero-video):not(.mz-hero-video-overlay):not(link),
.mazda-site .mz-home-hero > :not(.mz-hero-video):not(.mz-hero-video-overlay):not(link),
.mazda-site .mz-hero-home > :not(.mz-hero-video):not(.mz-hero-video-overlay):not(link) {
    position: relative;
    z-index: 2;
}

.mazda-video-hero .eyebrow,
.mazda-video-hero h1,
.mazda-video-hero .hero-copy,
.mazda-site .mz-home-hero .eyebrow,
.mazda-site .mz-home-hero h1,
.mazda-site .mz-home-hero .mz-hero-copy,
.mazda-site .mz-home-hero .mz-hero-copy p,
.mazda-site .mz-hero-home .mz-eyebrow,
.mazda-site .mz-hero-home h1,
.mazda-site .mz-hero-home .mz-hero-copy,
.mazda-site .mz-hero-home .mz-hero-copy p {
    color: #fff;
}

@media (max-width: 767px) {
    .mazda-video-hero .mz-hero-video,
    .mazda-site .mz-home-hero .mz-hero-video,
    .mazda-site .mz-hero-home .mz-hero-video,
    .listing-site--mazda-replacement-engines .mazda-home-hero__stage .mz-hero-video {
        object-position: 58% center;
    }

    .mazda-video-hero .mz-hero-video-overlay,
    .mazda-site .mz-home-hero .mz-hero-video-overlay,
    .mazda-site .mz-hero-home .mz-hero-video-overlay,
    .listing-site--mazda-replacement-engines .mazda-home-hero__stage .mz-hero-video-overlay {
        background: rgba(3, 15, 29, .58);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mazda-video-hero .mz-hero-video,
    .mazda-site .mz-home-hero .mz-hero-video,
    .mazda-site .mz-hero-home .mz-hero-video,
    .listing-site--mazda-replacement-engines .mazda-home-hero__stage .mz-hero-video {
        display: none;
    }

    .mazda-video-hero,
    .mazda-site .mz-home-hero,
    .mazda-site .mz-hero-home,
    .listing-site--mazda-replacement-engines .mazda-home-hero__stage {
        background: #071421 url('../images/mazda-hero-video-poster.webp') center/cover no-repeat;
    }
}

/* Mazda homepage: restore original split hero layout.
   Registration finder sits beside the H1/content; manual finder remains the bar below. */
.listing-site--mazda-replacement-engines .mazda-home-hero__inner--split {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(350px, .72fr);
    gap: 54px;
    align-items: center;
    min-height: 520px;
    padding-top: 34px;
    padding-bottom: 92px;
    text-align: left;
}

.listing-site--mazda-replacement-engines .mazda-home-hero__content {
    min-width: 0;
    max-width: 760px;
}

.listing-site--mazda-replacement-engines .mazda-home-hero__inner--split h1 {
    max-width: 760px;
    color: #5aa7ff;
    font-size: clamp(44px, 4.5vw, 70px);
    line-height: 1.01;
    text-shadow: 0 3px 18px rgba(0, 0, 0, .34);
}

.listing-site--mazda-replacement-engines .mazda-home-hero__inner--split .mazda-home-hero__intro {
    max-width: 700px;
}

.listing-site--mazda-replacement-engines .mazda-hero-vrm-card {
    width: 100%;
    max-width: 405px;
    justify-self: end;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, .52);
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 24px 58px rgba(4, 22, 40, .28);
    backdrop-filter: blur(14px);
    color: var(--mz-ink);
}

.listing-site--mazda-replacement-engines .mazda-hero-vrm-card .mazda-finder-heading {
    margin-bottom: 16px;
}

.listing-site--mazda-replacement-engines .mazda-hero-vrm-card .mazda-finder-heading h2 {
    margin: 4px 0 6px;
    color: var(--mz-navy);
    font-size: 23px;
    line-height: 1.15;
    letter-spacing: -.035em;
}

.listing-site--mazda-replacement-engines .mazda-hero-vrm-card .mazda-finder-heading p {
    margin: 0;
    color: #647286;
    font-size: 11px;
    line-height: 1.55;
}

.listing-site--mazda-replacement-engines .mazda-hero-vrm-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.listing-site--mazda-replacement-engines .mazda-hero-vrm-card .mazda-registration-plate {
    min-height: 58px;
}

.listing-site--mazda-replacement-engines .mazda-hero-vrm-card .mazda-registration-plate input {
    font-size: 27px !important;
}

.listing-site--mazda-replacement-engines .mazda-hero-vrm-card .mazda-finder-button {
    width: 100%;
    min-height: 52px;
    font-size: 12px;
}

.listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar {
    margin-top: -42px;
    margin-bottom: 24px;
}

.listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar .mazda-engine-finder__main {
    display: block;
    padding: 18px 24px 16px;
}

.listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar .mazda-engine-finder__manual {
    padding: 0;
}

.listing-site--mazda-replacement-engines .mazda-finder-heading--manual {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 12px;
}

.listing-site--mazda-replacement-engines .mazda-finder-heading--manual h2 {
    margin: 3px 0 0;
    font-size: 18px;
}

.listing-site--mazda-replacement-engines .mazda-finder-heading--manual p {
    margin: 0 0 2px;
    color: #6c7a8b;
    font-size: 10px;
}

.listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar .mazda-manual-controls {
    grid-template-columns: 1.15fr .88fr .95fr .95fr 170px;
    gap: 10px;
}

.listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar .mazda-manual-status {
    margin-top: 5px;
    min-height: 10px;
}

@media (max-width: 1050px) {
    .listing-site--mazda-replacement-engines .mazda-home-hero__inner--split {
        grid-template-columns: minmax(0, 1fr) 350px;
        gap: 34px;
    }

    .listing-site--mazda-replacement-engines .mazda-home-hero__inner--split h1 {
        font-size: clamp(42px, 5vw, 62px);
    }

    .listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar .mazda-manual-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr)) 155px;
    }

    .listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar .mazda-manual-controls .mazda-finder-button {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 900px) {
    .listing-site--mazda-replacement-engines .mazda-home-hero__inner--split {
        display: flex;
        min-height: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 28px;
        padding-top: 34px;
        padding-bottom: 86px;
        text-align: left;
    }

    .listing-site--mazda-replacement-engines .mazda-home-hero__content {
        max-width: 760px;
        margin-inline: auto;
    }

    .listing-site--mazda-replacement-engines .mazda-home-hero__inner--split .mazda-home-hero__proof {
        justify-content: flex-start;
    }

    .listing-site--mazda-replacement-engines .mazda-hero-vrm-card {
        max-width: 620px;
        justify-self: auto;
        margin-inline: auto;
    }

    .listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar {
        margin-top: -36px;
    }

    .listing-site--mazda-replacement-engines .mazda-finder-heading--manual {
        align-items: flex-start;
    }
}

@media (max-width: 620px) {
    .listing-site--mazda-replacement-engines .mazda-home-hero__inner--split {
        padding-top: 24px;
        padding-bottom: 70px;
        gap: 22px;
    }

    .listing-site--mazda-replacement-engines .mazda-home-hero__inner--split h1 {
        font-size: 40px;
    }

    .listing-site--mazda-replacement-engines .mazda-hero-vrm-card {
        padding: 20px 17px;
        border-radius: 14px;
    }

    .listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar {
        margin-top: -28px;
    }

    .listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar .mazda-engine-finder__main {
        padding: 17px 15px 14px;
    }

    .listing-site--mazda-replacement-engines .mazda-finder-heading--manual {
        display: block;
    }

    .listing-site--mazda-replacement-engines .mazda-finder-heading--manual p {
        margin-top: 5px;
    }

    .listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar .mazda-manual-controls {
        grid-template-columns: 1fr;
    }

    .listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar .mazda-manual-controls .mazda-finder-button {
        grid-column: auto;
        grid-row: auto;
    }
}

/* ============================================================
   2026-09-18 — Extend homepage video through manual finder bar
   ------------------------------------------------------------
   Keep the manual finder in its existing visual position while
   extending the VIDEO STAGE underneath the whole white widget.
   The equal positive/negative offsets mean content below the hero
   stays at the same vertical position.
   ============================================================ */

.listing-site--mazda-replacement-engines .mazda-home-hero {
    --mz-widget-video-extension: 150px;
}

.listing-site--mazda-replacement-engines .mazda-home-hero__stage {
    padding-bottom: var(--mz-widget-video-extension);
}

/* Original desktop overlap was -42px. Add the exact same amount
   used to extend the stage so the widget itself does not move. */
.listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar {
    position: relative;
    z-index: 3;
    margin-top: calc(-42px - var(--mz-widget-video-extension));
}

@media (max-width: 900px) {
    .listing-site--mazda-replacement-engines .mazda-home-hero {
        --mz-widget-video-extension: 135px;
    }

    .listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar {
        margin-top: calc(-36px - var(--mz-widget-video-extension));
    }
}

@media (max-width: 620px) {
    .listing-site--mazda-replacement-engines .mazda-home-hero {
        --mz-widget-video-extension: 115px;
    }

    .listing-site--mazda-replacement-engines .mazda-engine-finder--manual-bar {
        margin-top: calc(-28px - var(--mz-widget-video-extension));
    }
}
