/* ═══════════════════════════════════════════════════
   JE Carousel — Lightbox Gallery  v1.0
   ═══════════════════════════════════════════════════ */

/* ── Reset ── */
.jec-wrapper { position: relative; width: 100%; }
.jec-wrapper *, .jec-wrapper *::before, .jec-wrapper *::after { box-sizing: border-box; }

/* ═══════ CAROUSEL ═══════ */
.jec-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.jec-track {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
}

.jec-slide {
    flex: 0 0 auto;
    overflow: hidden;
    position: relative;
}

/* Ratio forzado (cuadrado por defecto) */
.jec-has-ratio .jec-slide {
    aspect-ratio: var(--jec-ratio, 1/1);
}

.jec-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    transition: transform .3s ease;
}

.jec-has-ratio .jec-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.jec-slide img:hover {
    transform: scale(1.02);
}

/* ── Equal height ── */
.jec-wrapper.jec-equal-h .jec-track {
    align-items: stretch;
}

.jec-wrapper.jec-equal-h .jec-slide {
    display: flex;
}

.jec-wrapper.jec-equal-h .jec-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ═══════ ARROWS ═══════ */
.jec-wrapper .jec-arrow,
button.jec-arrow,
.elementor-widget-jecarousel .jec-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    border: none;
    background-color: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .25s ease, opacity .25s ease;
    line-height: 0;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    box-shadow: none;
}

.jec-wrapper .jec-arrow:hover,
.jec-wrapper .jec-arrow:focus,
.jec-wrapper .jec-arrow:active,
button.jec-arrow:hover,
button.jec-arrow:focus,
button.jec-arrow:active,
.elementor-widget-jecarousel .jec-arrow:hover,
.elementor-widget-jecarousel .jec-arrow:focus,
.elementor-widget-jecarousel .jec-arrow:active {
    background-color: rgba(0,0,0,0.25);
    outline: none;
    box-shadow: none;
}

.jec-arrow img,
.jec-arrow svg {
    display: block;
    pointer-events: none;
}

.jec-prev { left: 12px; }
.jec-next { right: 12px; }

/* ═══════ DOTS ═══════ */
.jec-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 14px 0 4px;
}

.jec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.25);
    cursor: pointer;
    padding: 0;
    transition: background .25s ease, transform .25s ease;
}

.jec-dot.active {
    background: rgba(0,0,0,.7);
    transform: scale(1.25);
}

/* ═══════ THUMBNAILS ═══════ */
.jec-thumbnails {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0 0;
    flex-wrap: wrap;
}

.jec-thumb {
    width: var(--jec-thumb-size, 70px);
    height: var(--jec-thumb-size, 70px);
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: none;
    opacity: .55;
    transition: opacity .25s ease, border-color .25s ease;
    flex-shrink: 0;
}

.jec-thumb.active,
.jec-thumb:hover {
    opacity: 1;
    border-color: rgba(0,0,0,.5);
}

.jec-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ═══════ LIGHTBOX ═══════ */
.jec-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}

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

.jec-lightbox__overlay {
    position: absolute;
    inset: 0;
}

.jec-lightbox__content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 88vh;
}

.jec-lightbox__img {
    max-width: 92vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    transition: opacity .25s ease;
}

.jec-lightbox__img.loading {
    opacity: .3;
}

/* Lightbox arrows */
.jec-lightbox__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    border: none;
    background: transparent !important;
    border-radius: 4px;
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .25s ease;
    -webkit-appearance: none;
    appearance: none;
}

.jec-lightbox__arrow:hover,
.jec-lightbox__arrow:focus,
.jec-lightbox__arrow:active {
    background: rgba(0,0,0,0.25) !important;
}

.jec-lightbox__arrow img,
.jec-lightbox__arrow svg {
    width: 28px;
    height: auto;
    display: block;
    pointer-events: none;
}

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

/* Close */
.jec-lightbox__close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 3;
    border: none;
    background: rgba(0,0,0,.4) !important;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .25s ease;
    -webkit-appearance: none;
    appearance: none;
}

.jec-lightbox__close:hover,
.jec-lightbox__close:focus,
.jec-lightbox__close:active {
    background: rgba(0,0,0,.6) !important;
}

/* Counter */
.jec-lightbox__counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: #fff;
    font-size: 14px;
    background: rgba(0,0,0,.45);
    padding: 4px 14px;
    border-radius: 20px;
    pointer-events: none;
}

/* ═══════ TOUCH FEEDBACK ═══════ */
.jec-track.dragging {
    transition: none !important;
    cursor: grabbing;
}

.jec-track { cursor: grab; }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 767px) {
    .jec-lightbox__arrow { padding: 8px; }
    .jec-lightbox__arrow img,
    .jec-lightbox__arrow svg { width: 20px; }
    .jec-lightbox__close { width: 38px; height: 38px; font-size: 22px; top: 10px; right: 10px; }
}
