/**
 * Blaszaki Product Gallery — Styles
 *
 * Design system: Outfit + DM Sans, #1A1A1A primary, #E5E7EB borders
 * Matches existing Blaszaki WooCommerce template.
 */

/* ═══════════════════════════════════════
   CSS Custom Properties
   ═══════════════════════════════════════ */
.bpg-gallery {
    --bpg-radius: 12px;
    --bpg-gap: 8px;
    --bpg-thumb-cols: 5;
    --bpg-thumb-size: 72px;
    --bpg-primary: #1A1A1A;
    --bpg-border: #E5E7EB;
    --bpg-bg: #F9FAFB;
    --bpg-nav-bg: rgba(255, 255, 255, 0.92);
    --bpg-badge-bg: #EF4444;
    --bpg-badge-color: #fff;
    --bpg-font: 'DM Sans', system-ui, -apple-system, sans-serif;
    position: relative;
    width: 100%;
    font-family: var(--bpg-font);
}


/* ═══════════════════════════════════════
   Layout: Thumbs Bottom (default)
   ═══════════════════════════════════════ */
.bpg-thumbs-bottom {
    display: flex;
    flex-direction: column;
    gap: var(--bpg-gap);
}


/* ═══════════════════════════════════════
   Layout: Thumbs Left
   ═══════════════════════════════════════ */
.bpg-thumbs-left {
    display: flex;
    flex-direction: row-reverse;
    gap: var(--bpg-gap);
}

.bpg-thumbs-left .bpg-thumbs-wrap {
    flex-shrink: 0;
    width: var(--bpg-thumb-size);
}

.bpg-thumbs-left .bpg-main-wrap {
    flex: 1;
    min-width: 0;
}

.bpg-thumbs-left .bpg-thumbs-swiper {
    height: 100%;
}

.bpg-thumbs-left .bpg-thumbs-swiper .swiper-wrapper {
    flex-direction: column;
}

.bpg-thumbs-left .bpg-thumb {
    width: var(--bpg-thumb-size) !important;
    height: var(--bpg-thumb-size) !important;
}


/* ═══════════════════════════════════════
   Layout: Thumbs Right
   ═══════════════════════════════════════ */
.bpg-thumbs-right {
    display: flex;
    flex-direction: row;
    gap: var(--bpg-gap);
}

.bpg-thumbs-right .bpg-thumbs-wrap {
    flex-shrink: 0;
    width: var(--bpg-thumb-size);
}

.bpg-thumbs-right .bpg-main-wrap {
    flex: 1;
    min-width: 0;
}

.bpg-thumbs-right .bpg-thumbs-swiper {
    height: 100%;
}

.bpg-thumbs-right .bpg-thumbs-swiper .swiper-wrapper {
    flex-direction: column;
}

.bpg-thumbs-right .bpg-thumb {
    width: var(--bpg-thumb-size) !important;
    height: var(--bpg-thumb-size) !important;
}


/* ═══════════════════════════════════════
   Main Image Area
   ═══════════════════════════════════════ */
.bpg-main-wrap {
    position: relative;
    border-radius: var(--bpg-radius);
    overflow: hidden;
    background: var(--bpg-bg);
}

.bpg-main-swiper {
    width: 100%;
    height: 100%;
}

.bpg-slide {
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    user-select: none;
}

.bpg-lightbox-link {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 0;
    text-decoration: none;
}

.bpg-main-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
}


/* ═══════════════════════════════════════
   Aspect Ratios
   ═══════════════════════════════════════ */
.bpg-ratio-1-1 .bpg-slide { aspect-ratio: 1 / 1; }
.bpg-ratio-4-3 .bpg-slide { aspect-ratio: 4 / 3; }
.bpg-ratio-3-4 .bpg-slide { aspect-ratio: 3 / 4; }
.bpg-ratio-16-9 .bpg-slide { aspect-ratio: 16 / 9; }
.bpg-ratio-auto .bpg-slide { aspect-ratio: auto; }


/* ═══════════════════════════════════════
   Zoom
   ═══════════════════════════════════════ */
.bpg-zoom-lens {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-size: 200%;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.2s ease;
}

.bpg-slide.bpg-zooming .bpg-zoom-lens {
    opacity: 1;
}

.bpg-slide.bpg-zooming .bpg-main-img {
    opacity: 0;
}

.bpg-slide.bpg-zooming {
    cursor: zoom-in;
}


/* ═══════════════════════════════════════
   Navigation Arrows
   ═══════════════════════════════════════ */
.bpg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bpg-nav-bg);
    border-radius: 50%;
    color: var(--bpg-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    opacity: 0;
    border: 1px solid var(--bpg-border);
}

.bpg-main-wrap:hover .bpg-nav {
    opacity: 1;
}

.bpg-nav:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-50%) scale(1.05);
}

.bpg-nav-prev {
    left: 12px;
}

.bpg-nav-next {
    right: 12px;
}

.bpg-nav.swiper-button-disabled {
    opacity: 0 !important;
    pointer-events: none;
}


/* ═══════════════════════════════════════
   Counter
   ═══════════════════════════════════════ */
.bpg-counter {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-family: var(--bpg-font);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    line-height: 1;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}


/* ═══════════════════════════════════════
   Fullscreen Button
   ═══════════════════════════════════════ */
.bpg-fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.bpg-main-wrap:hover .bpg-fullscreen-btn {
    opacity: 1;
}

.bpg-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}


/* ═══════════════════════════════════════
   Sale Badge
   ═══════════════════════════════════════ */
.bpg-sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 15;
    background: var(--bpg-badge-bg);
    color: var(--bpg-badge-color);
    font-family: var(--bpg-font);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}


/* ═══════════════════════════════════════
   Thumbnails
   ═══════════════════════════════════════ */
.bpg-thumbs-wrap {
    position: relative;
}

.bpg-thumbs-swiper {
    overflow: hidden;
}

.bpg-thumb {
    position: relative;
    width: var(--bpg-thumb-size);
    height: var(--bpg-thumb-size);
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--bpg-border);
    cursor: pointer;
    transition: border-color 0.2s ease, opacity 0.2s ease;
    flex-shrink: 0;
    background: var(--bpg-bg);
}

.bpg-thumb:hover {
    border-color: #9CA3AF;
}

.bpg-thumb-active {
    border-color: var(--bpg-primary) !important;
}

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


/* ═══════════════════════════════════════
   Video Play Icons
   ═══════════════════════════════════════ */
.bpg-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.bpg-slide:hover .bpg-play-icon {
    transform: translate(-50%, -50%) scale(1.1);
}

.bpg-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}


/* ═══════════════════════════════════════
   Responsive
   ═══════════════════════════════════════ */
@media (max-width: 1024px) {
    .bpg-thumbs-left,
    .bpg-thumbs-right {
        flex-direction: column;
    }

    .bpg-thumbs-left .bpg-thumbs-wrap,
    .bpg-thumbs-right .bpg-thumbs-wrap {
        width: 100%;
    }

    .bpg-thumbs-left .bpg-thumbs-swiper .swiper-wrapper,
    .bpg-thumbs-right .bpg-thumbs-swiper .swiper-wrapper {
        flex-direction: row;
    }
}

@media (max-width: 767px) {
    .bpg-gallery {
        --bpg-thumb-size: 56px;
    }

    .bpg-nav {
        width: 32px;
        height: 32px;
        opacity: 0.7;
    }

    .bpg-nav svg {
        width: 16px;
        height: 16px;
    }

    .bpg-nav-prev { left: 6px; }
    .bpg-nav-next { right: 6px; }

    .bpg-main-wrap:hover .bpg-nav {
        opacity: 0.85;
    }

    .bpg-fullscreen-btn {
        opacity: 0.7;
    }
}


/* ═══════════════════════════════════════
   No Product Placeholder
   ═══════════════════════════════════════ */
.bpg-no-product,
.bpg-no-images {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: var(--bpg-bg);
    border: 2px dashed var(--bpg-border);
    border-radius: var(--bpg-radius);
    font-family: var(--bpg-font);
    font-size: 14px;
    color: #9CA3AF;
}


/* ═══════════════════════════════════════
   GLightbox Overrides
   ═══════════════════════════════════════ */
.glightbox-clean .gclose,
.glightbox-clean .gnext,
.glightbox-clean .gprev {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.glightbox-clean .gslide-description {
    font-family: var(--bpg-font);
}


/* ═══════════════════════════════════════
   Print
   ═══════════════════════════════════════ */
@media print {
    .bpg-nav,
    .bpg-counter,
    .bpg-fullscreen-btn,
    .bpg-thumbs-wrap {
        display: none !important;
    }
}
