

.wb-pimg {
    position: relative;
    display: flex;
    flex-direction: column;
}

.wb-pimg--left {
    flex-direction: row;
}

.wb-pimg--right {
    flex-direction: row;
}

.wb-pimg--left .wb-pimg__main,
.wb-pimg--right .wb-pimg__main {
    flex: 1;
    min-width: 0;
}

.wb-pimg__main {
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    line-height: 0;
    width: 100%;
}

.wb-pimg__main img {
    width: 100%;
    display: block;
    transition: opacity 0.3s ease;
}

.wb-pimg__zoom-lens {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-size: 200%;
    pointer-events: none;
    z-index: 2;
}

.wb-pimg__main.wb-pimg__main--zooming .wb-pimg__zoom-lens {
    display: block;
}

.wb-pimg__main.wb-pimg__main--zooming img {
    opacity: 0;
}

.wb-pimg__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    background: #8B1A2B;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    line-height: 1.4;
    pointer-events: none;
}

.wb-pimg__thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.wb-pimg--bottom .wb-pimg__thumbs {
    margin-top: 10px;
}

.wb-pimg--left .wb-pimg__thumbs {
    margin-right: 10px;
    grid-template-columns: 1fr;
    width: 80px;
    flex-shrink: 0;
    order: -1;
}

.wb-pimg--right .wb-pimg__thumbs {
    margin-left: 10px;
    grid-template-columns: 1fr;
    width: 80px;
    flex-shrink: 0;
}

.wb-pimg__thumb {
    cursor: pointer;
    overflow: hidden;
    opacity: 0.6;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    border: 2px solid transparent;
    border-radius: 4px;
    line-height: 0;
}

.wb-pimg__thumb img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.wb-pimg__thumb--active {
    opacity: 1;
    border-color: #8B1A2B;
}

.wb-pimg__thumb:hover {
    opacity: 0.9;
}

.wb-pimg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wb-pimg-lightbox__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
}

.wb-pimg-lightbox__img-wrap {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wb-pimg-lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.wb-pimg-lightbox__close,
.wb-pimg-lightbox__prev,
.wb-pimg-lightbox__next {
    position: absolute;
    z-index: 2;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    backdrop-filter: blur(6px);
    transition: background 0.2s ease;
    line-height: 1;
}

.wb-pimg-lightbox__close:hover,
.wb-pimg-lightbox__prev:hover,
.wb-pimg-lightbox__next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.wb-pimg-lightbox__close {
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wb-pimg-lightbox__prev,
.wb-pimg-lightbox__next {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wb-pimg-lightbox__prev {
    left: 16px;
}

.wb-pimg-lightbox__next {
    right: 16px;
}

.wb-pimg-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

@media (max-width: 767px) {

    .wb-pimg--left,
    .wb-pimg--right {
        flex-direction: column;
    }

    .wb-pimg--left .wb-pimg__thumbs,
    .wb-pimg--right .wb-pimg__thumbs {
        width: 100%;
        grid-template-columns: repeat(4, 1fr);
        margin: 10px 0 0;
        order: 1;
    }

    .wb-pimg--left .wb-pimg__main,
    .wb-pimg--right .wb-pimg__main {
        order: 0;
    }

    .wb-pimg__thumb img {
        height: 60px;
    }

    .wb-pimg-lightbox__close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .wb-pimg-lightbox__prev,
    .wb-pimg-lightbox__next {
        width: 38px;
        height: 38px;
        font-size: 24px;
    }

    .wb-pimg-lightbox__prev { left: 8px; }
    .wb-pimg-lightbox__next { right: 8px; }

    .wb-pimg-lightbox__counter {
        font-size: 12px;
        bottom: 12px;
    }

    .wb-pimg__badge {
        top: 8px;
        left: 8px;
        font-size: 11px;
        padding: 3px 8px;
    }
}

@media (max-width: 1024px) {
    .wb-pimg.wb-pimg--tablet-bottom {
        flex-direction: column;
    }
    .wb-pimg.wb-pimg--tablet-bottom .wb-pimg__thumbs {
        order: 0;
        margin: 10px 0 0 0;
        grid-template-columns: repeat(4, 1fr);
        width: auto;
    }

    .wb-pimg.wb-pimg--tablet-left {
        flex-direction: row;
    }
    .wb-pimg.wb-pimg--tablet-left .wb-pimg__thumbs {
        order: -1;
        margin: 0 10px 0 0;
        grid-template-columns: 1fr;
        width: 80px;
        flex-shrink: 0;
    }

    .wb-pimg.wb-pimg--tablet-right {
        flex-direction: row;
    }
    .wb-pimg.wb-pimg--tablet-right .wb-pimg__thumbs {
        order: 0;
        margin: 0 0 0 10px;
        grid-template-columns: 1fr;
        width: 80px;
        flex-shrink: 0;
    }
}

@media (max-width: 767px) {
    .wb-pimg.wb-pimg--mobile-bottom {
        flex-direction: column;
    }
    .wb-pimg.wb-pimg--mobile-bottom .wb-pimg__thumbs {
        order: 0;
        margin: 10px 0 0 0;
        grid-template-columns: repeat(4, 1fr);
        width: auto;
    }

    .wb-pimg.wb-pimg--mobile-left {
        flex-direction: row;
    }
    .wb-pimg.wb-pimg--mobile-left .wb-pimg__thumbs {
        order: -1;
        margin: 0 10px 0 0;
        grid-template-columns: 1fr;
        width: 80px;
        flex-shrink: 0;
    }

    .wb-pimg.wb-pimg--mobile-right {
        flex-direction: row;
    }
    .wb-pimg.wb-pimg--mobile-right .wb-pimg__thumbs {
        order: 0;
        margin: 0 0 0 10px;
        grid-template-columns: 1fr;
        width: 80px;
        flex-shrink: 0;
    }
}
