/* =========================================================
   MAGIC TRAILERS WORLD - OUR RANGE v3
   Cards only. Section, heading, divider and background stay
   controlled in Bricks. Do not combine with the v1 rules.
   ========================================================= */

.mtw-our-range-shell {
    --mtw-range-gap: clamp(24px, 3.125vw, 40px);
    --mtw-range-ink: #1e1e1e;
    --mtw-range-accent: #fe6901;
    width: 100%;
    max-width: 1280px;
    min-width: 0;
    margin-inline: auto;
    padding: 0;
    background: transparent;
}

.mtw-our-range-shell *,
.mtw-our-range-shell *::before,
.mtw-our-range-shell *::after {
    box-sizing: border-box;
}

/* Desktop: original 3 + 2 layout preserved exactly. */
.mtw-our-range-shell .mtw-our-range__stage {
    position: relative;
    width: 100%;
}

/* Desktop: exactly three cards per row; an incomplete final row is centred. */
.mtw-our-range-shell .mtw-our-range {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    column-gap: var(--mtw-range-gap);
    row-gap: clamp(28px, 2.5vw, 34px);
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
}

.mtw-our-range-shell .mtw-our-range__item {
    display: flex;
    flex: 0 0 calc((100% - 2 * var(--mtw-range-gap)) / 3);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    color: var(--mtw-range-ink);
    text-decoration: none !important;
    text-align: center;
    cursor: pointer;
}

.mtw-our-range-shell .mtw-our-range__media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 400 / 350;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.mtw-our-range-shell .mtw-our-range__image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    object-fit: contain;
    object-position: center;
    transform: translateY(0) scale(1);
    transition: transform 260ms ease;
}

.mtw-our-range-shell .mtw-our-range__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: #faf5ee;
}

.mtw-our-range-shell .mtw-our-range__name {
    display: block;
    width: 100%;
    margin: 16px 0 0;
    padding: 0 4px;
    color: var(--mtw-range-ink);
    font-family: Roboto, Arial, sans-serif;
    font-size: clamp(16px, 1.56vw, 20px);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
    text-decoration: none;
    text-align: center;
    text-wrap: balance;
    transition: color 220ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .mtw-our-range-shell .mtw-our-range__item:hover .mtw-our-range__image {
        transform: translateY(-5px) scale(1.018);
    }

    .mtw-our-range-shell .mtw-our-range__item:hover .mtw-our-range__name {
        color: var(--mtw-range-accent);
    }
}

.mtw-our-range-shell .mtw-our-range__item:focus-visible {
    outline: 2px solid var(--mtw-range-accent);
    outline-offset: 5px;
    border-radius: 2px;
}

/* Tablet: two columns with the last odd card centred. */
@media (min-width: 768px) and (max-width: 1023px) {
    .mtw-our-range-shell {
        --mtw-range-gap: clamp(20px, 3.4vw, 36px);
    }

    .mtw-our-range-shell .mtw-our-range__item {
        flex-basis: calc((100% - var(--mtw-range-gap)) / 2);
    }

    .mtw-our-range-shell .mtw-our-range__media {
        aspect-ratio: 400 / 350;
    }
}

/* Desktop/tablet do not show carousel controls. */
.mtw-our-range-shell .mtw-our-range__arrow,
.mtw-our-range-shell .mtw-our-range__pagination {
    display: none;
}

/* =========================================================
   MOBILE: matches MTW Recommended Trailers/Lifestyle Gallery
   - one centred card with next/previous slide peek
   - overlay dark circular arrows
   - animated orange pagination pills
   - native touch swipe + scroll snapping
   ========================================================= */
@media (max-width: 767px) {
    .mtw-our-range-shell {
        --mtw-range-dot: #f5d7ba;
        --mtw-range-dot-active: #fe6901;
        --mtw-range-arrow: rgba(43, 51, 41, .66);
        --mtw-range-arrow-hover: rgba(43, 51, 41, .86);
        position: relative;
        width: 100%;
        max-width: none;
        min-width: 0;
        overflow: hidden;
    }

    .mtw-our-range-shell .mtw-our-range__stage {
        position: relative;
        width: 100%;
        min-width: 0;
    }

    .mtw-our-range-shell .mtw-our-range {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: stretch;
        gap: 14px;
        width: 100%;
        max-width: 100%;
        padding: 0 10%;
        margin: 0;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        outline-offset: -3px;
    }

    .mtw-our-range-shell .mtw-our-range::-webkit-scrollbar {
        display: none;
    }

    .mtw-our-range-shell .mtw-our-range__item {
        flex: 0 0 100%; /* 100% of the 80%-wide inner track */
        width: 100%;
        max-width: none;
        min-width: 0;
        padding: 0;
        margin: 0;
        overflow: hidden;
        background: #ffffff;
        border-radius: 20px;
        scroll-snap-align: center;
        scroll-snap-stop: always;
        text-decoration: none;
    }

    .mtw-our-range-shell .mtw-our-range__media {
        width: 100%;
        aspect-ratio: 1.05 / 1;
        padding: 12px 12px 0;
        margin: 0;
        border: 0;
        border-radius: 0;
        overflow: hidden;
        background: transparent;
    }

    .mtw-our-range-shell .mtw-our-range__image {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .mtw-our-range-shell .mtw-our-range__name {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 66px;
        margin: 0;
        padding: 8px 14px 20px;
        font-size: 17px;
        font-weight: 500;
        line-height: 1.3;
        color: #1e1e1e;
        text-align: center;
    }

    /* Dark translucent MTW-style arrows overlay the image area. */
    .mtw-our-range-shell .mtw-our-range__arrow {
        position: absolute;
        z-index: 5;
        top: 42%;
        display: grid;
        place-items: center;
        width: 46px;
        height: 46px;
        min-width: 46px;
        min-height: 46px;
        margin: 0;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, .68);
        border-radius: 50%;
        background: var(--mtw-range-arrow);
        color: #fff;
        box-shadow: none;
        appearance: none;
        transform: translateY(-50%);
        cursor: pointer;
        transition: background-color .2s ease, opacity .2s ease;
    }

    .mtw-our-range-shell .mtw-our-range__arrow--prev { left: 6px; }
    .mtw-our-range-shell .mtw-our-range__arrow--next { right: 6px; }

    .mtw-our-range-shell .mtw-our-range__arrow svg {
        display: block;
        width: 23px;
        height: 23px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mtw-our-range-shell .mtw-our-range__arrow:not(:disabled):hover {
        background: var(--mtw-range-arrow-hover);
    }

    .mtw-our-range-shell .mtw-our-range__arrow:disabled {
        opacity: .35;
        cursor: default;
    }

    .mtw-our-range-shell .mtw-our-range__arrow:focus-visible,
    .mtw-our-range-shell .mtw-our-range__dot:focus-visible {
        outline: 2px solid var(--mtw-range-accent);
        outline-offset: 3px;
    }

    /* Visual dot is small; the full button remains easy to tap. */
    .mtw-our-range-shell .mtw-our-range__pagination {
        position: relative;
        z-index: 1;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 0;
        width: 100%;
        max-width: 100%;
        min-height: 44px;
        margin: 13px auto 0;
        padding: 0 8px;
    }

    .mtw-our-range-shell .mtw-our-range__dot {
        display: inline-grid;
        flex: 0 0 29px;
        place-items: center;
        width: 29px;
        min-width: 29px;
        height: 44px;
        min-height: 44px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        appearance: none;
        cursor: pointer;
        transition: flex-basis .2s ease, width .2s ease;
    }

    .mtw-our-range-shell .mtw-our-range__dot::before {
        content: "";
        display: block;
        width: 16px;
        height: 4px;
        border-radius: 999px;
        background: var(--mtw-range-dot);
        transition: width .2s ease, background-color .2s ease;
    }

    .mtw-our-range-shell .mtw-our-range__dot.is-active {
        flex-basis: 47px;
        width: 47px;
    }

    .mtw-our-range-shell .mtw-our-range__dot.is-active::before {
        width: 38px;
        background: var(--mtw-range-dot-active);
    }

    /* A single category needs no carousel styling or navigation. */
    .mtw-our-range-shell[data-count="1"] .mtw-our-range {
        justify-content: center;
    }
}

@media (max-width: 359px) {
    .mtw-our-range-shell .mtw-our-range { gap: 12px; }
    .mtw-our-range-shell .mtw-our-range__item { border-radius: 16px; }
    .mtw-our-range-shell .mtw-our-range__arrow {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mtw-our-range-shell .mtw-our-range__image,
    .mtw-our-range-shell .mtw-our-range__name,
    .mtw-our-range-shell .mtw-our-range__arrow,
    .mtw-our-range-shell .mtw-our-range__dot,
    .mtw-our-range-shell .mtw-our-range__dot::before {
        transition: none !important;
    }
    .mtw-our-range-shell .mtw-our-range { scroll-behavior: auto; }
}