/* ── Carousel ──────────────────────────────────────────────────────────── */
.sg-gallery {
    position: relative;
    width: 100%;
    max-width: 860px;
    margin: 1.5em auto;
    user-select: none;
}

.sg-carousel {
    position: relative;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.sg-slide {
    display: none;
    width: 100%;
    height: 100%;
}
.sg-slide.sg-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sg-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    display: block;
}

/* ── Prev / Next arrows on carousel ───────────────────────────────────── */
.sg-prev, .sg-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.45);
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background .15s;
    z-index: 2;
}
.sg-prev:hover, .sg-next:hover { background: rgba(0,0,0,.75); }
.sg-prev { left: 8px; }
.sg-next { right: 8px; }
.sg-prev.sg-hidden, .sg-next.sg-hidden { display: none; }

/* ── Counter + caption bar ─────────────────────────────────────────────── */
.sg-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    gap: 8px;
}

.sg-counter {
    font-size: .8em;
    color: #6c757d;
    white-space: nowrap;
    flex-shrink: 0;
}

.sg-caption-bar {
    font-size: .88em;
    color: #333;
    text-align: center;
    flex: 1;
    min-height: 1.2em;
}

/* ── Dot strip ─────────────────────────────────────────────────────────── */
.sg-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 2px;
    flex-wrap: wrap;
}
.sg-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.sg-dot.sg-dot-active {
    background: #0d6efd;
    transform: scale(1.3);
}

/* ── Lightbox ──────────────────────────────────────────────────────────── */
.sg-lb {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.94);
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.sg-lb.sg-lb-open { display: flex; }

.sg-lb-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

.sg-lb img {
    max-width: calc(100vw - 120px);
    max-height: calc(100vh - 120px);
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 4px 40px rgba(0,0,0,.7);
    transition: opacity .15s;
    display: block;
}
.sg-lb img.sg-lb-loading { opacity: .2; }

.sg-lb-caption {
    color: #ccc;
    font-size: .9em;
    padding: 10px 20px;
    text-align: center;
    min-height: 2em;
    max-width: 80vw;
}

.sg-lb-close {
    position: absolute;
    top: 14px; right: 18px;
    background: none; border: none;
    color: #fff; font-size: 2.4em;
    line-height: 1; cursor: pointer;
    opacity: .7; padding: 0;
    z-index: 2;
}
.sg-lb-close:hover { opacity: 1; }

.sg-lb-counter {
    position: absolute;
    top: 16px; left: 18px;
    color: rgba(255,255,255,.5);
    font-size: .82em;
    z-index: 2;
}

.sg-lb-prev, .sg-lb-next {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,.35); border: none;
    color: #fff; font-size: 2.6em;
    padding: 8px 16px; border-radius: 4px;
    cursor: pointer; opacity: .65;
    transition: opacity .15s; line-height: 1;
    z-index: 2;
}
.sg-lb-prev:hover, .sg-lb-next:hover { opacity: 1; }
.sg-lb-prev { left: 10px; }
.sg-lb-next { right: 10px; }