.pb-gallery {
    padding: 54px 20px 80px;
}

.pb-gallery__inner {
    max-width: 1320px;
    margin: 0 auto;
}

.pb-gallery__tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    overflow-x: auto;
    padding-bottom: 6px;
    justify-content: center;
    scrollbar-width: none;
}

.pb-gallery__tabs::-webkit-scrollbar {
    display: none;
}

.pb-gallery__tab {
    flex: 0 0 auto;
    border: 1px solid #d7d7d7;
    background: #fff;
    color: #222;
    border-radius: 999px;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pb-gallery__tab.is-active {
    background: #004094;
    border-color: #004094;
    color: #fff;
}

.pb-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.pb-gallery__card {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    will-change: transform, opacity;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.pb-gallery__card.is-leaving,
.pb-gallery__card.is-entering {
    opacity: 0;
    transform: translateY(20px) scale(0.965);
}

.pb-gallery__image-frame {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(180deg, #fafafa 0%, #f1f1f1 100%);
    aspect-ratio: 1 / 1;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.pb-gallery__image-frame img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.35s ease, filter 0.3s ease;
}

.pb-gallery__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    background: rgba(12, 15, 22, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.pb-gallery__overlay-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.pb-gallery__overlay-icon svg {
    width: 33px;
    height: 33px;
    display: block;
}

.pb-gallery__overlay-title {
    margin: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    word-break: keep-all;
    text-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.pb-gallery__card:hover .pb-gallery__image-frame img,
.pb-gallery__card:focus-visible .pb-gallery__image-frame img {
    transform: scale(1.04);
    filter: brightness(0.76);
}

.pb-gallery__card:hover .pb-gallery__overlay,
.pb-gallery__card:focus-visible .pb-gallery__overlay {
    opacity: 1;
}

.pb-gallery__card:focus-visible {
    outline: 0;
}

.pb-gallery__card:focus-visible .pb-gallery__image-frame {
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.18), 0 16px 36px rgba(15, 23, 42, 0.08);
}

.pb-gallery__empty,
.pb-gallery__message {
    border-radius: 24px;
    background: #f8f8f8;
    padding: 28px 30px;
    color: #333;
}

.pb-gallery__empty[hidden] {
    display: none !important;
}

.pb-gallery__message strong,
.pb-gallery__empty {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.pb-gallery__message p {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.6;
}

.pb-modal[hidden] {
    display: none;
}

.pb-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.pb-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 15, 22, 0.82);
}

.pb-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 40px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pb-modal__viewer {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 88px 0 120px;
}

.pb-modal__image {
    max-width: 100%;
    max-height: calc(100vh - 208px);
    display: block;
    object-fit: contain;
    border-radius: 28px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
    background: #fff;
}

.pb-modal__nav,
.pb-modal__close {
    position: absolute;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    backdrop-filter: blur(12px);
    transition: opacity 0.2s ease, background 0.2s ease;
}

.pb-modal__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 58px;
    height: 58px;
    border-radius: 999px;
    font-size: 28px;
    font-weight: 400;
    z-index: 4;
    pointer-events: auto;
}

.pb-modal__nav:hover,
.pb-modal__close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.pb-modal__nav:disabled {
    opacity: 0.25;
    cursor: default;
}

.pb-modal__nav--prev {
    left: 0;
}

.pb-modal__nav--next {
    right: 0;
}

.pb-modal__close {
    top: 28px;
    right: 0;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    z-index: 4;
    pointer-events: auto;
}

.pb-modal__close span {
    position: absolute;
    width: 20px;
    height: 2px;
    background: currentColor;
}

.pb-modal__close span:first-child {
    transform: rotate(45deg);
}

.pb-modal__close span:last-child {
    transform: rotate(-45deg);
}

.pb-modal__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    color: #fff;
}

.pb-modal__caption strong {
    display: none;
}

.pb-modal__counter {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0.86;
    display: none;
}

html.pb-modal-open,
body.pb-modal-open {
    overflow: hidden;
}

@media (max-width: 991px) {
    .pb-gallery {
        padding: 42px 16px 64px;
    }

    .pb-gallery__grid {
        gap: 18px;
    }

    .pb-modal__dialog {
        width: min(100%, calc(100% - 24px));
    }

    .pb-modal__nav {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 767px) {
    .pb-gallery__tabs {
        gap: 10px;
        margin-bottom: 22px;
    }

    .pb-gallery__tab {
        padding: 11px 18px;
        font-size: 14px;
    }

    .pb-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .pb-gallery__image-frame {
        border-radius: 18px;
    }

    .pb-gallery__overlay {
        gap: 10px;
        padding: 18px;
    }

    .pb-gallery__overlay-icon svg {
        width: 27px;
        height: 27px;
    }

    .pb-gallery__overlay-title {
        font-size: 14px;
    }

    .pb-modal__viewer {
        padding: 84px 0 116px;
    }

    .pb-modal__image {
        max-height: calc(100vh - 240px);
        border-radius: 20px;
    }

    .pb-modal__nav {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .pb-modal__nav--prev {
        left: 4px;
    }

    .pb-modal__nav--next {
        right: 4px;
    }

    .pb-modal__close {
        top: 18px;
        right: 4px;
        width: 46px;
        height: 46px;
    }

    .pb-modal__caption {
        bottom: 22px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .pb-modal__caption strong {
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pb-gallery__card {
        transition: none;
    }
}

#container_title {display: none !important;}
