.wp-block-review-mosaic-gallery.review-mosaic {
    --rm-height: 520px;
    --rm-column-width: 260px;
    --rm-gap: 12px;
    --rm-radius: 8px;
    position: relative;
    width: 100%;
}

.review-mosaic .rm-stage {
    position: relative;
}

.review-mosaic .rm-viewport {
    width: 100%;
    height: var(--rm-height);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-inline: contain;
}

.review-mosaic .rm-viewport::-webkit-scrollbar {
    display: none;
}

.review-mosaic .rm-track {
    display: flex;
    align-items: flex-start;
    gap: var(--rm-gap);
    width: max-content;
    min-width: 100%;
    height: var(--rm-height);
}

/* No-JS fallback: images remain visible in source order. */
.review-mosaic:not(.rm-is-ready) .rm-track {
    flex-wrap: nowrap;
}

.review-mosaic:not(.rm-is-ready) .rm-item {
    width: var(--rm-column-width);
    flex: 0 0 var(--rm-column-width);
}

.review-mosaic .rm-column {
    flex: 0 0 var(--rm-column-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.review-mosaic .rm-item {
    position: relative;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: var(--rm-radius);
    background: #fff;
}

.review-mosaic .rm-image-button {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    display: block;
    width: 100%;
    height: 100%;
    background: transparent;
    cursor: zoom-in;
    overflow: hidden;
    border-radius: inherit;
}

.review-mosaic .rm-image-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.review-mosaic .rm-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 220ms ease;
    transform-origin: center center;
}

@media (hover: hover) {
    .review-mosaic.rm-hover-zoom .rm-image-button:hover img {
        transform: scale(1.035);
    }
}

.review-mosaic .rm-nav {
    position: absolute;
    /* Anchor to the actual gallery viewport height, not theme button metrics. */
    top: calc(var(--rm-height) / 2);
    transform: translateY(-50%);
    z-index: 4;

    /* Hard reset so Astra / WooCommerce button styles cannot turn it into a pill. */
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    aspect-ratio: 1 / 1;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;

    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
    color: #222 !important;
    font-family: Arial, sans-serif;
    font-size: 22px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
}

.review-mosaic .rm-nav:hover,
.review-mosaic .rm-nav:focus,
.review-mosaic .rm-nav:active {
    border-radius: 50% !important;
    padding: 0 !important;
    background: #fff !important;
    color: #111 !important;
}

.review-mosaic .rm-prev { left: 10px; }
.review-mosaic .rm-next { right: 10px; }

.review-mosaic .rm-nav:disabled {
    opacity: 0.28;
    cursor: default;
}

.review-mosaic .rm-nav.is-hidden {
    display: none;
}

.review-mosaic .rm-dots {
    min-height: 20px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.review-mosaic .rm-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.25;
    cursor: pointer;
}

.review-mosaic .rm-dot.is-active {
    opacity: 0.85;
}

.review-mosaic .rm-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.88);
    align-items: center;
    justify-content: center;
    padding: 40px 70px;
}

.review-mosaic .rm-lightbox.is-open {
    display: flex;
}

body.rm-lightbox-open {
    overflow: hidden;
}

.review-mosaic .rm-lightbox-image {
    display: block;
    max-width: min(92vw, 1500px);
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.review-mosaic .rm-lightbox-close,
.review-mosaic .rm-lightbox-prev,
.review-mosaic .rm-lightbox-next {
    position: absolute;
    appearance: none;
    border: 0;
    background: rgba(255, 255, 255, 0.92);
    color: #111;
    cursor: pointer;
}

.review-mosaic .rm-lightbox-close {
    top: 20px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 32px;
    line-height: 40px;
}

.review-mosaic .rm-lightbox-prev,
.review-mosaic .rm-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 56px;
    border-radius: 8px;
    font-size: 26px;
}

.review-mosaic .rm-lightbox-prev { left: 18px; }
.review-mosaic .rm-lightbox-next { right: 18px; }

@media (max-width: 600px) {
    .review-mosaic .rm-nav {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        max-width: 38px !important;
        max-height: 38px !important;
        font-size: 19px !important;
    }

    .review-mosaic .rm-lightbox {
        padding: 60px 16px 24px;
    }

    .review-mosaic .rm-lightbox-prev,
    .review-mosaic .rm-lightbox-next {
        width: 38px;
        height: 48px;
    }
}

/* v1.1.3 — theme-proof lightbox controls. Glyphs are drawn with CSS so
   Astra/button line-height cannot shift them off center. */
.review-mosaic .rm-lightbox-close,
.review-mosaic .rm-lightbox-prev,
.review-mosaic .rm-lightbox-next {
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    line-height: 1 !important;
    text-indent: -9999px;
    overflow: hidden;
}

.review-mosaic .rm-lightbox-close {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    border-radius: 50% !important;
}

.review-mosaic .rm-lightbox-close::before,
.review-mosaic .rm-lightbox-close::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #111;
    transform-origin: center;
}

.review-mosaic .rm-lightbox-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.review-mosaic .rm-lightbox-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.review-mosaic .rm-lightbox-prev,
.review-mosaic .rm-lightbox-next {
    width: 44px !important;
    height: 56px !important;
    min-width: 44px !important;
    min-height: 56px !important;
    max-width: 44px !important;
    max-height: 56px !important;
    border-radius: 8px !important;
}

.review-mosaic .rm-lightbox-prev::before,
.review-mosaic .rm-lightbox-next::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 11px;
    height: 11px;
    border-top: 3px solid #111;
    border-right: 3px solid #111;
    box-sizing: border-box;
}

.review-mosaic .rm-lightbox-prev::before {
    transform: translate(-50%, -50%) rotate(-135deg);
}

.review-mosaic .rm-lightbox-next::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

@media (max-width: 600px) {
    .review-mosaic .rm-lightbox-prev,
    .review-mosaic .rm-lightbox-next {
        width: 38px !important;
        height: 48px !important;
        min-width: 38px !important;
        min-height: 48px !important;
        max-width: 38px !important;
        max-height: 48px !important;
    }
}
