.with-fancybox {
    overflow: hidden;
}

.fancybox__container {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    color: #fff;
    outline: none;
}

.fancybox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 47, 23, 0.92);
}

.fancybox__carousel {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
}

.fancybox__viewport,
.fancybox__track,
.fancybox__slide {
    width: 100%;
    height: 100%;
}

.fancybox__track {
    display: flex;
}

.fancybox__slide {
    position: relative;
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 72px;
    overflow: auto;
}

.fancybox__content {
    max-width: 100%;
    max-height: 100%;
}

.fancybox__content img,
.fancybox__image {
    max-width: 100%;
    max-height: calc(100vh - 160px);
    object-fit: contain;
}

.fancybox__caption {
    position: absolute;
    right: 0;
    bottom: 18px;
    left: 0;
    padding: 0 24px;
    color: #fff;
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
}

.fancybox__toolbar {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carousel__button {
    position: relative;
    z-index: 21;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(11, 79, 37, 0.82);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.carousel__button.is-close,
.fancybox__content > .is-close {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 30;
}

.carousel__button:hover,
.carousel__button:focus {
    background: #349d48;
    border-color: rgba(255, 255, 255, 0.55);
    outline: none;
}

.carousel__button svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

.product-fancybox-close {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 100005;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(11, 79, 37, 0.96);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

body.product-fancybox-open .product-fancybox-close {
    display: flex;
}

.product-fancybox-close:hover,
.product-fancybox-close:focus {
    background: #349d48;
    outline: none;
}

.product-fancybox-close i {
    font-size: 20px;
    line-height: 1;
}

.fancybox__nav .carousel__button {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
}

.fancybox__nav .is-prev {
    left: 18px;
}

.fancybox__nav .is-next {
    right: 18px;
}

.fancybox__spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #75b943;
    border-radius: 50%;
    animation: fancybox-spin 0.8s linear infinite;
}

@keyframes fancybox-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 575px) {
    .fancybox__slide {
        padding: 68px 14px 70px;
    }

    .fancybox__toolbar {
        top: 10px;
        right: 10px;
        gap: 6px;
    }

    .carousel__button {
        width: 38px;
        height: 38px;
    }

    .product-fancybox-close {
        top: 10px;
        right: 10px;
        width: 42px;
        height: 42px;
    }
}
