/* CO Product Gallery Widget */

/* ── Single image ─────────────────────────────────────────────────────────── */

.co-gallery--single {
    margin: 0;
}

.co-gallery--single img {
    display: block;
    width: 100%;
    height: auto;
}

/* ── Multi-image gallery ──────────────────────────────────────────────────── */

.co-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Main viewer */
.co-gallery__main {
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.co-gallery__main-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 600px; /* overridden by Elementor slider control */
    object-fit: contain;
    cursor: zoom-in;
    transition: opacity 0.15s ease;
}

.co-gallery__main-img.is-loading {
    opacity: 0.5;
}

/* Thumbnail strip */
.co-gallery__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* overridden by Elementor slider control */
    list-style: none;
    margin: 0;
    padding: 0;
}

.co-gallery__thumb {
    flex-shrink: 0;
    width: 80px;  /* overridden by Elementor slider control */
    height: 80px; /* overridden by Elementor slider control */
    padding: 0;
    border: 2px solid transparent;
    border-radius: 2px;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
    transition: border-color 0.15s ease, opacity 0.15s ease;
}

.co-gallery__thumb:hover {
    opacity: 0.85;
}

.co-gallery__thumb.is-active {
    border-color: #1B4D5C; /* overridden by Elementor color control */
}

.co-gallery__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */

.co-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.co-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.co-lightbox__img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
}

.co-lightbox__img {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    user-select: none;
}

/* Nav buttons */
.co-lightbox__prev,
.co-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    z-index: 1;
}

.co-lightbox__prev { left: 16px; }
.co-lightbox__next { right: 16px; }

.co-lightbox__prev:hover,
.co-lightbox__next:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Close button */
.co-lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    z-index: 1;
}

.co-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Counter */
.co-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-family: inherit;
    pointer-events: none;
    white-space: nowrap;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .co-lightbox__prev { left: 8px; }
    .co-lightbox__next { right: 8px; }
}
