/* ============================================================
   Product Gallery — Unified Booking.com-style gallery
   BEM naming: .bc-product-gallery
   No !important — specificity managed via nesting
   ============================================================ */

:root {
    --gallery-height: 420px;
    --gallery-gap: 4px;
    --gallery-overlay-bg: rgba(0, 0, 0, 0.5);
    --gallery-overlay-hover: rgba(0, 0, 0, 0.65);
    --gallery-placeholder-color: #e8e8e8;
}

/* ============================================================
   Base container
   ============================================================ */
.bc-product-gallery {
    display: grid;
    height: var(--gallery-height);
    gap: var(--gallery-gap);
    overflow: hidden;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   Count variants — grid layout per image count
   ============================================================ */

/* 1 image: full width */
.bc-product-gallery--count-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

/* 2 images: main 2/3 + side 1/3 */
.bc-product-gallery--count-2 {
    grid-template-columns: 2fr 1fr;
}

/* 3 images: main 2/3 + side 1/3 with 2 rows */
.bc-product-gallery--count-3 {
    grid-template-columns: 2fr 1fr;
}

/* 4+ images: main 2/3 + side 1/3 with 3 rows */
.bc-product-gallery--count-4plus {
    grid-template-columns: 2fr 1fr;
}

/* ============================================================
   Main image (left panel)
   ============================================================ */
.bc-product-gallery__main {
    display: block;
    overflow: hidden;
    background-color: var(--gallery-placeholder-color);
    position: relative;
}

.bc-product-gallery__main a {
    display: block;
    width: 100%;
    height: 100%;
}

.bc-product-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: filter 200ms ease;
    cursor: pointer;
}

.bc-product-gallery__main a:hover img {
    filter: brightness(1.05);
}

/* ============================================================
   Side panel (right column)
   ============================================================ */
.bc-product-gallery__side {
    display: grid;
    gap: var(--gallery-gap);
    overflow: hidden;
}

/* Side panel row distribution per count */
.bc-product-gallery--count-2 .bc-product-gallery__side {
    grid-template-rows: 1fr;
}

.bc-product-gallery--count-3 .bc-product-gallery__side {
    grid-template-rows: 1fr 1fr;
}

.bc-product-gallery--count-4plus .bc-product-gallery__side {
    grid-template-rows: 1fr 1fr 1fr;
}

/* ============================================================
   Individual side item
   ============================================================ */
.bc-product-gallery__item {
    position: relative;
    overflow: hidden;
    background-color: var(--gallery-placeholder-color);
}

.bc-product-gallery__item a {
    display: block;
    width: 100%;
    height: 100%;
}

.bc-product-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: filter 200ms ease;
    cursor: pointer;
}

.bc-product-gallery__item a:hover img {
    filter: brightness(1.05);
}

/* ============================================================
   "+X Photos" overlay on last side item
   ============================================================ */
.bc-product-gallery__overlay {
    position: absolute;
    inset: 0;
    background-color: var(--gallery-overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color 200ms ease;
    z-index: 2;
}

.bc-product-gallery__overlay:hover {
    background-color: var(--gallery-overlay-hover);
}

/* ============================================================
   Hidden anchors (extra images for Fancybox navigation)
   ============================================================ */
.bc-product-gallery__hidden {
    display: none;
    visibility: hidden;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ============================================================
   Accessibility: focus states
   ============================================================ */
.bc-product-gallery__main a:focus-visible,
.bc-product-gallery__item a:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: -2px;
}

/* ============================================================
   Fancybox overrides — ensure lightbox covers sticky nav/search bar
   ============================================================ */
.fancybox__container {
    z-index: 99999 !important;
}

/* ============================================================
   Fancybox caption — show alt text below image
   ============================================================ */
.fancybox__caption {
    color: #e8e8e8;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: center;
    padding: 10px 20px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}
