/* Main container for the product gallery */
.khsc-product-gallery-container {
    margin: 0 auto;
    box-sizing: border-box;
}

/* Two-column grid for thumbnails and main image */
.khsc-gallery-grid {
    display: grid;
    grid-template-columns: 80px 1fr; /* 80px for thumbnails, remaining space for main image */
    gap: 20px;
    align-items: flex-start;
}

/* New wrapper for thumbnails and navigation */
.khsc-thumbnails-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Navigation buttons (up/down) */
.khsc-thumbnail-nav {
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.khsc-thumbnail-nav:hover {
    opacity: 1;
}

.khsc-thumbnail-nav.disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.khsc-thumbnail-nav img {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* Rotate the icons correctly */
.khsc-thumb-nav-up img {
    transform: rotate(90deg); /* Rotates left arrow to up */
}

.khsc-thumb-nav-down img {
    transform: rotate(-90deg); /* Rotates left arrow to down */
}


/* Container for the scrollable list */
.khsc-thumbnails-list-container {
    max-height: 220px; /* Set to show 2.5 thumbnails */
    overflow: hidden;
    width: 100%;
}

/* Vertical list for thumbnails (the part that moves) */
.khsc-thumbnails-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.5s ease-in-out;
}

/* Each thumbnail item */
.khsc-thumbnail-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.3s ease;
    flex-shrink: 0; /* Prevent thumbnails from shrinking */
}

.khsc-thumbnail-item img {
    display: block;
    width: 100%;
    height: auto;
}

.khsc-thumbnail-item:hover {
    border-color: #e0e0e0;
}

.khsc-thumbnail-item.active {
    border-color: #161714;
}

/* Wrapper for the main image and zoom elements */
.khsc-main-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
}

/* Main product image */
.khsc-main-product-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 22px;
}

/* Zoom hint icon (magnifying glass) */
.khsc-zoom-hint {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.khsc-main-image-wrapper:hover .khsc-zoom-hint {
    opacity: 1;
}

.khsc-zoom-hint img {
    width: 20px;
    height: 20px;
}

/* The magnified view container (the "lens") */
.khsc-zoom-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid #161714;
    background-repeat: no-repeat;
    pointer-events: none;
    display: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Progress Bar for Autoplay */
.khsc-progress-bar {
    position: absolute;
    bottom: 0;
    right: 0; 
    height: 3px; /* Changed from 4px to 3px */
    width: 0; 
    background-color: #fefefe; /* Changed color */
}


/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .khsc-gallery-grid {
        grid-template-columns: 1fr;
    }

    .khsc-thumbnails-wrapper {
        order: 2;
    }

    .khsc-thumbnail-nav {
        display: none; /* Hide vertical nav on mobile */
    }

    .khsc-thumbnails-list-container {
        max-height: none;
        overflow: auto; /* Allow horizontal scrolling on mobile */
    }

    .khsc-thumbnails-list {
        flex-direction: row;
        margin-top: 15px;
        justify-content: flex-start;
    }
    
    .khsc-thumbnail-item {
        width: 60px;
    }

    .khsc-main-image-wrapper {
        order: 1;
    }

    .khsc-zoom-hint,
    .khsc-zoom-view {
        display: none !important;
    }
}

