/* =============================================================================
   Buyin Lightbox Gallery Widget — lightbox-gallery.css
   ============================================================================= */

/* ── Thumbnail Grid ──────────────────────────────────────────────────────── */

.elementor-widget-buyin_lightbox_gallery,
.elementor-widget-buyin_lightbox_gallery .elementor-widget-container {
    width: 100%;
}

.buyin-lightbox-gallery {
    display: grid;
    grid-template-columns: repeat( var(--blg-cols, 3), 1fr );
    gap: var(--blg-gap, 12px);
    isolation: isolate;
    width: 100%;
}

/* Each thumbnail is a <button> that resets all button defaults */
.blg-thumb {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: var(--blg-ratio, 4/3);
    min-height: 0;
    /* Subtle border — lifts on hover */
    outline: 2px solid transparent;
    outline-offset: 0px;
    transition: outline-color 0.25s ease, transform 0.3s cubic-bezier(0.23,1,0.32,1);
}

.blg-thumb:hover {
    outline-color: #e63946;
    transform: translateY(-3px);
}

.blg-thumb:focus-visible {
    outline-color: #d4a843;
    outline-width: 3px;
}

/* Image fills the entire button */
.blg-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s cubic-bezier(0.23,1,0.32,1);
}

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

/* Hover overlay */
.blg-thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 18px 16px 16px;
    background: linear-gradient(to top, rgba(5,5,5,0.88) 0%, rgba(5,5,5,0.1) 60%, transparent 100%);
    opacity: 1;
}

/* Tag pill */
.blg-tag {
    display: inline-block;
    background: #e63946;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: 9999px;
    margin-bottom: 6px;
    line-height: 1.5;
}

/* Caption */
.blg-caption {
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    text-align: left;
}

/* Zoom icon — top-right corner */
.blg-zoom-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.2s ease;
}

.blg-thumb:hover .blg-zoom-icon {
    background: #e63946;
}

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

@media (max-width: 1024px) {
    .buyin-lightbox-gallery {
        grid-template-columns: repeat( 2, 1fr );
    }
}

@media (max-width: 600px) {
    .buyin-lightbox-gallery {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 0 16px;
    }

    .blg-caption { font-size: 0.78rem; }
}

@media (max-width: 420px) {
    .buyin-lightbox-gallery {
        grid-template-columns: 1fr;
    }
}


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

.blg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Hidden by default — JS adds .blg-lightbox--open */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.blg-lightbox--open {
    opacity: 1;
    pointer-events: auto;
}

/* Dark backdrop */
.blg-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 3, 6, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    cursor: zoom-out;
}

/* Content wrapper — sits above backdrop */
.blg-lb-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    padding: 0 72px;          /* space for arrows */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Image frame */
.blg-lb-frame {
    position: relative;
    width: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
}

.blg-lb-img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    /* Entrance animation */
    animation: blgImgIn 0.3s cubic-bezier(0.23,1,0.32,1) both;
    box-shadow: 0 32px 80px rgba(0,0,0,0.7);
}

@keyframes blgImgIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

/* Caption bar below image */
.blg-lb-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 32px;
}

.blg-lb-tag {
    background: #e63946;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 12px;
    border-radius: 9999px;
    white-space: nowrap;
}

.blg-lb-caption {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin: 0;
}

/* Counter  e.g. "2 / 8" */
.blg-lb-counter {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    margin-left: auto;
    white-space: nowrap;
}

/* ── Arrow buttons ── */
.blg-lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(15,15,20,0.7);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(8px);
    z-index: 2;
}

.blg-lb-arrow:hover {
    background: #e63946;
    border-color: #e63946;
}

.blg-lb-arrow--prev { left: 0; }
.blg-lb-arrow--next { right: 0; }

.blg-lb-arrow:active { transform: translateY(-50%) scale(0.93); }

/* ── Close button ── */
.blg-lb-close {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(15,15,20,0.7);
    color: #fff;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
    backdrop-filter: blur(8px);
}

.blg-lb-close:hover {
    background: #e63946;
    border-color: #e63946;
}

/* ── Dot indicators ── */
.blg-lb-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 340px;
}

.blg-lb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
    flex-shrink: 0;
}

.blg-lb-dot--active {
    background: #e63946;
    transform: scale(1.4);
}

/* ── Thumbnail strip inside lightbox ── */
.blg-lb-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
    padding: 4px 2px;
}

.blg-lb-strip::-webkit-scrollbar       { height: 3px; }
.blg-lb-strip::-webkit-scrollbar-track { background: transparent; }
.blg-lb-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.blg-lb-strip-thumb {
    width: 64px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.5;
}

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

.blg-lb-strip-thumb--active {
    border-color: #e63946;
    opacity: 1;
}

/* ── Mobile lightbox ── */
@media (max-width: 768px) {
    .blg-lb-content {
        padding: 0 52px;
        gap: 14px;
    }

    .blg-lb-arrow {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .blg-lb-arrow--prev { left: 2px; }
    .blg-lb-arrow--next { right: 2px; }

    .blg-lb-strip-thumb {
        width: 52px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .blg-lb-content { padding: 0 44px; }

    .blg-lb-caption { font-size: 0.88rem; }

    .blg-lb-strip { display: none; } /* hide strip on very small screens — dots only */
}
