/* Catalog product tile image: square (1:1), responsive, never distorted.
   The tile grows/shrinks with the viewport via the MudGrid breakpoints, but the
   image area always keeps a 1:1 aspect ratio with a defined minimum size. */
.catalog-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 180px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--mud-palette-background-grey);
}

/* Fullscreen image lightbox shown in the product detail gallery. */
.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.92);
    touch-action: pan-y;
    overflow: hidden;
}

.lightbox-image {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.05s linear;
}

.lightbox-btn {
    background: rgba(0, 0, 0, 0.35);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.lightbox-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    color: #ffffff;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    color: #ffffff;
}

.lightbox-nav-prev {
    left: 12px;
}

.lightbox-nav-next {
    right: 12px;
}

.lightbox-counter {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ffffff;
    z-index: 10;
    font-size: 0.9rem;
}

/* Hint that the detail main image is clickable to enlarge. */
.detail-main-image {
    cursor: zoom-in;
}
