/* Atlantic Firearms — Photo Gallery (belvg_gallery) */

.belvg-gallery-container {
    max-width: 1240px;
    margin: 0 auto 50px;
    padding: 10px 15px 40px;
}

/* Header */
.belvg-gallery-header {
    text-align: center;
    margin-bottom: 28px;
    padding: 10px 0 10px;
}

.belvg-gallery-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1a1c1e;
    margin: 0 0 10px;
}

.belvg-gallery-subtitle {
    font-size: 15.5px;
    color: #64748b;
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.55;
}

/* Category Filter Tabs */
.belvg-gallery-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
    padding: 4px;
}

.belvg-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.belvg-filter-tab:hover {
    background: #fff5f5;
    color: #DA2128;
    border-color: rgba(218, 33, 40, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.belvg-filter-tab:focus,
.belvg-filter-tab:focus-visible {
    outline: none !important;
}

.belvg-filter-tab.is-active {
    background: #DA2128;
    color: #ffffff;
    border-color: #DA2128;
    box-shadow: 0 4px 14px rgba(218, 33, 40, 0.3);
    transform: translateY(-1px);
}

.belvg-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}

.belvg-filter-tab.is-active .belvg-filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Gallery Grid Layouts */
.belvg_gallery-grid.belvg_gallery-layout-masonry {
    columns: 3 320px;
    column-gap: 24px;
}

@media (max-width: 991px) {
    .belvg_gallery-grid.belvg_gallery-layout-masonry {
        columns: 2 260px;
        column-gap: 20px;
    }
}

@media (max-width: 576px) {
    .belvg_gallery-grid.belvg_gallery-layout-masonry {
        columns: 1;
    }
}

.belvg_gallery-grid.belvg_gallery-layout-masonry .belvg_gallery-item {
    break-inside: avoid;
    margin: 0 0 24px;
}

.belvg_gallery-grid.belvg_gallery-layout-masonry .belvg-gallery-media img {
    display: block;
    width: 100%;
    height: auto;
}

/* Uniform Grid Layout (Equal Heights) */
.belvg_gallery-grid.belvg_gallery-layout-uniform {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

@media (max-width: 768px) {
    .belvg_gallery-grid.belvg_gallery-layout-uniform {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .belvg_gallery-grid.belvg_gallery-layout-uniform {
        grid-template-columns: 1fr;
    }
}

.belvg_gallery-grid.belvg_gallery-layout-uniform .belvg_gallery-item {
    margin: 0;
    height: 100%;
}

.belvg_gallery-grid.belvg_gallery-layout-uniform .belvg-gallery-media {
    aspect-ratio: 4 / 3;
    width: 100%;
}

.belvg_gallery-grid.belvg_gallery-layout-uniform .belvg-gallery-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Instagram Layout: square tiles, three per row at every width, filled left to right */
.belvg_gallery-grid.belvg_gallery-layout-instagram {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.belvg_gallery-grid.belvg_gallery-layout-instagram .belvg_gallery-item {
    margin: 0;
    height: 100%;
}

.belvg_gallery-grid.belvg_gallery-layout-instagram .belvg-gallery-media {
    aspect-ratio: 1 / 1;
    width: 100%;
}

.belvg_gallery-grid.belvg_gallery-layout-instagram .belvg-gallery-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card Item */
.belvg_gallery-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecf1;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    display: flex;
    flex-direction: column;
}

.belvg_gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.belvg-gallery-media {
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
}

.belvg-gallery-media img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.belvg_gallery-item:hover .belvg-gallery-media img {
    transform: scale(1.04);
}

/* Hover Overlay with Zoom Icon */
.belvg-gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.45), rgba(15, 23, 42, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.belvg_gallery-item:hover .belvg-gallery-overlay {
    opacity: 1;
}

.belvg-gallery-zoom-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1c1e;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}

.belvg_gallery-item:hover .belvg-gallery-zoom-btn {
    transform: scale(1);
}

.belvg-gallery-zoom-btn:hover {
    background: #ffffff;
    color: #DA2128;
}

/* Caption */
.belvg-gallery-caption {
    padding: 14px 18px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.belvg-item-category-tag {
    display: inline-block;
    align-self: flex-start;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1e293b;
    background: #f1f5f9;
    border-radius: 4px;
}

.belvg-caption-text {
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Lightbox Modal */
.belvg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.belvg-lightbox.is-active {
    opacity: 1;
    visibility: visible;
}

.belvg-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 29, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.belvg-lightbox-content {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.belvg-lightbox-img {
    max-width: 90vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    user-select: none;
}

.belvg-lightbox-bar {
    margin-top: 14px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 80vw;
}

.belvg-lightbox-caption-text {
    color: #f8fafc;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.belvg-lightbox-counter {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 14px;
}

/* Lightbox Controls */
.belvg-lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.belvg-lightbox-close:hover {
    background: rgba(218, 33, 40, 0.85);
    transform: scale(1.08);
}

.belvg-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.belvg-lightbox-nav.prev {
    left: 24px;
}

.belvg-lightbox-nav.next {
    right: 24px;
}

.belvg-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.08);
}

@media (max-width: 768px) {
    .belvg-lightbox-nav.prev { left: 10px; }
    .belvg-lightbox-nav.next { right: 10px; }
    .belvg-lightbox-close { top: 12px; right: 12px; }
}

/* ---------------------------------------------------------------------------
 * Part 2 (ACS-1012): short videos, clickable/product captions, load more.
 * ------------------------------------------------------------------------ */

.belvg-gallery-video {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.belvg_gallery-layout-uniform .belvg-gallery-video,
.belvg_gallery-layout-instagram .belvg-gallery-video {
    height: 100%;
}

.belvg-gallery-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(218, 33, 40, .92);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    pointer-events: none;
    z-index: 2;
}

.belvg-caption-link {
    color: #DA2128;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.belvg-caption-link:hover,
.belvg-caption-link:focus {
    color: #b51a20;
}

.belvg-caption-product {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fdf3f3;
    border: 1px solid rgba(218, 33, 40, .25);
    color: #b51a20;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.belvg-caption-product:hover,
.belvg-caption-product:focus {
    background: #DA2128;
    border-color: #DA2128;
    color: #fff;
    text-decoration: none;
}

.belvg-gallery-more {
    margin: 28px auto 8px;
    text-align: center;
}

.belvg-gallery-more-btn {
    min-width: 190px;
    padding: 12px 26px;
    border: 0;
    border-radius: 6px;
    background: #DA2128;
    color: #fff;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .18s ease;
}

.belvg-gallery-more-btn:hover:not(:disabled) {
    background: #b51a20;
}

.belvg-gallery-more-btn:disabled {
    opacity: .6;
    cursor: default;
}

.belvg-gallery-more-hint {
    margin-top: 10px;
    font-size: 13px;
    color: #6a6f76;
}

.belvg-lightbox-video {
    max-width: 92vw;
    max-height: 82vh;
    border-radius: 8px;
    background: #000;
}

.belvg-lightbox-product {
    margin-left: 14px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #DA2128;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.belvg-lightbox-product:hover,
.belvg-lightbox-product:focus {
    background: #fff;
    color: #DA2128;
    text-decoration: none;
}

/* A caption that carries a link has to look clickable in the enlarged view
   too, not only in the feed (ACS-1054). */
a.belvg-lightbox-caption-link {
    color: #f8fafc;
    text-decoration: underline;
    text-underline-offset: 3px;
}

a.belvg-lightbox-caption-link:hover,
a.belvg-lightbox-caption-link:focus {
    color: #fff;
    text-decoration: underline;
}

/* ---------------------------------------------------------------------------
 * ACS-1058: several products pinned on one photo.
 * ------------------------------------------------------------------------ */

/* The photo must not zoom under its pins, or they drift off their product. */
.belvg_gallery-item.has-pins:hover .belvg-gallery-media img {
    transform: none;
}

.belvg-pins {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.belvg-pin {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: auto;
    transition: opacity .2s ease;
}

.belvg-pin.is-open {
    z-index: 5;
}

/* Hover-only mode: dots appear with the pointer over the photo. A touch
   screen has no hover, so there they always stay visible. */
@media (hover: hover) {
    .belvg-pins:not(.is-always) .belvg-pin {
        opacity: 0;
    }

    .belvg_gallery-item:hover .belvg-pins .belvg-pin,
    .belvg-pins .belvg-pin.is-open,
    .belvg-pins .belvg-pin:focus-within {
        opacity: 1;
    }
}

.belvg-pin-dot {
    position: absolute;
    left: -13px;
    top: -13px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(41, 41, 41, .55);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1), background-color .2s ease;
}

.belvg-pin-dot span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.belvg-pin-dot::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .85);
    animation: belvg-pin-pulse 2.4s ease-out infinite;
    pointer-events: none;
}

@keyframes belvg-pin-pulse {
    0% { transform: scale(1); opacity: .9; }
    70%, 100% { transform: scale(1.9); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .belvg-pin-dot::after {
        animation: none;
        opacity: 0;
    }
}

.belvg-pin.is-open .belvg-pin-dot,
.belvg-pin-dot:hover,
.belvg-pin-dot:focus-visible {
    background: #DA2128;
    transform: scale(1.1);
    outline: none;
}

.belvg-pin-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 230px;
    max-width: 70vw;
    padding: 8px 12px 8px 8px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .45);
    color: #292929;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.belvg-pin.is-open .belvg-pin-card,
.belvg-pin:focus-within .belvg-pin-card {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.belvg-pin-card:hover,
.belvg-pin-card:focus {
    color: #292929;
    text-decoration: none;
}

/* The card opens towards the middle of the photo. */
.belvg-pin-right .belvg-pin-card { left: -18px; }
.belvg-pin-left .belvg-pin-card { right: -18px; }
.belvg-pin-down .belvg-pin-card { top: 20px; }
.belvg-pin-up .belvg-pin-card { bottom: 20px; }

.belvg-pin-thumb {
    width: 54px !important;
    height: 54px !important;
    flex: none;
    object-fit: contain !important;
    border-radius: 6px;
    background: #f4f5f6;
    transform: none !important;
}

.belvg-pin-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.belvg-pin-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.belvg-pin-price {
    font-size: 13px;
    font-weight: 700;
    color: #b51a20;
    font-variant-numeric: tabular-nums;
}

.belvg-pin-cta {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: #123C7A;
}

.belvg-pin-card:hover .belvg-pin-cta {
    color: #DA2128;
}

/* Lightbox: the pins sit on the picture itself, which the stage wraps. */
.belvg-lightbox-stage {
    position: relative;
    display: inline-block;
    line-height: 0;
    max-width: 92vw;
}

.belvg-lightbox-stage .belvg-pins {
    line-height: 1.4;
}

.belvg-lightbox-img[hidden] ~ .belvg-pins:empty {
    display: none;
}

.belvg-lightbox-products {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.belvg-lightbox-products[hidden] {
    display: none;
}

.belvg-lightbox-products .belvg-lightbox-product {
    margin-left: 0;
}

.belvg-caption-product + .belvg-caption-product {
    margin-top: 0;
}

/* ---------------------------------------------------------------------------
 * Part 3: the per-tab footer can hide Load more without removing it, and
 * long captions / product names must stay inside their boxes on phones.
 * ------------------------------------------------------------------------ */

.belvg-gallery-more-btn[hidden] {
    display: none;
}

/* Product chips are long product names, not short labels: a pill radius
   turns a wrapped name into a tall capsule, so wrap inside a rounded box. */
.belvg-caption-product,
.belvg-lightbox-product {
    max-width: 100%;
    border-radius: 8px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
}

/* Lightbox bar: the full caption is shown here, so it wraps instead of
   being cut to one line; a very long one scrolls inside the bar. */
.belvg-lightbox-bar {
    max-width: min(92vw, 760px);
    border-radius: 14px;
    flex-wrap: wrap;
    row-gap: 8px;
    max-height: 32vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.belvg-lightbox-caption-text {
    flex: 1 1 220px;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.belvg-lightbox-products {
    flex: 1 1 100%;
    min-width: 0;
    order: 2;
}

.belvg-lightbox-counter {
    margin-left: auto;
}

@media (max-width: 768px) {
    .belvg-lightbox-content {
        max-width: 100vw;
        width: 100%;
        padding: 0 12px;
        box-sizing: border-box;
    }

    .belvg-lightbox-img {
        max-width: 100%;
        max-height: 58vh;
    }

    .belvg-lightbox-bar {
        width: 100%;
        max-width: 100%;
        padding: 10px 14px;
        box-sizing: border-box;
        gap: 10px;
    }

    .belvg-lightbox-caption-text {
        flex-basis: 100%;
        font-size: 13px;
    }

    .belvg-lightbox-counter {
        order: 3;
        border-left: 0;
        padding-left: 0;
    }

    .belvg-lightbox-product {
        display: block;
        padding: 6px 10px;
    }

    /* Mid-screen arrows sat on top of the wrapped caption; swipe still
       works, the buttons move to the bottom corners. */
    .belvg-lightbox-nav {
        top: auto;
        bottom: 18px;
        transform: none;
        width: 44px;
        height: 44px;
    }

    .belvg-lightbox-nav:hover {
        transform: none;
    }
}

/* Narrow tiles (Instagram three-across, any layout on a phone): the card is
   a teaser, the full text is one tap away in the lightbox. */
@media (max-width: 576px) {
    .belvg_gallery-item .belvg-gallery-caption {
        padding: 8px 8px 10px;
        gap: 4px;
        min-width: 0;
    }

    .belvg_gallery-item .belvg-caption-text {
        font-size: 12px;
        line-height: 1.4;
        -webkit-line-clamp: 2;
        overflow-wrap: anywhere;
    }

    .belvg_gallery-item .belvg-caption-product {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-top: 2px;
        padding: 3px 6px;
        font-size: 11px;
        line-height: 1.3;
    }
}
