.epg-gallery{max-width:90%;margin-left:auto;margin-right:auto;--epg-thumb:80px;--epg-gap:12px;display:flex;gap:var(--epg-gap);width:100%;align-items:flex-start}
.epg-thumbs{display:flex;flex-direction:column;gap:var(--epg-gap);flex:0 0 var(--epg-thumb);width:var(--epg-thumb);overflow-y:auto;scrollbar-width:none}
.epg-thumbs::-webkit-scrollbar{display:none}
.epg-thumb{all:unset;box-sizing:border-box;display:block;flex:0 0 auto;width:var(--epg-thumb);height:var(--epg-thumb);overflow:hidden;cursor:pointer;border:1.5px solid #BE832E;border-radius:10px;opacity:.7;transition:opacity .2s,border-color .2s}
.epg-thumb:hover,.epg-thumb.is-active{opacity:1}
.epg-thumb img{display:block;width:100%;height:100%;object-fit:cover}

.epg-main{position:relative;flex:1 1 0;min-width:0;overflow:hidden;aspect-ratio:4/5;touch-action:pan-y;border:1.5px solid #BE832E;border-radius:10px}
.epg-track{display:flex;height:100%;transition:transform .45s cubic-bezier(.22,.61,.36,1);will-change:transform}
.epg-track.is-dragging{transition:none}
.epg-slide{flex:0 0 100%;height:100%}
.epg-slide img{display:block;width:100%;height:100%;object-fit:cover;user-select:none;-webkit-user-drag:none}
.epg-main[style*="aspect-ratio: auto"] .epg-slide img{height:auto}

.epg-gallery .epg-arrow{all:unset;box-sizing:border-box!important;position:absolute!important;top:50%;transform:translateY(-50%);width:38px;height:38px;display:flex!important;align-items:center;justify-content:center;padding:0!important;margin:0!important;border:0!important;border-radius:50%!important;background-color:#fff;color:#222;line-height:1;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.18);transition:background-color .2s,transform .15s;z-index:2;-webkit-appearance:none;appearance:none}
.epg-gallery .epg-arrow:hover,.epg-gallery .epg-arrow:focus{background-color:#f1f1f1;color:#222}
.epg-gallery .epg-arrow:active{transform:translateY(-50%) scale(.94)}
.epg-gallery .epg-arrow:focus-visible,.epg-gallery .epg-thumb:focus-visible{outline:2px solid #8b5a2b;outline-offset:2px}
/* CSS-drawn chevron (no SVG, so themes can't break it) */
.epg-gallery .epg-chev{display:block!important;width:9px!important;height:9px!important;border:solid currentColor!important;border-width:0 2px 2px 0!important;background:none!important;pointer-events:none}
.epg-gallery .epg-prev .epg-chev{transform:rotate(135deg);margin-left:4px!important}
.epg-gallery .epg-next .epg-chev{transform:rotate(-45deg);margin-right:4px!important}
.epg-prev{left:12px}.epg-next{right:12px}
.epg-main.has-lightbox{cursor:zoom-in}

/* Thumbnail position – desktop / tablet / mobile */
.epg-gallery.epg-d-left{flex-direction:row}
.epg-gallery.epg-d-right{flex-direction:row-reverse}
.epg-gallery.epg-d-bottom{flex-direction:column-reverse}
.epg-gallery.epg-d-left .epg-thumbs{flex-direction:column;flex:0 0 var(--epg-thumb);width:var(--epg-thumb);overflow-x:hidden;overflow-y:auto}
.epg-gallery.epg-d-left .epg-main{flex:1 1 0;width:auto}
.epg-gallery.epg-d-right .epg-thumbs{flex-direction:column;flex:0 0 var(--epg-thumb);width:var(--epg-thumb);overflow-x:hidden;overflow-y:auto}
.epg-gallery.epg-d-right .epg-main{flex:1 1 0;width:auto}
.epg-gallery.epg-d-bottom .epg-thumbs{flex-direction:row;flex:0 0 auto;width:100%;max-height:none!important;overflow-x:auto;overflow-y:hidden}
.epg-gallery.epg-d-bottom .epg-main{flex:0 0 auto;width:100%}
@media (max-width:1024px){
.epg-gallery{max-width:100%}
.epg-gallery.epg-t-left{flex-direction:row}
.epg-gallery.epg-t-right{flex-direction:row-reverse}
.epg-gallery.epg-t-bottom{flex-direction:column-reverse}
.epg-gallery.epg-t-left .epg-thumbs{flex-direction:column;flex:0 0 var(--epg-thumb);width:var(--epg-thumb);overflow-x:hidden;overflow-y:auto}
.epg-gallery.epg-t-left .epg-main{flex:1 1 0;width:auto}
.epg-gallery.epg-t-right .epg-thumbs{flex-direction:column;flex:0 0 var(--epg-thumb);width:var(--epg-thumb);overflow-x:hidden;overflow-y:auto}
.epg-gallery.epg-t-right .epg-main{flex:1 1 0;width:auto}
.epg-gallery.epg-t-bottom .epg-thumbs{flex-direction:row;flex:0 0 auto;width:100%;max-height:none!important;overflow-x:auto;overflow-y:hidden}
.epg-gallery.epg-t-bottom .epg-main{flex:0 0 auto;width:100%}
}
@media (max-width:767px){
.epg-gallery.epg-m-left{flex-direction:row}
.epg-gallery.epg-m-right{flex-direction:row-reverse}
.epg-gallery.epg-m-bottom{flex-direction:column-reverse}
.epg-gallery.epg-m-left .epg-thumbs{flex-direction:column;flex:0 0 var(--epg-thumb);width:var(--epg-thumb);overflow-x:hidden;overflow-y:auto}
.epg-gallery.epg-m-left .epg-main{flex:1 1 0;width:auto}
.epg-gallery.epg-m-right .epg-thumbs{flex-direction:column;flex:0 0 var(--epg-thumb);width:var(--epg-thumb);overflow-x:hidden;overflow-y:auto}
.epg-gallery.epg-m-right .epg-main{flex:1 1 0;width:auto}
.epg-gallery.epg-m-bottom .epg-thumbs{flex-direction:row;flex:0 0 auto;width:100%;max-height:none!important;overflow-x:auto;overflow-y:hidden}
.epg-gallery.epg-m-bottom .epg-main{flex:0 0 auto;width:100%}
}
