/* GAMBEA product gallery 1.0.3. Catalog/related-product selectors are untouched. */
.gambea-pg-desktop,
.gambea-pg-mobile {
    min-width: 0;
}

.gambea-pg-desktop .custom-gallery-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.gambea-pg-desktop .custom-gallery-columns > .custom-gallery-item {
    position: relative;
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
}

/* The site's old stylesheet hides the native gallery-image class globally. */
.gambea-pg-desktop .custom-gallery-columns > .gambea-pg-primary.woocommerce-product-gallery__image {
    display: block !important;
}

.gambea-pg-desktop .custom-gallery-item > img[data-gambea-pg-image] {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

.gambea-pg-desktop .custom-gallery-item > video[data-gambea-pg-video] {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gambea-pg-desktop .gambea-pg-video-item > .gambea-pg-video-toggle {
    display: grid;
    place-items: center;
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 36px;
    height: 36px;
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #000;
    background: rgba(255, 255, 255, .85);
    cursor: pointer;
}

.gambea-pg-desktop .gambea-pg-video-toggle[hidden] {
    display: none;
}

.gambea-pg-desktop .gambea-pg-video-toggle::before {
    content: '';
    margin-left: 2px;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid currentColor;
}

.gambea-pg-desktop .gambea-pg-video-toggle[aria-pressed='true']::before {
    box-sizing: border-box;
    width: 11px;
    height: 13px;
    margin: 0;
    border: 0;
    border-left: 4px solid currentColor;
    border-right: 4px solid currentColor;
}

.gambea-pg-desktop .gambea-pg-video-toggle:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

@media (any-hover: hover) {
    .gambea-pg-desktop .gambea-pg-video-item:hover > .gambea-pg-video-toggle[aria-pressed='true'] {
        opacity: 0;
        pointer-events: none;
    }
}

.gambea-pg-desktop .gambea-pg-empty {
    visibility: hidden;
}

.gambea-pg-mobile .gallery-flickity[data-gambea-pg-carousel] {
    --gambea-pg-ratio: 4 / 5;
    position: relative;
    width: 100%;
    min-width: 0;
    margin: 0;
    aspect-ratio: var(--gambea-pg-ratio);
}

/* Also usable while Flickity is loading or if the script fails to load. */
.gambea-pg-mobile .gallery-flickity[data-gambea-pg-carousel]:not(.flickity-enabled) {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.gambea-pg-mobile .gallery-flickity[data-gambea-pg-carousel] .gallery-cell[data-gambea-pg-cell] {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    scroll-snap-align: start;
}

/* Scoped replacement of the site's global padding-bottom:125%/height:auto rule. */
.gambea-pg-mobile .gallery-flickity[data-gambea-pg-carousel] .flickity-viewport {
    position: relative;
    width: 100%;
    height: 100% !important;
    padding-bottom: 0;
    overflow: hidden;
}

.gambea-pg-mobile .gallery-flickity[data-gambea-pg-carousel] .flickity-slider {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
}

.gambea-pg-mobile .gallery-flickity[data-gambea-pg-carousel].is-draggable .flickity-viewport {
    touch-action: pan-y;
    cursor: grab;
}

.gambea-pg-mobile .gallery-flickity[data-gambea-pg-carousel] .flickity-viewport.is-pointer-down {
    cursor: grabbing;
}

.gambea-pg-mobile .gallery-cell[data-gambea-pg-cell] > img[data-gambea-pg-image],
.gambea-pg-mobile .gallery-cell[data-gambea-pg-cell] > video[data-gambea-pg-video] {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
}

.gambea-pg-noscript img {
    display: block;
    width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .gambea-pg-desktop[data-gambea-pg-root] {
        display: none !important;
    }

    .gambea-pg-noscript-desktop {
        display: none !important;
    }

    .gambea-pg-mobile[data-gambea-pg-mobile] {
        display: block;
    }
}

@media (min-width: 769px) {
    .gambea-pg-mobile[data-gambea-pg-mobile] {
        display: none !important;
    }

    .gambea-pg-noscript-mobile {
        display: none !important;
    }
}
