/**
* @websima-wc-gallery/
* @style.css
* WooCommerce Gallery Enhancement Module
* Comprehensive styles for product gallery with popup, thumbnails, and mobile support
*/

/* ===================================
ICON FONTS & TYPOGRAPHY
=================================== */

/* Custom icon font definition */
:root {
    --ff-icon-wcgl: 'galleryIcon';
    --color-gallery: rgb(81, 0, 255);
}

@font-face {
    font-family: 'galleryIcon';
    src:
        url('../fonts/galleryIcon.ttf') format('truetype'),
        url('../fonts/galleryIcon.woff') format('woff'),
        url('../fonts/galleryIcon.svg') format('svg');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

/* Base icon class styles */
[class^="gl-"],
[class*=" gl-"] {
    /* Use !important to prevent issues with browser extensions that change fonts */
    font-family: var(--ff-icon-wcgl) !important;
    speak: never;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Individual icon definitions */
.gl-starFill:before {
    content: "\e908";
}

.gl-playSimple:before {
    content: "\e900";
}

.gl-image:before {
    content: "\e901";
}

.gl-chevronLeft:before {
    content: "\e902";
}

.gl-chevronRight:before {
    content: "\e903";
}

.gl-profile:before {
    content: "\e904";
}

.gl-video:before {
    content: "\e905";
}

.gl-moreHoriz:before {
    content: "\e906";
}

.gl-close:before {
    content: "\e91b";
}

/* ===================================
GALLERY THUMBNAILS (DESKTOP)
=================================== */
a,
button textarea,
div,
input,
select {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.gallery-popup * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-drag: none;
    -webkit-user-drag: none;
    -moz-user-drag: none;
    -ms-user-drag: none;
}

.gallery-popup img {
    display: inline-block;
}

.jsThumbOpen {
    cursor: pointer;
}
.jsThumbOpen.image {
    position: relative;
    border: 1px solid rgba(203, 203, 203, 0.58);
  background: #FFF;
  margin-bottom: 24px;
  border-radius: 18px;
  overflow: hidden;
}
.wbs-wc-gallery .image,
.wbs-wc-gallery {
    position: relative;
}

.wbs-wc-gallery .image img {
    width: 100%;
    border-radius: 8px;
}

/* Main thumbnails grid container */
.wbs-wc-gallery .thumbnails {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 12px;
}

/* Individual thumbnail item styling */
.wbs-wc-gallery .thumb-item {
    border: 1px solid #e0e0e2;
    overflow: hidden;
    border-radius: 8px;
    padding: 4px;
    position: relative;
    transition: all .3s;
    width: 100%;
    display: flex;
}
.wbs-wc-gallery .thumb-item:not(.video-thumb,.has-more-items):before {
    opacity: 0;
    visibility: hidden;
    content: "";
    position: absolute;

    background: #1BD2A74D;
    backdrop-filter: blur(8px);
    inset: 0;
    margin: auto;
    transition: 0.4s;
    z-index: 1;
}
.wbs-wc-gallery .thumb-item:not(.video-thumb,.has-more-items):after {
    opacity: 0;
    visibility: hidden;
    content: "\e91e";
    font-family: "websimaIcon";
    position: absolute;
    inset: 0;
    width: 37px;
    height: 37px;
    font-size: 37px;
    line-height: 1;
    margin: auto;
    transition: 0.4s;
    z-index: 1;
    color: #fff;
}
.wbs-wc-gallery .thumb-item:hover:after,
.wbs-wc-gallery .thumb-item:hover:before {
    opacity: 1;
    visibility: visible;
}

.wbs-wc-gallery .thumb-item img {
    width: 100%;
    object-fit: contain;
    border-radius: 4px;
    display: inline-block;
}

/* Blur effect for overflow items indicator */
.wbs-wc-gallery .video-thumb img,
.wbs-wc-gallery .has-more-items img {
    filter: blur(4px);
    opacity: .4;
}

.wbs-wc-gallery .has-more-items:before {
    content: "\e906";

}

.wbs-wc-gallery .video-thumb:before {
    content: "\e905";
}

.wbs-wc-gallery .video-thumb:before,
.wbs-wc-gallery .has-more-items:before {
    font-family: var(--ff-icon-wcgl);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #424750;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
    font-size: 24px;
}




/* ===================================
GALLERY POPUP - BASE STRUCTURE
=================================== */

/* Main popup overlay container */
.gallery-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.6;
}

/* Dark overlay background */
.gallery-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

/* Main popup content container */
.gallery-popup__container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.gallery-popup__header {
    display: grid;
    grid-template-columns: 20px 1fr 20px;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
    margin-left: 15px;
    margin-right: 15px;
    position: relative;
    z-index: 12;
}

/* Close button */
.gallery-popup__close {
    all: unset;
    padding: 10px;
    line-height: 1;
    font-size: 12px;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 3;
}

.gallery-popup__close:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Content wrapper */
.gallery-popup__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ===================================
GALLERY POPUP - MAIN CONTENT AREA
=================================== */

/* Main content container with media and review panel */
.gallery-popup__main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    justify-content: center;
    position: relative;
}

/* Main swiper container for media content */
.gallery-popup__main-swiper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}



.gallery-popup__main-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Media container for images and videos */
.gallery-popup__media {
    width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Media elements styling */
.gallery-popup__media img,
.gallery-popup__media video {
    width: 100%;
    object-fit: contain;
    height: 100%;
}

/* ===================================
GALLERY POPUP - REVIEW PANEL
=================================== */

.gallery-popup__review-panel {
    font-size: 12.5px;
}

/* Review information container */
.gallery-popup__review-info {
    margin: 0.75em 1em 0;
    color: #fff;
}

/* Review author name */
.gallery-popup__author {
    display: flex;
    align-items: center;
    gap: 1.067em;
    font-size: 0.9375em;
    font-weight: bold;
    font-variation-settings: "wght" 600;
}

.gallery-popup__attributes {
    display: flex;
    flex-direction: column;
    gap: 0.333em;
    font-size: 0.75em;
    opacity: .8;
    margin-top: 1em;
}

.gallery-popup__attributes li {
    display: flex;
    align-items: center;
    gap: 0.333em;
}


/* Review date */
.gallery-popup__date {
    font-size: 0.75em;
    margin: 0.583em 0 0;
    opacity: .6;
    direction: ltr;
}

/* Review rating display */
.gallery-popup__rating {
    font-size: 1.25em;
    display: flex;
    align-items: center;
}

.gallery-popup__rating .gl-star {
    color: #A1A3AD;
    font-size: 1em;
    margin: 0 0.05em;
}

.gallery-popup__rating .filled {
    color: #f39c12;
}

/* Review text content */
.gallery-popup__review-content {
    line-height: 1.6;
    margin: 0.857em 0 0;
    font-size: 0.875em;
}

/* ===================================
GALLERY POPUP - NAVIGATION
=================================== */

/* Main swiper navigation buttons */
.wc-gallery-prev,
.swiper-rtl .wc-gallery-next {
    left: 10px;
    right: auto;
}

.wc-gallery-next,
.swiper-rtl .wc-gallery-prev {
    right: 10px;
    left: auto;
}

.wc-gallery-next:after,
.swiper-rtl .wc-gallery-prev:after {
    content: '\e903';

}

.wc-gallery-prev:after,
.swiper-rtl .wc-gallery-next:after {
    content: '\e902';

}

.wc-gallery-next,
.wc-gallery-prev {
    display: flex;
    position: absolute;
    color: #424750;
    background: hsla(0, 0%, 100%, .5);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all .3s;
    box-shadow: 0px 1px 5px rgba(0, 0, 0, .2);
}

.wc-gallery-next.swiper-button-disabled,
.wc-gallery-prev.swiper-button-disabled {
    display: none;
}



/* Navigation button icon sizing */
.wc-gallery-next::after,
.wc-gallery-prev::after {
    font-size: 24px;
    font-family: var(--ff-icon-wcgl);
    text-transform: none !important;
    letter-spacing: 0;
    font-variant: initial;
    line-height: 1;
}

/* ===================================
GALLERY POPUP - THUMBNAILS & TABS
=================================== */

/* Bottom thumbnails container */
.gallery-popup__thumbnails {
    background: rgba(0, 0, 0, .8);
    position: relative;
    padding: 15px 0;
    z-index: 3;
}

/* Tab navigation container */
.gallery-popup__tabs {
    display: flex;
    grid-column: 2;
    justify-self: center;
    background: rgba(0, 0, 0, .5);
    border: 1px solid hsla(0, 0%, 100%, .25);
    overflow: hidden;
    padding: 2px 6px;
    border-radius: 8px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Individual tab button styling */
.gallery-popup__tab {
    all: unset;
    padding: 0px 10px;
    font-size: 12px;
    display: flex;
    line-height: 2.15;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.gallery-popup__tab:hover {
    opacity: .7;
}

.gallery-popup__tab::after {
    content: "";
    position: absolute;
    display: block;
    width: 16px;
    border-radius: 8px;
    opacity: 0;
    right: 50%;
    transform: translate(50%, -50%);
    transition: .3s;
    height: 6px;
    outline: 4px solid rgba(0, 0, 0, .5);
    background: #fff;
    top: calc(100% + 2px);
}


.gallery-popup__tab--active::after {
    opacity: 1;
}


.gallery-popup__tab[data-group-type="buyer"]:before {
    content: "";
    position: absolute;
    display: block;
    height: 20px;
    width: 1px;
    background-color: hsla(0, 0%, 100%, .25);
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 4px;
}

[dir="ltr"] .gallery-popup__tab[data-group-type="buyer"]:before {
    right: auto;
    left: 0;
}

/* Thumbnails swiper container */


.gallery-popup__thumb-swiper .swiper-slide {
    width: auto !important;
    height: 100%;
}

.gallery-popup__thumb-item:last-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    overflow: hidden;
}

[dir="ltr"] .gallery-popup__thumb-item:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden;
}

.gallery-popup__thumb-item:first-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden;
}

[dir="ltr"] .gallery-popup__thumb-item:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    overflow: hidden;
}

/* Thumbnail groups layout */
.gallery-popup__thumb-group {
    display: flex;
    height: 100%;
    align-items: center;
    margin: 0 8px;
    padding: 1px;
    border-radius: 8px;
    gap: 1px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.gallery-popup__thumb-group:has(.gallery-popup__thumb-item--active) {
    background: #fff;
}

.gallery-popup__thumb-item--active:before {
    content: "";
    position: absolute;
    display: block;
    width: 16px;
    height: 5px;
    border-radius: 8px;
    outline: 4px solid rgba(0, 0, 0, .5);
    background: #fff;
    right: 50%;
    top: 100%;
    transform: translate(50%, -50%);
    transition: .3s;
    z-index: 3;
}

/* Individual thumbnail item */
.gallery-popup__thumb-item {
    width: 70px;
    height: 70px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}



/* Thumbnail image styling */
.gallery-popup__thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video indicator icon on thumbnails */
.gallery-popup__video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, .467);
    font-size: 24px;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===================================
GALLERY POPUP - BUTTONS & LABELS
=================================== */

/* Buyer label container */
.gallery-popup__buyer-label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 20px;
}

/* Section action button */
.gallery-popup__section-label {
    width: 60px;
    min-width: 60px;
}

.gallery-popup__section-button {
    all: unset;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    font-family: var(--main_font);
    text-align: center;
    font-weight: bold;
    font-variation-settings: "wght 600";
    line-height: 1.2;
}

.gallery-popup__section-button i {
    font-size: 24px;
}


/* Buyer status button */
.gallery-popup__buyer-button {
    padding: 15px 25px;
    background: linear-gradient(45deg, #007cba, #0056b3);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: default;
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.3);
}

/* ===================================
LOADING STATES & ANIMATIONS
=================================== */

/* Main gallery loading overlay */
.gallery-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-loading__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.gallery-loading__spinner {
    position: relative;
    text-align: center;
    color: white;
}

.gallery-loading__circle {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: gallery-spin 1s linear infinite;
}

.gallery-loading__text {
    font-size: 16px;
}

/* Popup specific loading state */
.gallery-popup__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.gallery-popup__loading-dots {
    display: flex;
    gap: 8px;
}

.gallery-popup__loading-dots div {
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.gallery-popup__loading-dots .dot1 {
    animation-delay: -0.32s;
}

.gallery-popup__loading-dots .dot2 {
    animation-delay: -0.16s;
}

.gallery-popup__loading-text {
    font-size: 16px;
    color: #666;
    text-align: center;
}

/* Animation keyframes */
@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@keyframes gallery-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.variation-image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    border-radius: 50%;
}

.variation-image-loading div {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-gallery);
    border-radius: 50%;
    animation: gallery-spin 1s linear infinite;
}

/* ===================================
UTILITY CLASSES
=================================== */

/* Prevent body scroll when popup is open */
.gallery-popup-open {
    overflow: hidden;
}

/* ===================================
POPUP VARIANTS
=================================== */

/* Gallery popup without thumbnails */
.gallery-popup__container.no-thumbnails {
    height: 100%;
}

.gallery-popup__container.no-thumbnails .gallery-popup__content {
    height: 100%;
}

.gallery-popup__container.no-thumbnails .gallery-popup__main-container {
    flex: 1;
    height: 100%;
}

.gallery-popup__container.no-thumbnails .gallery-popup__thumbnails {
    display: none;
}


/* ===================================
MOBILE
=================================== */
.wbs-wc-gallery-mobile {
    border-radius: 8px;
    overflow: hidden;
    position: relative;

}

.mobile-video-btn {
    all: unset;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
    width: 32px;
    height: 32px;
    background: #0c0c0c99;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    outline: 1px solid #ffffff33;
}

.mobile-gallery__item {
    mix-blend-mode: multiply;
    width: 250px;
    height: 250px;
}

.mobile-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mobile-gallery-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f1;
    height: auto;
}

.mobile-gallery-pagination {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: var(--color-gallery);
    color: #fff;
    width: auto;
    left: 6px;
    right: auto;
    bottom: 6px;
    z-index: 3;
    line-height: 1;
    border-radius: 12px;
    padding: 4px 10px 4px 4px;
    font-size: 11px;
    pointer-events: none;
}

.mobile-gallery-pagination::after {
    content: '\e901';
    font-family: var(--ff-icon-wcgl);
    font-size: 18px;
    color: #fff;
    margin-right: 10px;
}

.gallery-tabs-slide__grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 60% 40px;
    gap: 10px;
    padding: 10px;
    height: 90%;
}

.gallery-tabs-slide__item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, .8));
    pointer-events: none;
    border-radius: 8px;
}

.gallery-tabs-slide__item {
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.gallery-tabs-slide__content {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 10px;
    line-height: 1.5;
    z-index: 5;
    color: #fff;
}

.gallery-tabs-slide__content small {
    margin-right: 4px;
}

.gallery-tabs-slide__all {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gallery);
}

.gallery-tabs-slide__all .gallery-tabs-slide__content {
    position: static;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;

}

.gallery-tabs-slide__all .gallery-tabs-slide__content i {
    font-size: 20px;
}

.gallery-tabs-slide__all::before {
    display: none;
}

/* ===================================
DESKTOP SPECIFIC OVERRIDES
=================================== */


@media (min-width: 1024px) {
    .gallery-popup__header {
        grid-template-columns: 28px 1fr 28px;
        padding-top: 16px;
        padding-bottom: 16px;
        margin-left: 20px;
        margin-right: 20px;
    }

    .gallery-popup__main-container {
        padding: 20px;
    }

    .gallery-popup__main-swiper {
        width: calc(100vh - 230px);
        max-width: 75vw;
    }

    .has-review .gallery-popup__main-swiper {
        width: 600px;
        height: 75vh;
        max-width: unset;
        margin: 0;
    }

    .gallery-popup__review-panel {
        font-size: 16px;
        width: 400px;
        min-width: 400px;
        color: #fff;
    }

    .gallery-popup__close {
        font-size: 16px;
    }

    .gallery-popup__tabs {
        border-radius: 12px;
        padding: 4px 8px;
    }

    .gallery-popup__tab {
        padding: 0px 16px;
        font-size: 14px;
    }

    .gallery-popup__tab::after {
        top: calc(100% + 5px);
    }

    /* .wc-gallery-next,
    .wc-gallery-prev {
        display: flex;
    } */

    .gallery-popup__media img,
    .gallery-popup__media video {
        border-radius: 4px;
        max-height: 75vh;
    }

    .gallery-popup__main-container {
        flex-direction: row;
    }

    .gallery-popup__review-content {
        max-height: 50vh;
        overflow-y: auto;
    }

    .wc-gallery-next,
    .wc-gallery-prev {
        width: 40px;
        height: 40px;
    }

    /* Navigation button hover effects */
    .wc-gallery-next:hover,
    .wc-gallery-prev:hover {
        background: #fff;
    }

    .gallery-popup__loading-dots div {
        width: 12px;
        height: 12px;
    }

}

@media (max-width: 1023.98px) {
    .gallery-popup__main-container {
        position: absolute;
        inset: 0;
    }

    .gallery-popup__review-panel {
        position: absolute;
        bottom: 100px;
        width: 100%;
        background: rgba(0, 0, 0, .8);
        z-index: 2;
        max-height: 50vh;
        overflow-y: auto;
    }

    .gallery-popup__thumbnails {
        margin-top: auto;
    }

}