/* =============================================
   NC Product Gallery Widget
   Base structural styles.
   Visual overrides come from Elementor style
   controls via inline CSS on the wrapper.
   ============================================= */

/* Wrapper */
.nc-gallery-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;        /* overridden by thumb_spacing control */
    width: 100%;
}

/* ── Main Image ─────────────────────────── */
.nc-gallery-main {
    width: 100%;
    background-color: #f7f5f0;  /* overridden by main_bg_color control */
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;        /* overridden by main_aspect_ratio control */
    display: flex;
    align-items: center;
    justify-content: center;
}

.nc-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;        /* overridden by main_object_fit control */
    display: block;
}

/* Fade transition — JS toggles opacity */
.nc-gallery-main-img.nc-gallery-fade {
    transition: opacity 0.18s ease;
}

/* ── Thumbnail Strip ────────────────────── */
.nc-gallery-thumbs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;                  /* overridden by thumb_gap control */
}

/* Individual thumbnail button */
.nc-gallery-thumb {
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
    background-color: #f7f5f0; /* overridden by thumb_bg_color control */
    overflow: hidden;
    width: 80px;                /* overridden by thumb_size control */
    height: 80px;               /* overridden by thumb_size control */
    flex-shrink: 0;
    transition: border-color 0.15s ease, opacity 0.15s ease;
    display: block;
}

.nc-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;          /* overridden by thumb_object_fit control */
    display: block;
}

/* Active state */
.nc-gallery-thumb.is-active {
    border-color: #e63946;      /* overridden by thumb_active_border_color control */
    opacity: 1 !important;
}

/* Inactive state */
.nc-gallery-thumb:not(.is-active) {
    opacity: 0.65;              /* overridden by thumb_opacity_inactive control */
}

/* Hover — always fully visible */
.nc-gallery-thumb:hover {
    opacity: 1;
    border-color: #aaaaaa;
}

/* Focus ring — keyboard accessibility */
.nc-gallery-thumb:focus-visible {
    outline: 2px solid #e63946;
    outline-offset: 2px;
}

/* ── Responsive ─────────────────────────── */
@media (max-width: 480px) {
    .nc-gallery-thumb {
        width: 60px;
        height: 60px;
    }
}

/* ── Autoplay Progress Bar ──────────────── */
.nc-gallery-progress {
    width: 100%;
    height: 3px;               /* overridden by progress_bar_height control */
    background-color: #e0ddd8; /* overridden by progress_bar_bg_color control */
    border-radius: 99px;
    overflow: hidden;
    /* sits between main image and thumbnails;
       margin is driven by the wrap gap already */
}

.nc-gallery-progress-fill {
    height: 100%;
    width: 0%;
    background-color: #e63946; /* overridden by progress_bar_color control */
    border-radius: 99px;
    /* transition injected by JS so duration matches the interval setting */
}
