/* Reusable product lightbox/gallery for tegels.html */

html.gallery-modal-open,
body.gallery-modal-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.gallery-image-trigger {
    cursor: zoom-in;
}

/* Lightbox Container */
.shop-gallery {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.shop-gallery.is-open {
    opacity: 1;
    visibility: visible;
}

.shop-gallery[hidden] {
    display: none !important;
}

/* Background Overlay */
.shop-gallery__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Main Dialog Area */
.shop-gallery__dialog {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    outline: none;
}

/* Top Header (Title, Counter, Close) */
.shop-gallery__header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through except on buttons */
}

.shop-gallery__meta {
    color: #ffffff;
    pointer-events: auto;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.shop-gallery__title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    font-family: ui-sans-serif, system-ui, sans-serif;
}

.shop-gallery__counter {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 2px 0 0 0;
    font-variant-numeric: tabular-nums;
}

.shop-gallery__close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
    pointer-events: auto;
    backdrop-filter: blur(4px);
}

.shop-gallery__close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Image Stage */
.shop-gallery__stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 60px 20px; /* Space for header and dots */
}

.shop-gallery__viewport {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-gallery__figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}

.shop-gallery__image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-drag: none;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.shop-gallery.is-open .shop-gallery__image {
    transform: scale(1);
}

.shop-gallery__caption {
    color: white;
    margin-top: 12px;
    font-size: 0.9rem;
    text-align: center;
    opacity: 0.9;
}

/* Navigation Arrows */
.shop-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.shop-gallery__nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.05);
}

.shop-gallery__nav[hidden] {
    display: none !important;
}

.shop-gallery__nav--prev {
    left: 20px;
}

.shop-gallery__nav--next {
    right: 20px;
}

/* Dots */
.shop-gallery__dots {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.shop-gallery__dots[hidden] {
    display: none;
}

.shop-gallery__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.shop-gallery__dot.is-active {
    background: white;
    transform: scale(1.2);
}

/* Focus States */
.shop-gallery__close:focus-visible,
.shop-gallery__nav:focus-visible,
.shop-gallery__dot:focus-visible {
    outline: 3px solid rgba(250, 204, 21, 0.95);
    outline-offset: 2px;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .shop-gallery__header {
        padding: 12px;
    }
    .shop-gallery__nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .shop-gallery__nav--prev { left: 10px; }
    .shop-gallery__nav--next { right: 10px; }
    .shop-gallery__close { width: 40px; height: 40px; font-size: 24px; }
    .shop-gallery__stage { padding: 50px 0; } /* Less side padding so image uses full width */
    .shop-gallery__image { border-radius: 4px; max-height: 75vh; }
}

/* Hide scrollbar for horizontal app carousels */
.hide-scroll::-webkit-scrollbar {
  display: none;
}
.hide-scroll {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
