/* The catalogue's row of photo tiles (owner, 2026-11-14: "a picture with what the product is written under it,
   exactly like Occhio's site"): inc/calm.php barami_cat_tiles(), on the catalogue page and the category pages,
   in place of the icon row. One row that scrolls sideways: arrows on desktop, swipe on phones.
   Rules carry the parent class .bm-ct to outweigh the Tailwind utilities printed after this file. */

.bm-ct {
    margin-top: 32px;
}

.bm-ct .bm-ct__rail {
    position: relative;
}

.bm-ct .bm-ct__row {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    margin: 0;
    padding: 0 0 4px;
    list-style: none;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.bm-ct .bm-ct__row::-webkit-scrollbar {
    display: none;
}

.bm-ct .bm-ct__cell {
    flex: 0 0 128px;
    margin: 0;
    scroll-snap-align: start;
}

.bm-ct .bm-ct__tile {
    display: block;
    color: var(--bm-ink, #1a1a1a);
    text-decoration: none;
}

.bm-ct .bm-ct__media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--bm-radius, 4px);
    background: var(--bm-tile, #ebe8e3);
}

/* The picture is laid out at its own width (a landscape photo is wider than the square), centred and cropped by
   the tile, so WordPress's sizes="auto" asks for a copy large enough for the crop on sharp screens. */
.bm-ct .bm-ct__img {
    position: absolute;
    top: 0;
    left: 50%;
    display: block;
    width: auto;
    min-width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    translate: -50% 0;
    transition: scale .6s cubic-bezier(.2, .7, .2, 1);
}

.bm-ct .bm-ct__tile:hover .bm-ct__img {
    scale: 1.035;
}

.bm-ct .bm-ct__name {
    display: block;
    margin-top: 10px;
    padding-bottom: 3px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: .02em;
    text-transform: none;
    color: var(--bm-grey, #6b6e74);
    border-bottom: 1px solid transparent;
}

.bm-ct .bm-ct__tile:hover .bm-ct__name,
.bm-ct .bm-ct__tile:focus-visible .bm-ct__name {
    color: var(--bm-ink, #1a1a1a);
}

.bm-ct .bm-ct__tile:focus-visible {
    outline: 2px solid var(--bm-ink, #1a1a1a);
    outline-offset: 3px;
    border-radius: var(--bm-radius, 4px);
}

/* The current kind: a gold frame on the picture and the name underlined in gold (the icon row's colour). */
.bm-ct .bm-ct__tile.is-current .bm-ct__media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    box-shadow: inset 0 0 0 2px #9C6C2E;
    pointer-events: none;
}

.bm-ct .bm-ct__tile.is-current .bm-ct__name {
    display: inline-block;
    color: var(--bm-ink, #1a1a1a);
    border-bottom-color: #9C6C2E;
}

.bm-ct .bm-ct__arrow {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .bm-ct .bm-ct__img {
        transition: none;
    }

    .bm-ct .bm-ct__tile:hover .bm-ct__img {
        scale: none;
    }
}

@media (min-width: 1024px) {
    .bm-ct {
        margin-top: 44px;
    }

    .bm-ct .bm-ct__row {
        gap: 20px;
    }

    .bm-ct .bm-ct__cell {
        flex-basis: 168px;
    }

    .bm-ct .bm-ct__name {
        font-size: 14px;
    }

    .bm-ct .bm-ct__arrow {
        position: absolute;
        top: 84px;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        margin-top: -19px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
        color: var(--bm-ink, #1a1a1a);
        cursor: pointer;
    }

    .bm-ct .bm-ct__arrow[hidden] {
        display: none;
    }

    .bm-ct .bm-ct__arrow--prev {
        inset-inline-start: -14px;
    }

    .bm-ct .bm-ct__arrow--next {
        inset-inline-end: -14px;
    }
}

/* The "previous" arrow points back. */
:root:not([dir="rtl"]) .bm-ct__arrow--prev .bm-chev {
    transform: scaleX(-1);
}

:root[dir="rtl"] .bm-ct__arrow--prev .bm-chev {
    transform: none;
}

/* Home brand tiles back to their compact height now that the "exclusive" line is gone (owner, 2026-11-14). */
section.barami-brands--home .barami-brands__item { height: 64px; }
/* Home brands: all logos in one row on desktop, whatever their number (11 with DiaNoche). */
@media (min-width: 1024px) { section.barami-brands--home .barami-brands__list { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); } }

/* Catalogue first page: a small quiet title right above the category tiles, no band between (owner, 2026-11-14). */
.barami-cat-head { padding-top: 150px !important; padding-bottom: 0 !important; }
@media (min-width: 1024px) { .barami-cat-head { padding-top: 230px !important; } }
.barami-cat-head .barami-cat-h1 {
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    letter-spacing: .12em !important;
    font-weight: 400 !important;
    color: rgba(26, 26, 26, .6) !important;
}
.barami-cat-head + .barami-cat-tiles { padding-top: 16px; }
