.bb-gallery-section {
    margin: 30px 0;
}

.bb-gallery-section__title,
.bb-object-gallery__title {
    margin-bottom: 20px;
    font-size: 24px;
}

.bb-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.bb-gallery-grid--widget {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.bb-gallery-card,
.bb-gallery-card__link {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
    cursor: zoom-in;
    text-align: left;
}

.bb-gallery-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.bb-gallery-grid--widget img {
    height: 80px;
}

.bb-gallery-card:hover img {
    transform: scale(1.05);
}

.bb-gallery-card__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    font-weight: 600;
}

.bb-gallery-card__count {
    position: absolute;
    top: 10px;
    right: 10px;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.bb-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
}

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

.bb-gallery-lightbox.is-open {
    display: flex !important;
}

.bb-gallery-lightbox-open {
    overflow: hidden;
}

.bb-gallery-lightbox__figure {
    margin: 0;
    max-width: 92vw;
    max-height: 92vh;
    text-align: center;
}

.bb-gallery-lightbox__image {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
}

.bb-gallery-lightbox__caption {
    margin-top: 12px;
    color: #fff;
    font-size: 15px;
}

.bb-gallery-lightbox__close,
.bb-gallery-lightbox__prev,
.bb-gallery-lightbox__next {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    line-height: 1;
    border-radius: 50%;
}

.bb-gallery-lightbox__close {
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    font-size: 32px;
}

.bb-gallery-lightbox__prev,
.bb-gallery-lightbox__next {
    top: 50%;
    width: 52px;
    height: 52px;
    font-size: 42px;
    transform: translateY(-50%);
}

.bb-gallery-lightbox__prev {
    left: 18px;
}

.bb-gallery-lightbox__next {
    right: 18px;
}

.bb-gallery-lightbox__close:hover,
.bb-gallery-lightbox__prev:hover,
.bb-gallery-lightbox__next:hover {
    background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 575px) {
    .bb-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bb-gallery-card img {
        height: 140px;
    }

    .bb-gallery-lightbox__prev,
    .bb-gallery-lightbox__next {
        width: 40px;
        height: 40px;
        font-size: 32px;
    }
}
