:root{--ecoco-sg-accent:#D7261E;--ecoco-sg-cols:3}
html.ecoco-sg-lock{overflow:hidden}
.ecoco-sg[hidden]{display:none}
.ecoco-sg{position:fixed;inset:0;z-index:999999;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.55);font-family:inherit}
.ecoco-sg__panel{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 320px;width:min(1200px,94vw);height:min(860px,92vh);background:#fff;border-radius:8px;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.35);outline:none}
.ecoco-sg__close{position:absolute;top:8px;right:10px;z-index:3;width:36px;height:36px;border:0;border-radius:50%;background:rgba(0,0,0,.06);color:#222;font-size:26px;line-height:34px;cursor:pointer;padding:0}
.ecoco-sg__close:hover{background:rgba(0,0,0,.14)}
.ecoco-sg__stage{position:relative;display:flex;align-items:center;justify-content:center;background:#fff;min-height:0;min-width:0}
.ecoco-sg__img{max-width:100%;max-height:100%;object-fit:contain;opacity:0;transition:opacity .2s}
.ecoco-sg__img.is-ready{opacity:1}
.ecoco-sg__nav{position:absolute;top:50%;transform:translateY(-50%);width:40px;height:80px;border:0;background:rgba(0,0,0,.4);color:#fff;font-size:38px;line-height:76px;cursor:pointer;padding:0;transition:background .15s}
.ecoco-sg__nav:hover{background:rgba(0,0,0,.65)}
.ecoco-sg__nav[hidden]{display:none}
.ecoco-sg__nav--prev{left:12px}
.ecoco-sg__nav--next{right:12px}
.ecoco-sg__count{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);padding:4px 12px;border-radius:999px;background:rgba(0,0,0,.55);color:#fff;font-size:13px}
.ecoco-sg__side{display:flex;flex-direction:column;gap:16px;padding:22px 20px;overflow:auto;min-height:0}
.ecoco-sg__title{padding-right:36px;font-size:16px;line-height:1.4;font-weight:500;color:#222;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ecoco-sg__thumbs{display:grid;grid-template-columns:repeat(var(--ecoco-sg-cols),1fr);gap:8px}
.ecoco-sg__thumb{position:relative;aspect-ratio:1;padding:0;border:2px solid transparent;border-radius:2px;background:#f4f4f2;cursor:pointer;overflow:hidden}
.ecoco-sg__thumb img{width:100%;height:100%;object-fit:cover;display:block}
.ecoco-sg__thumb:hover{border-color:rgba(0,0,0,.25)}
.ecoco-sg__thumb.is-active{border-color:var(--ecoco-sg-accent)}
.ecoco-sg__thumb:focus-visible,.ecoco-sg__nav:focus-visible,.ecoco-sg__close:focus-visible{outline:2px solid var(--ecoco-sg-accent);outline-offset:2px}
@media (max-width:767px){
 .ecoco-sg{align-items:stretch}
 .ecoco-sg__panel{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;width:100vw;height:100dvh;border-radius:0}
 .ecoco-sg__side{padding:12px;gap:8px}
 .ecoco-sg__title{font-size:14px;padding-right:44px}
 .ecoco-sg__thumbs{display:flex;overflow-x:auto;gap:8px;padding-bottom:4px}
 .ecoco-sg__thumb{flex:0 0 64px}
 .ecoco-sg__nav{width:32px;height:64px;font-size:30px;line-height:60px}
 .ecoco-sg__close{background:rgba(255,255,255,.85)}
}
@media (prefers-reduced-motion:reduce){.ecoco-sg__img{transition:none}}
/* ---- Video ---- */
.ecoco-sg__player{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#000}
.ecoco-sg__player[hidden],.ecoco-sg__img[hidden]{display:none}
.ecoco-sg__player video,.ecoco-sg__player iframe{width:100%;height:100%;border:0;background:#000;object-fit:contain}
.ecoco-sg__stage.is-video .ecoco-sg__count{display:none}
.ecoco-sg__stage.is-video .ecoco-sg__nav{top:40%}
.ecoco-sg__thumb.is-video::after{content:"";position:absolute;inset:0;background:rgba(0,0,0,.25)}
.ecoco-sg__play{position:absolute;left:50%;top:50%;z-index:1;width:30px;height:30px;margin:-15px 0 0 -15px;border-radius:50%;background:rgba(255,255,255,.92)}
.ecoco-sg__play::before{content:"";position:absolute;left:11px;top:8px;border-style:solid;border-width:7px 0 7px 11px;border-color:transparent transparent transparent #222}
.ecoco-sg__dur{position:absolute;right:0;bottom:0;z-index:1;padding:2px 6px;background:rgba(0,0,0,.65);color:#fff;font-size:11px;line-height:1.3}
.ecoco-sg-videobtn{position:absolute;left:12px;bottom:12px;z-index:20;display:inline-flex;align-items:center;gap:8px;padding:8px 14px 8px 10px;border:0;border-radius:999px;background:rgba(0,0,0,.7);color:#fff;font-size:13px;font-weight:600;line-height:1;cursor:pointer}
.ecoco-sg-videobtn:hover{background:var(--ecoco-sg-accent)}
.ecoco-sg-videobtn__icon{position:relative;width:22px;height:22px;border-radius:50%;background:#fff}
.ecoco-sg-videobtn__icon::before{content:"";position:absolute;left:8px;top:6px;border-style:solid;border-width:5px 0 5px 8px;border-color:transparent transparent transparent #222}
