/* --- General Styles --- */
.wpf-gallery-container {
    max-width: 920px;
    margin: auto;
}

/* --- Thumbnail Gallery (Desktop) --- */
.wpf-gallery-layout {
    display: flex;
    gap: 25px;
    width: 100%;
}

.wpf-gallery-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 35px;
    flex-shrink: 0;
    width: 100px;
    max-height: 80vh; /* Adaptive height - 80% of viewport */
    overflow-y: auto;
    padding: 5px 5px 5px 5px; /* Removed right padding that was hiding scrollbar */
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

/* Scrollbar styling */
.wpf-gallery-thumbnails::-webkit-scrollbar { 
    width: 6px; /* Increased from 3px for better visibility */
}

.wpf-gallery-thumbnails::-webkit-scrollbar-track {
    background: linear-gradient(180deg, rgba(34, 150, 208, 0.2) 0%, rgba(26, 117, 168, 0.2) 100%); /* Blue gradient with 20% opacity */
    border-radius: 3px;
}

.wpf-gallery-thumbnails::-webkit-scrollbar-thumb {
    background: #0d5a8a; /* Dark blue */
    border-radius: 3px;
}

.wpf-gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #2296D0; /* Lighter blue on hover */
}

.wpf-gallery-thumbnails {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #0d5a8a rgba(34, 150, 208, 0.2); /* Firefox: dark blue thumb, transparent blue track */
}

.wpf-gallery-thumbnails img {
    width: 100%;
    height: auto;
    border-radius: 0px;
    cursor: pointer;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.wpf-gallery-thumbnails img:hover { 
    border-color: #aaa; 
}

.wpf-gallery-thumbnails img.active-thumbnail {
    border:1px solid #313131;
    transform: scale(1.05);
}

.wpf-gallery-main-image {
    flex-grow: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.wpf-gallery-main-image img { 
    max-width: 100%; 
    height: auto; 
    border-radius: 0px; 
}

/* --- Carousel (Tablet & Mobile) --- */
.wpf-carousel-wrapper {
    width: 100%;
    position: relative;
}

.wpf-carousel-viewport {
    display: flex;
    overflow-x: auto;
    padding: 0 50px;
    gap: 15px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
}

.wpf-carousel-viewport::-webkit-scrollbar { 
    display: none; 
}

.wpf-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    position: relative;
    scroll-snap-align: center;
}

.wpf-carousel-slide img { 
    display: block; 
    width: 100%; 
    height: auto; 
    user-select: none; 
}

.wpf-carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #F7F6F1;
    border: none;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.wpf-carousel-button.prev { left: 0px; }
.wpf-carousel-button.next { right: 0px; }
.wpf-carousel-button img { width: 14px; height: 14px; }

/* --- Responsive Visibility Control --- */
/* By default, show thumbnails (desktop-first) and hide carousel */
.wpf-carousel-wrapper {
    display: none;
}

/* On screens 1024px wide or less, hide thumbnails and show carousel */
@media (max-width: 1024px) {
    .wpf-gallery-layout {
        display: none;
    }
    .wpf-carousel-wrapper {
        display: block;
    }
}