/* A 3:2 main frame alongside four 3:2 tiles. With 8px gaps, the
   main column is 4px wider so both columns finish at the same height. */
.catalog-product-view .bookplus-gallery-grid {
    grid-template-columns: minmax(0, calc(50% - 2px)) minmax(0, 1fr);
    gap: 8px;
    height: auto !important;
    align-items: start;
}

.catalog-product-view .bookplus-gallery-grid--single {
    grid-template-columns: minmax(0, 1fr);
}

.catalog-product-view .bookplus-gallery-main,
.catalog-product-view .bookplus-gallery-tile,
.catalog-product-view .bookplus-mobile-gallery-item {
    position: relative;
    width: 100%;
    min-width: 0;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 3 / 2;
    background: #f3f4f6;
}

.catalog-product-view .bookplus-gallery-side {
    min-width: 0;
    gap: 8px;
    grid-template-rows: auto auto;
}

.catalog-product-view .bookplus-gallery img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important;
    min-width: 0 !important;
    object-fit: contain;
}

/* Hover zoom would crop the edges of an otherwise fully visible image. */
.catalog-product-view .bookplus-gallery button:hover img {
    transform: none;
}

.catalog-product-view .bookplus-mobile-strip {
    gap: 0 !important;
    align-items: start;
}

@media (max-width: 1023px) {
    .catalog-product-view .bookplus-gallery-grid,
    .catalog-product-view .bookplus-content .bookplus-gallery-grid,
    .catalog-product-view .bookplus-content .bookplus-gallery-grid--single {
        display: none !important;
    }

    .catalog-product-view .bookplus-gallery-mobile {
        display: block !important;
    }
}
