.magehq-product-carousel {
    --mhq-gap: 1.25rem;
    --mhq-radius: 1.25rem;
    width: 100%;
    margin: 3rem auto;
    color: #111827;
}

.magehq-product-carousel__header,
.magehq-product-carousel__bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.magehq-product-carousel__header {
    margin-bottom: 1.5rem;
}

.magehq-product-carousel__title {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.magehq-product-carousel__subtitle {
    max-width: 46rem;
    margin: .65rem 0 0;
    color: #667085;
    font-size: 1rem;
    line-height: 1.65;
}

.magehq-product-carousel__controls {
    display: flex;
    gap: .625rem;
    flex: 0 0 auto;
}

.magehq-product-carousel__arrow {
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #d0d5dd;
    border-radius: 9999px;
    background: #fff;
    color: #344054;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.magehq-product-carousel__arrow:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: #7f56d9;
    box-shadow: 0 8px 20px rgba(16, 24, 40, .08);
}

.magehq-product-carousel__arrow:disabled {
    opacity: .35;
    cursor: default;
}

.magehq-product-carousel__arrow svg,
.magehq-product-carousel__view-all svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.magehq-product-carousel__viewport {
    display: flex;
    gap: var(--mhq-gap);
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: .25rem .1rem 1rem;
}

.magehq-product-carousel__viewport::-webkit-scrollbar {
    display: none;
}

.magehq-product-carousel__card {
    display: flex;
    flex: 0 0 calc(90% - var(--mhq-gap));
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    scroll-snap-align: start;
    border: 1px solid #eaecf0;
    border-radius: var(--mhq-radius);
    background: #fff;
    box-shadow: 0 8px 26px rgba(16, 24, 40, .055);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.magehq-product-carousel__card:hover {
    transform: translateY(-3px);
    border-color: #d6bbfb;
    box-shadow: 0 16px 36px rgba(16, 24, 40, .10);
}

.magehq-product-carousel__image-link {
    display: flex;
    aspect-ratio: 4 / 3;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
}

.magehq-product-carousel__image-link .product-image-container,
.magehq-product-carousel__image-link .product-image-wrapper {
    width: 100% !important;
    height: 100%;
}

.magehq-product-carousel__image-link .product-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.1rem;
}

.magehq-product-carousel__image,
.magehq-product-carousel__image-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.magehq-product-carousel__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.25rem;
}

.magehq-product-carousel__product-name {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.4;
    font-weight: 750;
}

.magehq-product-carousel__product-name a {
    color: #101828;
    text-decoration: none;
}

.magehq-product-carousel__product-name a:hover {
    color: #6941c6;
}

.magehq-product-carousel__reviews {
    min-height: 1.25rem;
    margin-top: .65rem;
}

.magehq-product-carousel__description {
    display: -webkit-box;
    overflow: hidden;
    margin: .8rem 0 0;
    color: #667085;
    font-size: .9375rem;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.magehq-product-carousel__footer {
    margin-top: auto;
    padding-top: 1.15rem;
}

.magehq-product-carousel__price {
    min-height: 2rem;
    margin-bottom: .8rem;
    font-weight: 700;
}

.magehq-product-carousel__actions,
.magehq-product-carousel__actions form {
    width: 100%;
}

.magehq-product-carousel__button {
    display: inline-flex;
    width: 100%;
    min-height: 2.8rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: .75rem;
    padding: .75rem 1rem;
    cursor: pointer;
    font-size: .9375rem;
    font-weight: 700;
    text-decoration: none;
}

.magehq-product-carousel__button--primary {
    background: linear-gradient(135deg, #5b3fff, #7f56d9);
    color: #fff;
    box-shadow: 0 6px 16px rgba(91, 63, 255, .2);
}

.magehq-product-carousel__button--primary:hover {
    filter: brightness(.97);
    color: #fff;
}

.magehq-product-carousel__bottom {
    align-items: center;
    margin-top: .8rem;
}

.magehq-product-carousel__dots {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-height: 1.5rem;
}

.magehq-product-carousel__dot {
    width: .55rem;
    height: .55rem;
    border: 0;
    border-radius: 9999px;
    padding: 0;
    background: #d0d5dd;
    cursor: pointer;
    transition: width .2s ease, background .2s ease;
}

.magehq-product-carousel__dot[aria-current="true"] {
    width: 1.4rem;
    background: #6941c6;
}

.magehq-product-carousel__view-all {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #6941c6;
    font-weight: 700;
    text-decoration: none;
}

.magehq-product-carousel__view-all:hover {
    color: #53389e;
}

.magehq-product-carousel :focus-visible {
    outline: 3px solid rgba(127, 86, 217, .35);
    outline-offset: 3px;
}

@media (min-width: 640px) {
    .magehq-product-carousel__card {
        flex-basis: calc((100% - var(--mhq-gap)) / 2);
    }
}

@media (min-width: 1024px) {
    .magehq-product-carousel__card {
        flex-basis: calc((100% - (var(--mhq-gap) * 2)) / 3);
    }
}

@media (min-width: 1440px) {
    .magehq-product-carousel__card {
        flex-basis: calc((100% - (var(--mhq-gap) * 3)) / 4);
    }
}

@media (max-width: 639px) {
    .magehq-product-carousel {
        margin: 2.25rem auto;
    }

    .magehq-product-carousel__header {
        align-items: flex-start;
    }

    .magehq-product-carousel__controls {
        display: none;
    }

    .magehq-product-carousel__bottom {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .magehq-product-carousel__viewport {
        scroll-behavior: auto;
    }

    .magehq-product-carousel__card,
    .magehq-product-carousel__arrow,
    .magehq-product-carousel__dot {
        transition: none;
    }
}
