#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden; -webkit-transform: translate3d(0,0,0);}
#cboxWrapper {max-width:none;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
#cboxTitle{margin:0;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}

/*
    Poliglotiki theme — брендовый зелёный вместо спрайтов controls.png / border.png
*/
:root {
    --pg-brand: #5ab947;
    --pg-brand-dark: #4a9c3a;
}

#cboxOverlay {
    background: #000;
    opacity: 0.85;
}

#colorbox {
    outline: 0;
}

/* Рамка теперь — обычный CSS border на самом контенте, а не 8 спрайтовых кусков */
#cboxWrapper {
    border-radius: 4px;
}
    #cboxTopLeft, #cboxTopRight, #cboxBottomLeft, #cboxBottomRight,
    #cboxMiddleLeft, #cboxMiddleRight, #cboxTopCenter, #cboxBottomCenter {
        background: none; /* убираем все спрайты controls.png/border.png */
    }
    #cboxTopLeft{width:0; height:0;}
    #cboxTopRight{width:0; height:0;}
    #cboxBottomLeft{width:0; height:0;}
    #cboxBottomRight{width:0; height:0;}
    #cboxMiddleLeft{width:0;}
    #cboxMiddleRight{width:0;}
    #cboxTopCenter{height:0;}
    #cboxBottomCenter{height:0;}

    #cboxContent {
        background: #fff;
        border: 4px solid var(--pg-brand);
        border-radius: 25px;
        overflow: hidden;
    }
        .cboxIframe{background:#fff;}
        #cboxError{padding:50px; border:1px solid #ccc;}
        #cboxLoadedContent{margin-bottom:0px;}
        #cboxTitle{position:absolute; bottom:12px; left:0; text-align:center; width:100%; color:#666;}
        #cboxCurrent{position:absolute; bottom:12px; left:48px; color:#5ab947; font-size:15px;}

        #cboxLoadingOverlay{background:#fff;}
        #cboxLoadingGraphic{
            background: none;
            border: 3px solid #eee;
            border-top-color: var(--pg-brand);
            border-radius: 50%;
            width: 32px;
            height: 32px;
            margin: auto;
            animation: pg-spin 0.8s linear infinite;
        }
        @keyframes pg-spin {
            to { transform: rotate(360deg); }
        }

        /* Кнопки: сброс базовых стилей */
        #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {
            border: 0; padding: 0; margin: 0; overflow: visible;
            width: 32px; height: 32px;
            background: var(--pg-brand);
            border-radius: 50%;
            text-indent: -9999px;
            transition: background 0.15s ease;
        }
        #cboxPrevious:hover, #cboxNext:hover, #cboxSlideshow:hover, #cboxClose:hover {
            background: var(--pg-brand-dark);
        }
        #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {
            outline: 0;
        }

        #cboxPrevious, #cboxNext, #cboxClose { position: absolute; bottom: 8px; }
        #cboxPrevious { left: 8px; }
        #cboxNext { left: 100px; }
        #cboxClose { right: 8px; }
        #cboxSlideshow{ position:absolute; bottom:16px; right:56px; color: var(--pg-brand); text-indent: 0; background: none; width: auto; height: auto;}

        /* Стрелки и крестик — рисуем CSS-псевдоэлементами вместо спрайта */
        #cboxPrevious::after, #cboxNext::after, #cboxClose::before, #cboxClose::after {
            content: '';
            position: absolute;
            top: 50%; left: 50%;
        }
        #cboxPrevious::after {
            width: 8px; height: 8px;
            border-left: 2px solid #fff;
            border-bottom: 2px solid #fff;
            transform: translate(-30%, -50%) rotate(45deg);
        }
        #cboxNext::after {
            width: 8px; height: 8px;
            border-right: 2px solid #fff;
            border-top: 2px solid #fff;
            transform: translate(-70%, -50%) rotate(45deg);
        }
        #cboxClose::before, #cboxClose::after {
            width: 14px; height: 2px;
            background: #fff;
            transform-origin: center;
        }
        #cboxClose::before { transform: translate(-50%, -50%) rotate(45deg); }
        #cboxClose::after  { transform: translate(-50%, -50%) rotate(-45deg); }
