/**
 * Clover Displays - About Us Product Category Carousel.
 * Shortcode: [mh_about_category_carousel]
 *
 * Styling follows the existing Clover Best Sellers carousel:
 * >=1440: 5 categories | 1024-1439: 4 | 768-1023: 3 |
 * 480-767: 2 | <480: 1.15 categories (86% width).
 *
 * Scoped to .mhacc; does not modify .clover-best-sellers or .mhcc.
 */
.mhacc {
    --mhacc-black: #1e1e1e;
    --mhacc-title: #000000;
    --mhacc-white: #ffffff;
    --mhacc-gap: 26px;
    --mhacc-columns: 5;
    --mhacc-arrow-y: 50%;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    color: var(--mhacc-black);
    box-sizing: border-box;
}

.mhacc *,
.mhacc *::before,
.mhacc *::after {
    box-sizing: border-box;
}

/* The viewport itself is the flex track, matching the supplied PHP markup. */
.mhacc .mhacc__viewport {
    display: flex;
    align-items: stretch;
    gap: var(--mhacc-gap);
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
}

.mhacc .mhacc__viewport::-webkit-scrollbar {
    display: none;
}

.mhacc .mhacc__item {
    display: flex;
    flex: 0 0 calc((100% - (var(--mhacc-gap) * (var(--mhacc-columns) - 1))) / var(--mhacc-columns));
    flex-direction: column;
    align-self: stretch;
    width: calc((100% - (var(--mhacc-gap) * (var(--mhacc-columns) - 1))) / var(--mhacc-columns));
    min-width: 0;
    margin: 0;
    padding: 0;
    color: var(--mhacc-title);
    text-decoration: none;
    scroll-snap-align: start;
}

.mhacc .mhacc__item:hover,
.mhacc .mhacc__item:focus-visible {
    color: var(--mhacc-title);
    text-decoration: none;
}

/* Same square image treatment and background as Best Sellers. */
.mhacc .mhacc__media {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #f3f5f5;
}

.mhacc .mhacc__image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    object-fit: cover;
    object-position: center;
    image-rendering: auto;
    transition: transform 220ms ease;
}

.mhacc .mhacc__item:hover .mhacc__image,
.mhacc .mhacc__item:focus-visible .mhacc__image {
    transform: scale(1.015);
}

/* Names remain optional: [mh_about_category_carousel show_names="true"] */
.mhacc .mhacc__name {
    display: -webkit-box;
    min-height: 3.4em;
    margin: 0;
    padding: 10px 0 0;
    overflow: hidden;
    color: #000000;
    font-family: Inter, Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.7;
    text-align: left;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mhacc .mhacc__placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #777777;
    font-family: Inter, Arial, Helvetica, sans-serif;
    font-size: clamp(24px, 5vw, 48px);
    font-weight: 600;
}

/* Best Sellers white circular arrow styling. */
.mhacc .mhacc__arrow {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: var(--mhacc-arrow-y);
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: var(--mhacc-black);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity 160ms ease, transform 160ms ease;
}

.mhacc .mhacc__arrow--prev {
    left: -27px;
}

.mhacc .mhacc__arrow--next {
    right: -27px;
}

.mhacc .mhacc__arrow:hover:not(:disabled),
.mhacc .mhacc__arrow:focus-visible:not(:disabled) {
    transform: translateY(-50%) scale(1.04);
}

.mhacc .mhacc__arrow[hidden] {
    display: none !important;
}

.mhacc .mhacc__arrow:disabled {
    opacity: 0.28;
    cursor: default;
    pointer-events: none;
}

.mhacc .mhacc__arrow .mhacc__themify-icon {
    font-size: 18px;
    line-height: 1;
}

.mhacc .mhacc__item:focus-visible,
.mhacc .mhacc__viewport:focus-visible,
.mhacc .mhacc__arrow:focus-visible {
    outline: 2px solid var(--mhacc-black);
    outline-offset: 3px;
}

@media (max-width: 1439px) {
    .mhacc {
        --mhacc-columns: 4;
        --mhacc-gap: 22px;
    }
}

@media (max-width: 1023px) {
    .mhacc {
        --mhacc-columns: 3;
        --mhacc-gap: 20px;
    }

    .mhacc .mhacc__arrow--prev { left: 8px; }
    .mhacc .mhacc__arrow--next { right: 8px; }
}

@media (max-width: 767px) {
    .mhacc {
        --mhacc-columns: 2;
        --mhacc-gap: 16px;
    }

    .mhacc .mhacc__arrow {
        width: 44px;
        height: 44px;
    }

    .mhacc .mhacc__arrow .mhacc__themify-icon {
        font-size: 15px;
    }
}

@media (max-width: 479px) {
    .mhacc {
        --mhacc-gap: 14px;
    }

    .mhacc .mhacc__item {
        flex-basis: 86%;
        width: 86%;
    }

    .mhacc .mhacc__name {
        font-size: 15px;
    }

    .mhacc .mhacc__arrow {
        width: 38px;
        height: 38px;
    }

    .mhacc .mhacc__arrow--prev { left: 5px; }
    .mhacc .mhacc__arrow--next { right: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    .mhacc .mhacc__viewport { scroll-behavior: auto; }
    .mhacc .mhacc__image,
    .mhacc .mhacc__arrow { transition: none; }
}