.pixart-product-categories {
    --pixart-pcat-duration: 350ms;
    --pixart-pcat-box-start-scale: 0.9;
    display: flex;
    justify-content: center;
    width: 100%;
}

.pixart-product-categories__item {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.pixart-product-categories__link {
    --pixart-pcat-height: 320px;
    position: relative;
    display: block;
    width: 100%;
    height: var(--pixart-pcat-height);
    overflow: hidden;
    background-color: #f1f1f1;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
}

.pixart-product-categories__media {
    position: absolute;
    inset: 0;
    display: block;
}

.pixart-product-categories__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform var(--pixart-pcat-duration) ease;
}

.pixart-product-categories--zoom-enabled .pixart-product-categories__link:hover .pixart-product-categories__image,
.pixart-product-categories--zoom-enabled .pixart-product-categories__link:focus-visible .pixart-product-categories__image {
    transform: scale(1.06);
}

/* Overlay box: a panel inset from every edge of the image. The title (with its
   own background bar) shows at rest; on hover the full dark panel fades in and
   scales up behind it while the Read More reveals. */
.pixart-product-categories__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.pixart-product-categories__box {
    --pixart-pcat-box-gap: 12px;
    --pixart-pcat-box-bg: rgba(20, 20, 20, 0.82);
    position: absolute;
    inset: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--pixart-pcat-box-gap);
    padding: 18px 20px;
    box-sizing: border-box;
    text-align: center;
}

/* The full hover panel lives on ::before so the title stays visible at rest. */
.pixart-product-categories__box::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background-color: var(--pixart-pcat-box-bg);
    opacity: 0;
    transform: scale(var(--pixart-pcat-box-start-scale));
    transform-origin: center;
    transition: opacity var(--pixart-pcat-duration) ease, transform var(--pixart-pcat-duration) cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.pixart-product-categories__link:hover .pixart-product-categories__box::before,
.pixart-product-categories__link:focus-visible .pixart-product-categories__box::before {
    opacity: 1;
    transform: scale(1);
}

.pixart-product-categories__title {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 12px 24px;
    color: #f2b705;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    word-break: break-word;
    background-color: var(--pixart-pcat-title-bg, rgba(82, 60, 42, 0.78));
    transition: background-color var(--pixart-pcat-duration) ease;
}

/* On hover the title bar background drops away so the dark panel shows through. */
.pixart-product-categories__link:hover .pixart-product-categories__title,
.pixart-product-categories__link:focus-visible .pixart-product-categories__title {
    background-color: transparent;
}

/* Read More: hidden at rest, revealed on hover. Re-enables pointer events so its
   own :hover colour works. */
.pixart-product-categories__readmore {
    position: relative;
    z-index: 1;
    display: block;
    max-height: 0;
    margin-top: calc(var(--pixart-pcat-box-gap) * -1);
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    transition: opacity var(--pixart-pcat-duration) ease, max-height var(--pixart-pcat-duration) ease, margin-top var(--pixart-pcat-duration) ease, color var(--pixart-pcat-duration) ease;
}

.pixart-product-categories__link:hover .pixart-product-categories__readmore,
.pixart-product-categories__link:focus-visible .pixart-product-categories__readmore {
    max-height: 4em;
    margin-top: 0;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .pixart-product-categories__box::before,
    .pixart-product-categories__image,
    .pixart-product-categories__title,
    .pixart-product-categories__readmore {
        transition-duration: 1ms;
    }
}
