/**
 * Galería carrusel del detalle — imagen principal a pantalla completa (object-fit: cover)
 */

.apis-detail-gallery-carousel
{
    --apis-gallery-stage-height: min(62vh, 560px);
    --apis-gallery-stage-bg: #e2e8f0;
    --apis-gallery-thumb-size: 72px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
}

.apis-detail-gallery-carousel__stage
{
    position: relative;
    background: var(--apis-gallery-stage-bg);
    min-height: var(--apis-gallery-stage-height);
    height: var(--apis-gallery-stage-height);
}

.apis-detail-gallery-carousel__viewport
{
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: none;
}

.apis-detail-gallery-carousel__viewport:focus-visible
{
    box-shadow: inset 0 0 0 3px rgba(15, 118, 110, 0.55);
}

.apis-detail-gallery-carousel__track
{
    display: flex;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.apis-detail-gallery-slide
{
    flex: 0 0 100%;
    min-width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

.apis-detail-gallery-slide__trigger
{
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: var(--apis-gallery-stage-bg);
    cursor: zoom-in;
    overflow: hidden;
}

.apis-detail-gallery-slide__img
{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.apis-detail-gallery-slide__trigger:hover .apis-detail-gallery-slide__img
{
    transform: scale(1.03);
}

.apis-detail-gallery-nav
{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    font-size: 1.35rem;
    line-height: 1;
}

.apis-detail-gallery-nav:hover
{
    background: #fff;
    transform: translateY(-50%) scale(1.04);
}

.apis-detail-gallery-nav--prev
{
    left: 14px;
}

.apis-detail-gallery-nav--next
{
    right: 14px;
}

.apis-detail-gallery-carousel__chrome
{
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 10px;
}

.apis-detail-gallery-counter
{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    backdrop-filter: blur(6px);
}

.apis-detail-gallery-fullscreen
{
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background 0.2s ease, transform 0.2s ease;
    font-size: 1.05rem;
}

.apis-detail-gallery-fullscreen:hover
{
    background: rgba(15, 23, 42, 0.9);
    transform: scale(1.05);
}

.apis-detail-gallery-thumbs
{
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.apis-detail-gallery-thumbs::-webkit-scrollbar
{
    height: 6px;
}

.apis-detail-gallery-thumbs::-webkit-scrollbar-thumb
{
    background: #cbd5e1;
    border-radius: 3px;
}

.apis-detail-gallery-thumb
{
    flex: 0 0 auto;
    width: calc(var(--apis-gallery-thumb-size) * 1.35);
    height: var(--apis-gallery-thumb-size);
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #e2e8f0;
    opacity: 0.72;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    scroll-snap-align: start;
}

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

.apis-detail-gallery-thumb:hover
{
    opacity: 1;
}

.apis-detail-gallery-thumb.is-active
{
    opacity: 1;
    border-color: #0f766e;
    transform: translateY(-2px);
}

.apis-property-detail-showcase .apis-detail-gallery-carousel
{
    border-radius: 0;
    margin-bottom: 1.5rem;
    --apis-gallery-stage-bg: #cbd5e1;
}

/* Visor a pantalla completa (sin Lightbox2 ni descargas) */
.apis-property-lightbox
{
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(6px);
}

.apis-property-lightbox[hidden]
{
    display: none !important;
}

body.apis-property-lightbox-open
{
    overflow: hidden;
}

.apis-property-lightbox__content
{
    position: relative;
    max-width: min(94vw, 1400px);
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 56px;
}

.apis-property-lightbox__img
{
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.apis-property-lightbox__counter
{
    position: absolute;
    bottom: -34px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.apis-property-lightbox__close,
.apis-property-lightbox__nav
{
    position: absolute;
    z-index: 2;
    border: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    font-size: 1.35rem;
    line-height: 1;
}

.apis-property-lightbox__close:hover,
.apis-property-lightbox__nav:hover
{
    background: rgba(255, 255, 255, 0.28);
}

.apis-property-lightbox__close
{
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
}

.apis-property-lightbox__nav
{
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
}

.apis-property-lightbox__nav--prev
{
    left: 16px;
}

.apis-property-lightbox__nav--next
{
    right: 16px;
}

@media (max-width: 768px)
{
    .apis-detail-gallery-carousel
    {
        --apis-gallery-stage-height: min(48vh, 400px);
        --apis-gallery-thumb-size: 60px;
        border-radius: 0;
    }

    .apis-detail-gallery-nav
    {
        width: 40px;
        height: 40px;
    }

    .apis-detail-gallery-nav--prev
    {
        left: 8px;
    }

    .apis-detail-gallery-nav--next
    {
        right: 8px;
    }

    .apis-detail-gallery-carousel__chrome
    {
        right: 8px;
        bottom: 8px;
    }

    .apis-property-lightbox__content
    {
        padding: 0 12px;
        max-width: 100vw;
    }

    .apis-property-lightbox__nav--prev
    {
        left: 8px;
    }

    .apis-property-lightbox__nav--next
    {
        right: 8px;
    }
}
