.hpt-promo-gallery {
    --hpt-gallery-gap: 20px;
    --hpt-gallery-card-width: 310px;
    --hpt-gallery-radius: 18px;
    --hpt-gallery-border: rgba(15, 23, 42, 0.09);
    --hpt-gallery-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --hpt-gallery-shadow-hover: 0 20px 45px rgba(15, 23, 42, 0.16);

    display: grid;
    grid-template-columns:
        repeat(
            var(--hpt-gallery-effective-columns),
            minmax(0, 1fr)
        );
    gap: var(--hpt-gallery-gap);
    width: 100%;
    max-width:
        calc(
            (
                var(--hpt-gallery-effective-columns)
                * var(--hpt-gallery-card-width)
            )
            +
            (
                (
                    var(--hpt-gallery-effective-columns)
                    - 1
                )
                * var(--hpt-gallery-gap)
            )
        );
    margin-inline: auto;
    box-sizing: border-box;
}

.hpt-promo-gallery *,
.hpt-promo-gallery *::before,
.hpt-promo-gallery *::after {
    box-sizing: border-box;
}

.hpt-promo-gallery__item {
    position: relative;
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    border-radius: var(--hpt-gallery-radius);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.hpt-promo-gallery__frame {
    position: relative;
    display: flex;
    width: 100%;
    aspect-ratio: 4 / 5;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--hpt-gallery-border);
    border-radius: var(--hpt-gallery-radius);
    background:
        radial-gradient(
            circle at 50% 0%,
            #ffffff 0%,
            #f8fafc 55%,
            #f1f5f9 100%
        );
    box-shadow: var(--hpt-gallery-shadow);
    transform: translateZ(0);
    transition:
        transform 220ms ease,
        box-shadow 220ms ease,
        border-color 220ms ease;
}

.hpt-promo-gallery__image {
    display: block;
    width: 100%;
    height: 100%;
    padding: 8px;
    object-fit: contain;
    object-position: center;
    border-radius: calc(var(--hpt-gallery-radius) - 1px);
    transition:
        transform 300ms cubic-bezier(.2,.7,.2,1),
        filter 300ms ease;
}

.hpt-promo-gallery__frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0) 55%,
            rgba(15, 23, 42, 0.06) 100%
        );
    opacity: 0;
    transition: opacity 220ms ease;
}

.hpt-promo-gallery__zoom {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    opacity: 0;
    transform: translateY(7px) scale(0.94);
    backdrop-filter: blur(8px);
    transition:
        opacity 200ms ease,
        transform 200ms ease;
}

.hpt-promo-gallery__zoom svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.hpt-promo-gallery__item:hover .hpt-promo-gallery__frame,
.hpt-promo-gallery__item:focus-visible .hpt-promo-gallery__frame {
    border-color: rgba(15, 23, 42, 0.16);
    box-shadow: var(--hpt-gallery-shadow-hover);
    transform: translateY(-4px);
}

.hpt-promo-gallery__item:hover .hpt-promo-gallery__image,
.hpt-promo-gallery__item:focus-visible .hpt-promo-gallery__image {
    transform: scale(1.018);
}

.hpt-promo-gallery__item:hover .hpt-promo-gallery__frame::after,
.hpt-promo-gallery__item:focus-visible .hpt-promo-gallery__frame::after {
    opacity: 1;
}

.hpt-promo-gallery__item:hover .hpt-promo-gallery__zoom,
.hpt-promo-gallery__item:focus-visible .hpt-promo-gallery__zoom {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hpt-promo-gallery__item:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.34);
    outline-offset: 4px;
}

/* Lightbox */

body.hpt-lightbox-open {
    overflow: hidden;
}

.hpt-promo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 74px;
    color: #ffffff;
    background: rgba(3, 7, 18, 0.94);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(14px);
    transition:
        opacity 180ms ease,
        visibility 180ms ease;
}

.hpt-promo-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.hpt-promo-lightbox__dialog {
    position: relative;
    display: flex;
    width: min(100%, 1180px);
    max-height: calc(100vh - 56px);
    align-items: center;
    justify-content: center;
}

.hpt-promo-lightbox__figure {
    display: flex;
    max-width: 100%;
    max-height: calc(100vh - 56px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.hpt-promo-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 110px);
    object-fit: contain;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.hpt-promo-lightbox__caption {
    max-width: 900px;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.hpt-promo-lightbox__caption:empty {
    display: none;
}

.hpt-promo-lightbox__close,
.hpt-promo-lightbox__prev,
.hpt-promo-lightbox__next {
    position: fixed;
    z-index: 3;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition:
        background 160ms ease,
        transform 160ms ease,
        border-color 160ms ease;
}

.hpt-promo-lightbox__close:hover,
.hpt-promo-lightbox__prev:hover,
.hpt-promo-lightbox__next:hover,
.hpt-promo-lightbox__close:focus-visible,
.hpt-promo-lightbox__prev:focus-visible,
.hpt-promo-lightbox__next:focus-visible {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(30, 41, 59, 0.96);
    outline: none;
}

.hpt-promo-lightbox__close {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    font-size: 30px;
    line-height: 1;
}

.hpt-promo-lightbox__prev,
.hpt-promo-lightbox__next {
    top: 50%;
    width: 50px;
    height: 64px;
    margin-top: -32px;
    border-radius: 14px;
    font-size: 40px;
    line-height: 1;
}

.hpt-promo-lightbox__prev {
    left: 16px;
}

.hpt-promo-lightbox__next {
    right: 16px;
}

.hpt-promo-lightbox__prev:hover {
    transform: translateX(-2px);
}

.hpt-promo-lightbox__next:hover {
    transform: translateX(2px);
}

@media (max-width: 1024px) {
    .hpt-promo-gallery {
        grid-template-columns:
            repeat(
                var(--hpt-gallery-tablet-columns),
                minmax(0, 1fr)
            );
        max-width: none;
    }
}

@media (max-width: 640px) {
    .hpt-promo-gallery {
        --hpt-gallery-gap: 14px;

        grid-template-columns:
            repeat(
                var(--hpt-gallery-mobile-columns),
                minmax(0, 1fr)
            );
    }

    .hpt-promo-gallery__frame {
        border-radius: 14px;
    }

    .hpt-promo-gallery__image {
        padding: 5px;
        border-radius: 13px;
    }

    .hpt-promo-gallery__zoom {
        right: 10px;
        bottom: 10px;
        width: 38px;
        height: 38px;
    }

    .hpt-promo-lightbox {
        padding: 62px 12px 78px;
    }

    .hpt-promo-lightbox__dialog,
    .hpt-promo-lightbox__figure {
        max-height: calc(100vh - 140px);
    }

    .hpt-promo-lightbox__image {
        max-height: calc(100vh - 160px);
        border-radius: 10px;
    }

    .hpt-promo-lightbox__close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }

    .hpt-promo-lightbox__prev,
    .hpt-promo-lightbox__next {
        top: auto;
        bottom: 14px;
        width: 54px;
        height: 48px;
        margin-top: 0;
        border-radius: 12px;
    }

    .hpt-promo-lightbox__prev {
        left: calc(50% - 64px);
    }

    .hpt-promo-lightbox__next {
        right: calc(50% - 64px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hpt-promo-gallery__frame,
    .hpt-promo-gallery__image,
    .hpt-promo-gallery__zoom,
    .hpt-promo-lightbox,
    .hpt-promo-lightbox__close,
    .hpt-promo-lightbox__prev,
    .hpt-promo-lightbox__next {
        transition: none !important;
    }
}

/* ==========================================================================
   HPT 1.5.0 CONSUMER UI POLISH
   ========================================================================== */

/* Smart rebate / fallback badge */

.hpt-rebate-badge,
.hpt-rebate-badge *,
.hpt-rebate-badge *::before,
.hpt-rebate-badge *::after {
    box-sizing: border-box;
}

.hpt-rebate-badge {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 7px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}

.hpt-rebate-badge__icon {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}

.hpt-rebate-badge__text {
    display: inline-block;
}

/* Rebate available */

.hpt-rebate-badge--rebate {
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            #991b1b 0%,
            #dc2626 56%,
            #ef4444 100%
        );
    box-shadow:
        0 8px 22px
        rgba(220, 38, 38, 0.24);
}

.hpt-rebate-badge--rebate
.hpt-rebate-badge__icon {
    color: #991b1b;
    background:
        linear-gradient(
            135deg,
            #fde047 0%,
            #facc15 100%
        );
    box-shadow:
        0 3px 8px
        rgba(0, 0, 0, 0.12);
}

/* Valid model but no rebate */

.hpt-rebate-badge--fallback {
    color: #111827;
    background: #ffffff;
    box-shadow:
        0 6px 20px
        rgba(15, 23, 42, 0.10);
}

.hpt-rebate-badge--fallback
.hpt-rebate-badge__icon {
    color: #ffffff;
    background: #111827;
    font-family:
        Georgia,
        "Times New Roman",
        serif;
    font-size: 15px;
    font-style: italic;
}

/*
 * Gallery presentation override.
 *
 * - no white frame
 * - no card border
 * - no poster padding
 * - center every row
 * - incomplete final row remains centered
 */

.hpt-promo-gallery {
    display: flex !important;
    width: 100% !important;
    max-width: 1320px !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: var(--hpt-gallery-gap, 20px) !important;
    margin-inline: auto !important;
}

.hpt-promo-gallery__item {
    flex:
        0
        1
        var(--hpt-gallery-desktop-basis) !important;
    max-width: 310px;
    min-width: 0;
    border: 0 !important;
    background: transparent !important;
}

.hpt-promo-gallery__frame {
    width: 100%;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.hpt-promo-gallery__frame::after {
    display: none !important;
}

.hpt-promo-gallery__image {
    width: 100%;
    height: 100%;
    padding: 0 !important;
    border: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    background: transparent !important;
    border-radius: 16px;
    box-shadow:
        0 10px 26px
        rgba(15, 23, 42, 0.11);
    transition:
        transform 240ms
            cubic-bezier(.2,.7,.2,1),
        box-shadow 240ms ease;
}

.hpt-promo-gallery__item:hover
.hpt-promo-gallery__image,
.hpt-promo-gallery__item:focus-visible
.hpt-promo-gallery__image {
    transform:
        translateY(-4px)
        scale(1.012);
    box-shadow:
        0 18px 42px
        rgba(15, 23, 42, 0.17);
}

@media (max-width: 1024px) {
    .hpt-promo-gallery__item {
        flex-basis:
            var(--hpt-gallery-tablet-basis) !important;
        max-width: 360px;
    }
}

@media (max-width: 640px) {
    .hpt-rebate-badge {
        min-height: 36px;
        gap: 7px;
        padding: 5px 12px 5px 6px;
        font-size: 13px;
    }

    .hpt-rebate-badge__icon {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
        font-size: 13px;
    }

    .hpt-promo-gallery {
        gap: 14px !important;
    }

    .hpt-promo-gallery__item {
        flex-basis:
            var(--hpt-gallery-mobile-basis) !important;
        max-width: 420px;
    }

    .hpt-promo-gallery__image {
        border-radius: 14px;
    }
}
