/* Shop-the-look hotspot collage (com_bzhotspots tiles) — homepage section.
   Collage = CSS multi-column masonry: each tile keeps its natural aspect
   ratio, exactly like the WoodMart reference. */

.bz-hotspots__grid {
    columns: 3 320px;
    column-gap: var(--space-3, 16px);
}

/* JS column layout (bz-hotspots__grid--cols): equal-height flex columns,
   tile heights set inline by hotspots.js; images cover-crop to absorb the
   equalization. The plain CSS-columns rules above stay as the no-JS
   fallback. */

.bz-hotspots__grid--cols {
    columns: auto;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.bz-hotspots__col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bz-hotspots__grid--cols .bz-hotspots__tile {
    margin: 0;
}

.bz-hotspots__grid--cols .bz-hotspots__tile > img {
    height: 100%;
    object-fit: cover;
}

.bz-hotspots__tile {
    position: relative;
    display: block;
    margin: 0 0 var(--space-3, 16px);
    break-inside: avoid;
    border-radius: 14px;
    overflow: visible;
}

.bz-hotspots__tile > img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
}

/* --- Tile carrying overlay copy (mirrors the .bz-mosaic idiom) --- */

.bz-hotspots__tile--overlay {
    /* NOT overflow: hidden — that cut the popover off at the photo edge.
       The image, overlay and link each carry their own border-radius. */
    overflow: visible;
}

.bz-hotspots__overlay {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.55) 100%);
}

.bz-hotspots__copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: var(--space-3, 16px);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bz-hotspots__name {
    font-family: var(--font-heading, inherit);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.bz-hotspots__text {
    font-size: 0.9rem;
    opacity: 0.9;
}

.bz-hotspots__link {
    position: absolute;
    inset: 0;
    border-radius: 14px;
}

/* --- Hotspot dot --- */

.bz-hotspot {
    position: absolute;
    width: 0;
    height: 0;
}

.bz-hotspot__btn {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    z-index: 2;
}

.bz-hotspot__btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--c-coffee, #6f4e37);
    transition: transform 0.2s ease;
}

.bz-hotspot.is-open .bz-hotspot__btn::after,
.bz-hotspot__btn:hover::after {
    transform: translate(-50%, -50%) scale(1.35);
}

.bz-hotspot__sonar {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.65);
    animation: bz-hotspot-sonar 2.2s ease-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes bz-hotspot-sonar {
    0%   { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
    70%  { opacity: 0;   transform: translate(-50%, -50%) scale(2.4); }
    100% { opacity: 0;   transform: translate(-50%, -50%) scale(2.4); }
}

/* --- Popover mini product card --- */

/* Shown/hidden with opacity+visibility rather than display, so the card
   can linger: visibility flips only after the delay below, and while it
   is still visible the pointer can come back and cancel the close. That
   is what makes the trip from the dot to the card survivable. */
.bz-hotspot__card {
    opacity: 0;
    visibility: hidden;
    /* pointer-events off while closed: otherwise the card's own box (and
       its bridge) would still answer the mouse, so drifting back over
       where a card used to be would bring it back without ever touching
       its dot. Opening is driven by hotspots.js, from the dot only. */
    pointer-events: none;
    /* No lingering here: the grace period that lets you walk from the dot
       to the card lives in hotspots.js (it keeps .is-open on for a beat).
       Having a delay in both places meant the card could be logically
       closed while CSS still called it visible. */
    transition: opacity 0.15s ease, visibility 0s linear 0.15s;
    position: absolute;
    top: 0;
    width: min(250px, 80vw);
    background: var(--c-card, #fff);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    padding: var(--space-2, 12px);
    z-index: 30;
    cursor: pointer;
}

.bz-hotspot--right .bz-hotspot__card {
    left: 22px;
    transform: translateY(-50%);
}

.bz-hotspot--left .bz-hotspot__card {
    right: 22px;
    transform: translateY(-50%);
}

/* Set by hotspots.js when the card would run off the window on its
   natural side. */
.bz-hotspot--right.bz-hotspot--flipped .bz-hotspot__card {
    left: auto;
    right: 22px;
}

.bz-hotspot--left.bz-hotspot--flipped .bz-hotspot__card {
    right: auto;
    left: 22px;
}

/* There is deliberately no invisible "bridge" element between the dot
   and the card. It used to span the card's full height, which made the
   whole column above and below the dot behave as if it were the card —
   so the popover stayed open with the pointer nowhere near it. Crossing
   the gap is covered by the close delay in hotspots.js instead. */

/* :focus-visible, NOT :focus-within — a mouse click focuses the dot, and
   with :focus-within that focus kept the card open for good, long after
   the pointer had gone. Keyboard users still get it on Tab. */
.bz-hotspot.is-open,
.bz-hotspot:has(.bz-hotspot__btn:focus-visible) {
    z-index: 40;
}

.bz-hotspot.is-open .bz-hotspot__card,
.bz-hotspot__btn:focus-visible ~ .bz-hotspot__card {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.15s ease, visibility 0s;
}

.bz-hotspot__close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    color: var(--c-text, #2b2b2b);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.bz-hotspot__close:hover {
    background: #fff;
    color: var(--c-coffee, #6f4e37);
}

.bz-hotspot__card-media {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    /* Plain white, not the pillow accent: the photo is object-fit
       contain, so anything else shows as coloured bars either side of a
       portrait shot. Product photos are white-backed, so this reads as
       no gap at all. */
    background: #fff;
    margin-bottom: 8px;
}

.bz-hotspot__card-media img {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: contain;
}

.bz-hotspot__card-meta {
    font-size: 0.75rem;
    color: var(--c-muted, #8a8a8a);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.bz-hotspot__card-name {
    display: block;
    color: var(--c-text, #2b2b2b);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 8px;
    text-decoration: none;
}

.bz-hotspot__card-name:hover {
    color: var(--c-coffee, #6f4e37);
}

.bz-hotspot__card-buy {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bz-hotspot__card-buy .bz-price {
    font-weight: 700;
    white-space: nowrap;
}

/* --- Mobile: dots stay, card becomes a bottom sheet above the bottom nav --- */

@media (max-width: 767px) {
    .bz-hotspots__grid {
        columns: 1;
    }

    .bz-hotspot__close {
        width: 38px;
        height: 38px;
        font-size: 26px;
    }

    .bz-hotspot--left .bz-hotspot__card,
    .bz-hotspot--right .bz-hotspot__card {
        position: fixed;
        left: 12px;
        right: 12px;
        top: auto;
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        width: auto;
        transform: none;
        z-index: 1200;
    }
}

@media (min-width: 768px) and (max-width: 1100px) {
    .bz-hotspots__grid {
        columns: 2 300px;
    }
}
