.owl-item img {
    border-radius: 5px !important;
}
.main-carousel {
	margin-bottom: 10px;
}
.owl-carousel .owl-nav .owl-next, .owl-carousel .owl-nav .owl-prev {
    background: #ffffff !important;
    width: 24px;
    height: 24px;
    border-radius: 50% !important;
    position: absolute;
    top: 43%;
}
.owl-carousel .owl-nav .owl-next {
	right: 20px;
}
.owl-carousel .owl-nav .owl-prev {
	left: 20px;
}
.owl-carousel .owl-nav button.owl-next span, .owl-carousel .owl-nav button.owl-prev span {
    color: #000000 !important;
    font-size: 0px;
    padding: 0px !important;
    line-height: normal !important;
}
.owl-carousel .owl-nav button span {
	font-size: 0px;
}
.owl-carousel .owl-nav button.owl-next,
.owl-carousel .owl-nav button.owl-prev {
	font-family: "Font Awesome 6 Free" !important;
    line-height: 24px !important; 	
}
.owl-carousel .owl-nav button.owl-next:before {
    content: "\f054";
	font-size: 16px;
	color: #000000;
}
.owl-carousel .owl-nav button.owl-prev:before {
	content: "\f053";
	font-size: 16px;
	color: #000000;
}

/* CSS for Thumbnail Carousel */
.owl-carousel.thumbnail-carousel .thumb-item {
    width: auto;
    overflow: hidden;
}
.owl-carousel.thumbnail-carousel .thumb-item img {
    width: 100%;
    height: auto;
    object-fit: contain; /* Changed from cover to contain for uncropped thumbnails */
    border-radius: 10px !important;
    border: solid 1px #000000;
    background-color: #f5f5f5; /* Add background for images that don't fill the space */
}
/* Basic Pagination Styling */
.owl-carousel button.owl-dot {
    width: 12px;
    height: 12px;
    background-color: #000000;
    border-radius: 50%;
    margin: 2px;
}
.owl-carousel .owl-dots {
	text-align: center;
}

/* Gallery Wrapper Styles */
.cgc-gallery-wrapper {
    width: 100%;
    clear: both;
}

/* Left Thumbnail Style */
.cgc-gallery-wrapper.thumbnail-style-left {
    display: flex;
    /* gap is now set dynamically via inline styles */
    align-items: flex-start;
}

.cgc-gallery-wrapper.thumbnail-style-left .cgc-thumbnails-container {
    flex: 0 0 78px;
    max-width: 78px;
}

.cgc-gallery-wrapper.thumbnail-style-left .cgc-main-container {
    flex: 1;
    min-width: 0;
}

.cgc-gallery-wrapper.thumbnail-style-left .thumbnail-list {
    display: flex;
    flex-direction: column;
    /* gap is now set dynamically via inline styles */
    overflow: hidden;
}

.cgc-gallery-wrapper.thumbnail-style-left .thumb-item {
    flex-shrink: 0;
}

.cgc-gallery-wrapper.thumbnail-style-left .thumb-item img {
    width: 78px;
    height: 78px;
    object-fit: contain; /* Changed from cover to contain for uncropped thumbnails */
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
    display: block;
    border-radius: 8px;
    background-color: #f5f5f5; /* Add background for images that don't fill the space */
}

.cgc-gallery-wrapper.thumbnail-style-left .thumb-item:hover img {
    opacity: 0.8;
    transform: scale(1.05);
}

.cgc-gallery-wrapper.thumbnail-style-left .thumb-item.active img {
    border: 1px solid #000;
    opacity: 1;
}

/* Bottom Thumbnail Style (Default) */
.cgc-gallery-wrapper.thumbnail-style-bottom .main-carousel {
    margin-bottom: 10px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .cgc-gallery-wrapper.thumbnail-style-left {
        flex-direction: column;
        gap: 10px !important;
    }

    .cgc-gallery-wrapper.thumbnail-style-left .cgc-thumbnails-container {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
        margin-bottom: 0;
        order: 2; /* Show thumbnails below on mobile */
        overflow: hidden;
    }

    .cgc-gallery-wrapper.thumbnail-style-left .cgc-main-container {
        order: 1; /* Show main image first on mobile */
        width: 100%;
    }

    .cgc-gallery-wrapper.thumbnail-style-left .thumbnail-list {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px !important;
        overflow: visible;
        padding: 0;
    }

    .cgc-gallery-wrapper.thumbnail-style-left .thumb-item {
        flex: 0 0 auto;
    }

    .cgc-gallery-wrapper.thumbnail-style-left .thumb-item img {
        width: 60px;
        height: 60px;
    }

    .cgc-gallery-wrapper.thumbnail-style-left .thumb-item .cgc-thumbnail-title {
        display: none; /* Hide titles on mobile for left style to save space */
    }
}

/* Tablet adjustments for left style */
@media (min-width: 768px) and (max-width: 1024px) {
    .cgc-gallery-wrapper.thumbnail-style-left .cgc-thumbnails-container {
        flex: 0 0 90px;
        max-width: 90px;
    }

    .cgc-gallery-wrapper.thumbnail-style-left .thumb-item img {
        width: 90px;
        height: 90px;
    }
}

/* Bottom style mobile adjustments */
@media (max-width: 767px) {
    .cgc-gallery-wrapper.thumbnail-style-bottom {
        width: 100%;
    }

    .cgc-gallery-wrapper.thumbnail-style-bottom .main-carousel {
        margin-bottom: 8px;
    }

    .cgc-gallery-wrapper.thumbnail-style-bottom .owl-carousel.thumbnail-carousel {
        padding: 0 5px;
    }

    .cgc-gallery-wrapper.thumbnail-style-bottom .thumb-item img {
        border-radius: 6px !important;
    }

    .cgc-gallery-wrapper.thumbnail-style-bottom .thumb-item .cgc-thumbnail-title {
        font-size: 7px;
        padding: 2px 3px;
        border-radius: 0 0 6px 6px;
    }
}

/* Image Title Styles */
.cgc-image-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.owl-carousel .item {
    position: relative;
}

.cgc-image-title:hover {
    opacity: 0.9;
}

@media (max-width: 767px) {
    .cgc-image-title {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* Thumbnail Title Styles */
.thumb-item {
    position: relative;
    overflow: hidden;
}

.cgc-thumbnail-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    padding: 4px 6px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 5;
    border-radius: 0 0 8px 8px;
}

.owl-carousel.thumbnail-carousel .thumb-item .cgc-thumbnail-title {
    border-radius: 0px;
}

@media (max-width: 767px) {
    .cgc-thumbnail-title {
        font-size: 8px;
        padding: 3px 4px;
    }
}

/* WooCommerce Variation Highlight Effect */
.cgc-variation-highlight {
    animation: cgc-variation-pulse 0.5s ease-out;
}

@keyframes cgc-variation-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(0, 123, 255, 0.2); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

.thumb-item.cgc-variation-active img {
    border-color: #007bff !important;
    border-width: 2px !important;
}