/* 28BIT hover motion for brand cards outside the homepage. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    main .brands__item:where(:not(main.up-home .blocks__item-brands *)):not(.swiper-slide > *):not(.blocks__item-viewed *):where(:not(.m28-recommended-no-motion *)),
    main .swiper-slide:has(> .brands__item:where(:not(main.up-home .blocks__item-brands *))):not(.blocks__item-viewed *):where(:not(.m28-recommended-no-motion *)) {
        transform-origin: center;
        transition: box-shadow var(--m28-card-hover-time) ease-out,
            background-color .15s ease-out, transform var(--m28-card-hover-time) ease-out;
    }
    main .brands__item:where(:not(main.up-home .blocks__item-brands *)):not(.swiper-slide > *):not(.blocks__item-viewed *):where(:not(.m28-recommended-no-motion *)):hover,
    main .swiper-slide:has(> .brands__item:where(:not(main.up-home .blocks__item-brands *))):not(.blocks__item-viewed *):where(:not(.m28-recommended-no-motion *)):hover {
        transform: translateY(var(--m28-card-hover-lift)) scale(var(--m28-card-hover-scale));
        z-index: 2;
    }
}

/* 28BIT brand logo tiles, 2026-10-16.
   Productbrands owns the PNGs; Upsell's native .brands__img is the tile. */
.brands:where(:not(main.up-home .blocks__item-brands *)) .brands__img {
    background: transparent;
    border-color: transparent;
}
/* Keep the original mark colors on a calm neutral tile in the dark theme. */
html[data-up-theme="dark"] .brands:where(:not(main.up-home .blocks__item-brands *)) .brands__img {
    background: #e7eaee;
}
/* Productbrands' standalone brand header has no tile; keep dark wordmarks legible. */
html[data-up-theme="dark"] main.up-main.wrap > img[src*="/wa-data/public/shop/brands/"] {
    background: #e7eaee;
    padding: 6px 8px;
    border-radius: 8px;
}
/* White-only marks keep their original pixels on a slate tile in both modes. */
html:root main.up-main.wrap > img:is(
    [src*="/20095/"], [src*="/20121/"], [src*="/20146/"],
    [src*="/20218/"], [src*="/20235/"]
) {
    background: #38404c;
    padding: 6px 8px;
    border-radius: 8px;
}
/* White marks and missing-logo placeholders use a slate tile for contrast. */
html[data-up-theme="dark"] .brands:where(:not(main.up-home .blocks__item-brands *)) .brands__img:has(img:is(
    [src*="dummy.svg"], [data-m28-lazy-src*="dummy.svg"],
    [src*="/20095/"], [data-m28-lazy-src*="/20095/"],
    [src*="/20121/"], [data-m28-lazy-src*="/20121/"],
    [src*="/20146/"], [data-m28-lazy-src*="/20146/"],
    [src*="/20218/"], [data-m28-lazy-src*="/20218/"],
    [src*="/20235/"], [data-m28-lazy-src*="/20235/"]
)) {
    background: #38404c;
}
/* White-only marks need dark strokes when the light-theme tile is transparent. */
html:not([data-up-theme="dark"]) .brands:where(:not(main.up-home .blocks__item-brands *)) .brands__img img:is(
    [src*="/20121/"], [src*="/20146/"], [src*="/20218/"], [src*="/20235/"]
) {
    filter: invert(1);
}
/* OCPC's colored accent remains close to its original hue in the light theme. */
html:not([data-up-theme="dark"]) .brands:where(:not(main.up-home .blocks__item-brands *)) .brands__img img[src*="/20095/"] {
    filter: invert(1) hue-rotate(180deg);
}
