.shopglut-gallery {
    position: relative;
    margin-bottom: 2rem;
}

.shopglut-gallery-main {
    position: relative;
}

.shopglut-gallery-viewport {
    position: relative;
    margin-bottom: 20px;
    overflow: hidden;
}

.shopglut-gallery-wrapper {
    display: flex;
    transition: transform 0.3s ease;
}

.shopglut-gallery-slide {
    flex: 0 0 100%;
    display: none;
}

.shopglut-gallery-slide.active {
    display: block;
}

.shopglut-gallery-slide img {
    width: 100%;
    height: auto;
    display: block;
}

.shopglut-gallery-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
}

.shopglut-gallery-nav button {
    background: rgba(255,255,255,0.8);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background-color 0.3s;
}

.shopglut-gallery-nav button:hover {
    background: rgba(255,255,255,0.95);
}

.shopglut-thumbnails {
    display: flex;
    gap: var(--thumb-spacing);
    flex-wrap: wrap;
}

.shopglut-thumbnails .thumbnail {
    width: var(--thumb-width);
    cursor: pointer;
}

.shopglut-thumbnails img {
    width: 100%;
    height: auto;
    border: 1px solid var(--thumb-border);
    transition: all 0.3s ease;
    opacity: 0.6;
}

.shopglut-thumbnails .thumbnail.active img,
.shopglut-thumbnails .thumbnail:hover img {
    opacity: 1;
    border-color: var(--thumb-active-border);
}

/* Modal styles */
.shopglut-gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
}

.shopglut-gallery-modal.active {
    display: block;
}

.modal-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container {
    max-width: 90%;
    max-height: 90vh;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.modal-nav button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.modal-nav button:hover {
    background: rgba(255,255,255,0.3);
}


/* Vertical layout modifications */
.vertical-layout .shopglut-thumbnails {
    flex-direction: column;
    width: var(--thumb-width);
}

/* Responsive styles */
@media (max-width: 768px) {
    .vertical-layout .shopglut-thumbnails {
        flex-direction: row;
        width: 100%;
    }
    
    .shopglut-gallery-nav button {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}


.shopglut-gallery-slide img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}


.shopglut-gallery-slide .main-image {
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.shopglut-gallery-slide {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.shopglut-gallery-slide .main-image {
    width: 100%;
    height: auto;
    display: block;
    opacity: 1;
    transition: opacity 0.3s;
}

.shopglut-gallery-slide.zoom {
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100%;
    cursor: zoom-in;
}

.shopglut-gallery-slide.zoom:hover {
    background-size: 180%;
}

.shopglut-gallery-slide.zoom:hover .main-image {
    opacity: 0;
}

.shopglut-gallery-slide {
    position: relative;
}

.gallery-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    z-index: 5;
    transition: background-color 0.3s;
}

.gallery-icon:hover {
    background: rgba(255, 255, 255, 1);
}

.gallery-icon svg {
    display: block;
    width: 24px;
    height: 24px;
    color: #333;
}

.shopglut-gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
}

.shopglut-gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.shopglut-gallery-slide {
    position: relative;
}

.gallery-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    z-index: 5;
    transition: background-color 0.3s;
}

.gallery-icon:hover {
    background: rgba(255, 255, 255, 1);
}

.gallery-icon svg {
    display: block;
    width: 24px;
    height: 24px;
    color: #333;
}

.shopglut-gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
}

.shopglut-gallery-modal .modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.shopglut-gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
}

.shopglut-gallery-modal .modal-content {
    position: relative;
    width: 90vw;  /* Set fixed width */
    max-width: 1200px;  /* Maximum width */
    margin: 0 auto;  /* Center horizontally */
    height: 90vh;   /* Fixed height */
    position: absolute;  /* Position absolutely */
    top: 50%;      /* Center vertically */
    left: 50%;     /* Center horizontally */
    transform: translate(-50%, -50%);  /* Perfect centering */
}

.modal-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.shopglut-gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
}

.shopglut-gallery-modal .modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
}

.modal-image-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

/* Close button */
.modal-close {
    position: absolute;
    top: 5%;
    right: 20%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    color: #333;
    display: flex;
    justify-content: center;
}

/* Navigation - now positioned relative to modal-image-container */
.modal-nav {
    position: absolute;
    top: 50%;
    left: 175px;
    right: 175px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px; /* Add padding to move arrows away from image edges */
    pointer-events: none;
}

.modal-prev,
.modal-next {
    position: relative; /* Changed from absolute */
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    pointer-events: auto;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 -60px; /* Move arrows outside the image container */
}

.modal-prev {
    transform: translateX(-50%);
}

.modal-next {
    transform: translateX(50%);
}

/* Hover effects */
.modal-prev:hover,
.modal-next:hover,
.modal-close:hover {
    background: rgba(255, 255, 255, 1);
}


