/* ==========================================================================
   WC Vertical Gallery for Elementor — vertical-gallery.css
   ========================================================================== */

/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
    --vg-thumb-gap:           10px;
    --vg-thumb-border-width:  2px;
    --vg-thumb-active-color:  #0071a1;
    --vg-thumb-radius:        6px;
    --vg-main-radius:         8px;
    --vg-transition-speed:    0.35s;
    --vg-zoom-scale:          1.12;
    --vg-zoom-icon-bg:        rgba(0, 0, 0, 0.45);
    --vg-shadow:              0 2px 12px rgba(0, 0, 0, 0.12);
}

/* ── Base container ─────────────────────────────────────────────────────── */
.vg-container {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
}

/* Thumbnails on the LEFT (default) */
.vg-thumbs-left {
    flex-direction: row;
}

/* Thumbnails on the RIGHT */
.vg-thumbs-right {
    flex-direction: row-reverse;
}

/* ── Thumbnail column ────────────────────────────────────────────────────── */
.vg-thumbnails {
    display: flex;
    flex-direction: column;
    gap: var(--vg-thumb-gap);
    width: 90px;
    min-width: 90px;
    flex-shrink: 0;
}

.vg-thumb {
    position: relative;
    cursor: pointer;
    border-radius: var(--vg-thumb-radius);
    border: var(--vg-thumb-border-width) solid transparent;
    overflow: hidden;
    line-height: 0;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--vg-shadow);
}

.vg-thumb img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--vg-thumb-radius);
    transition: transform 0.25s ease;
}

.vg-thumb:hover {
    border-color: var(--vg-thumb-active-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.vg-thumb:hover img {
    transform: scale(1.06);
}

.vg-thumb.active {
    border-color: var(--vg-thumb-active-color);
    box-shadow: 0 0 0 3px rgba(0, 113, 161, 0.25);
}

.vg-thumb:focus-visible {
    outline: 3px solid var(--vg-thumb-active-color);
    outline-offset: 2px;
}

/* ── Main image area ─────────────────────────────────────────────────────── */
.vg-main-image {
    flex: 1;
    min-width: 0;
    border-radius: var(--vg-main-radius);
    overflow: hidden;
}

.vg-main-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--vg-main-radius);
    box-shadow: var(--vg-shadow);
    cursor: default;
    background: #f8f8f8;
    line-height: 0;
}

.vg-active-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--vg-main-radius);

    /* Smooth fade when src changes */
    transition:
        opacity var(--vg-transition-speed) ease,
        transform 0.45s ease;
}

/* Fade-out state (applied by JS during image switch) */
.vg-active-image.vg-fading {
    opacity: 0;
    transform: scale(0.98);
}

/* ── Hover Zoom on main image ─────────────────────────────────────────────
   The clipping is handled by overflow:hidden on .vg-main-image-wrapper.
   Only applies when the widget has the vg-has-hover-zoom class.
   ────────────────────────────────────────────────────────────────────────── */
.vg-has-hover-zoom .vg-main-image-wrapper:hover .vg-active-image {
    transform: scale(var(--vg-zoom-scale));
    transition:
        opacity var(--vg-transition-speed) ease,
        transform 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Don't zoom during fade transition */
.vg-has-hover-zoom .vg-main-image-wrapper:hover .vg-active-image.vg-fading {
    transform: scale(0.98);
}

/* ── Zoom icon overlay ───────────────────────────────────────────────────── */
.vg-zoom-icon {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--vg-zoom-icon-bg);
    color: #fff;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.vg-main-image-wrapper:hover .vg-zoom-icon {
    opacity: 1;
    transform: scale(1);
}

/* ── Placeholder (editor mode) ────────────────────────────────────────────── */
.vg-placeholder {
    padding: 24px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 8px;
    text-align: center;
    color: #777;
    font-size: 14px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .vg-container,
    .vg-thumbs-left,
    .vg-thumbs-right {
        flex-direction: column;
    }

    .vg-thumbnails {
        flex-direction: row;
        width: 100%;
        min-width: unset;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: thin;
    }

    .vg-thumb {
        min-width: 70px;
        width: 70px;
        flex-shrink: 0;
    }
}
