.pg-8a9ea7e7-gallery-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 16px;
    box-sizing: border-box;
}

/* Main Image Container & Sizing */
.pg-8a9ea7e7-main-container {
    position: relative;
    width: 100%;
    background-color: #ffffff;
    border-radius: 4px;
    border: 1px solid #eaeaea;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.pg-8a9ea7e7-main-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pg-8a9ea7e7-lightbox-enabled .pg-8a9ea7e7-main-image-wrapper {
    cursor: zoom-in;
}

.pg-8a9ea7e7-main-image-wrapper img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center;
}

/* Arrow Navigation Overlays */
.pg-8a9ea7e7-gallery-wrapper button.pg-8a9ea7e7-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
    transition: background-color 0.2s, transform 0.2s, color 0.2s !important;
    z-index: 10 !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.pg-8a9ea7e7-gallery-wrapper button.pg-8a9ea7e7-nav:hover {
    transform: translateY(-50%) scale(1.05) !important;
}

.pg-8a9ea7e7-gallery-wrapper button.pg-8a9ea7e7-nav i,
.pg-8a9ea7e7-gallery-wrapper button.pg-8a9ea7e7-nav svg {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    fill: currentColor !important;
    color: currentColor !important;
    line-height: 1 !important;
}

.pg-8a9ea7e7-prev {
    left: 16px !important;
}

.pg-8a9ea7e7-next {
    right: 16px !important;
}

/* Thumbnails Grid styling */
.pg-8a9ea7e7-thumbs {
    display: grid;
    width: 100%;
    box-sizing: border-box;
}

.pg-8a9ea7e7-thumb-wrapper {
    position: relative;
    background-color: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.pg-8a9ea7e7-thumb-wrapper img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center;
}

/* Hover Grow effect */
.pg-8a9ea7e7-thumb-wrapper:hover {
    transform: scale(1.04);
    border-color: #999999;
    z-index: 2;
}

.pg-8a9ea7e7-thumb-wrapper.active {
    border-color: #111111;
    box-shadow: 0 0 0 1px #111111;
}

/* Tablet Responsiveness (Under 1024px) */
@media screen and (max-width: 1024px) {
    {{WRAPPER}} .pg-8a9ea7e7-main-container,
    .pg-8a9ea7e7-main-container {
        height: auto !important;
        aspect-ratio: 4/3 !important;
    }
}

/* Mobile Responsiveness Rules (Under 768px) */
@media screen and (max-width: 767px) {
    {{WRAPPER}} .pg-8a9ea7e7-main-container,
    .pg-8a9ea7e7-main-container {
        height: auto !important;
        aspect-ratio: 1/1 !important;
    }

    {{WRAPPER}} .pg-8a9ea7e7-thumbs,
    .pg-8a9ea7e7-thumbs {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        grid-template-columns: none !important;
        gap: 8px !important;
        padding-bottom: 8px !important;
        width: 100% !important;
    }

    {{WRAPPER}} .pg-8a9ea7e7-thumb-wrapper,
    .pg-8a9ea7e7-thumb-wrapper {
        flex: 0 0 70px !important;
        height: 70px !important;
        aspect-ratio: 1/1 !important;
        scroll-snap-align: start !important;
    }

    .pg-8a9ea7e7-prev {
        left: 8px !important;
    }
    .pg-8a9ea7e7-next {
        right: 8px !important;
    }
    
    .pg-8a9ea7e7-thumbs::-webkit-scrollbar {
        height: 4px !important;
    }
    .pg-8a9ea7e7-thumbs::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2) !important;
        border-radius: 4px !important;
    }
}

/* --- Lightbox Styles --- */
.pg-8a9ea7e7-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

body.pg-8a9ea7e7-no-scroll {
    overflow: hidden !important;
}

.pg-8a9ea7e7-lightbox-content {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pg-8a9ea7e7-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    user-select: none;
    pointer-events: none;
}

/* Lightbox Close */
.pg-8a9ea7e7-lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    padding: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
}

.pg-8a9ea7e7-lightbox-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Lightbox Arrows */
.pg-8a9ea7e7-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ffffff;
    font-size: 60px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    user-select: none;
}

.pg-8a9ea7e7-lightbox-nav:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.pg-8a9ea7e7-lightbox-prev {
    left: 24px;
}

.pg-8a9ea7e7-lightbox-next {
    right: 24px;
}

@media screen and (max-width: 767px) {
    .pg-8a9ea7e7-lightbox-nav {
        font-size: 40px;
        padding: 8px;
    }
    .pg-8a9ea7e7-lightbox-prev {
        left: 8px;
    }
    .pg-8a9ea7e7-lightbox-next {
        right: 8px;
    }
    .pg-8a9ea7e7-lightbox-close {
        top: 12px;
        right: 12px;
    }
}
