.et_pb_marquee_unique_wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 20px 0;
    cursor: grab;
    touch-action: pan-y;
}

.et_pb_marquee_unique_wrapper:active { cursor: grabbing; }
.et_pb_marquee_unique_container { display: flex; overflow: hidden; width: 100%; user-select: none; -webkit-user-select: none; }
.et_pb_marquee_unique_track { display: flex; white-space: nowrap; will-change: transform; }
.et_pb_marquee_unique_img { display: block; width: auto; max-width: none; flex-shrink: 0; cursor: pointer; -webkit-user-drag: none; }

.et_pb_marquee_unique_html_slide {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: auto;
    min-width: 150px;
    max-width: 500px;
}

.et_pb_marquee_unique_html_slide > * {
    max-height: 100% !important;
    max-width: 100% !important;
}

.bagon-custom-html-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
.bagon-custom-html-layer > * { pointer-events: auto; }

.bagon-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    width: 40px; height: 40px; background: rgba(0,0,0,0.5); color: #fff; font-size: 24px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    border-radius: 50%; transition: background 0.3s; user-select: none;
}
.bagon-arrow:hover { background: rgba(0,0,0,0.8); }
.bagon-arrow-left { left: 10px; }
.bagon-arrow-right { right: 10px; }

#bagon-lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 999999; display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
#bagon-lightbox.active { opacity: 1; pointer-events: auto; }

.bagon-lb-content { max-width: 90%; max-height: 75vh; position: relative; display: flex; align-items: center; justify-content: center; margin-bottom: 80px; }
.bagon-lb-content img, .bagon-lb-content video { max-width: 100%; max-height: 75vh; display: block; border-radius: 5px; }
.bagon-lb-close { position: absolute; top: -40px; right: 0; color: #fff; font-size: 30px; cursor: pointer; z-index: 10; }
.bagon-lb-prev, .bagon-lb-next { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 50px; cursor: pointer; padding: 20px; user-select: none; z-index: 10;}
.bagon-lb-prev { left: -80px; }
.bagon-lb-next { right: -80px; }

.bagon-lb-thumbnails {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    box-sizing: border-box;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.5);
}
.bagon-lb-thumbnails::-webkit-scrollbar { height: 6px; }
.bagon-lb-thumbnails::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); border-radius: 3px; }
.bagon-lb-thumbnails::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.5); border-radius: 3px; }

.bagon-lb-thumb {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.3s, transform 0.2s, border 0.3s;
    border: 2px solid transparent;
    flex-shrink: 0;
    position: relative;
    box-sizing: border-box;
}
.bagon-lb-thumb.active, .bagon-lb-thumb:hover {
    opacity: 1;
    border-color: #fff;
    transform: scale(1.05);
}
.bagon-lb-thumb img, .bagon-lb-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.bagon-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    pointer-events: none;
}

.bagon-slide-mobile-context {
    container-type: inline-size;
    container-name: bagon-item;
    overflow-y: hidden;
    overflow-x: hidden;
    padding: 0;
    display: block;
}

.bagon-slide-mobile-context * { 
    max-width: 100% !important; 
    box-sizing: border-box !important; 
}

div.bagon-slide-mobile-context .bagon-layer-pc,
div.bagon-slide-mobile-context .bagon-layer-tablet { 
    display: none !important; 
}

div.bagon-slide-mobile-context .bagon-layer-mobile {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    pointer-events: auto !important;
}

div.bagon-slide-mobile-context .bagon-layer-mobile .bagon-layer-btn,
div.bagon-slide-mobile-context .bagon-layer-mobile .bagon-layer-btn2,
div.bagon-slide-mobile-context .bagon-layer-mobile .bagon-layer-img,
div.bagon-slide-mobile-context .bagon-layer-mobile .bagon-layer-img2 {
    display: inline-block !important;
    pointer-events: auto !important;
}

/* Бейдж */
.bagon-slide-wrapper:hover .bagon-badge {
    opacity: 1 !important;
    pointer-events: auto !important;
}

@media (hover: none) and (pointer: coarse) {
    .bagon-slide-wrapper .bagon-badge {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

.bagon-badge {
    white-space: nowrap;
}

/* Бейдж в лайтбоксе */
.bagon-lb-media-wrapper {
    position: relative;
    display: inline-block;
}

.bagon-lb-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10;
}

@media (max-width: 768px) {
    .bagon-lb-prev { left: 0; }
    .bagon-lb-next { right: 0; }
    .bagon-lb-content { max-height: 65vh; margin-bottom: 100px; }
    .bagon-lb-content img, .bagon-lb-content video { max-height: 65vh; }
    .bagon-lb-thumbnails {
        justify-content: flex-start;
        padding-left: 10px;
        padding-right: 10px;
    }
}