/* Interactive Thumbnail Gallery Styles */

.gallery-wrapper {
    width: 95vw;
    height: 85vh;
    margin: 0 auto;
    max-width: 1600px;
    max-height: 95vh;
    position: relative;
    z-index: 10;
}

.thumbnails-container {
    width: 100%;
    height: 100%;
    position: relative;
    --barH: 12%;
    /* Slightly taller for better visibility */
    --gap: 15px;
    /* Vertical gap between main image and thumbnails */
    /* active zone height = 100% - barH - gap */
    /* perspective: 100px; - Removed to prevent visual gaps */
    /* perspective-origin: center center; - Removed */
    /* transform-style: preserve-3d; - Removed */
    overflow: hidden;
    /* Ensure clean edges */
    display: flex;
    justify-content: center;
    /* Center the thumbnails */
    align-items: flex-end;
    /* Align to bottom */
    gap: 4px;
    /* Small gap between thumbnails */
}

.thumbnails-container::after {
    /* the plate - REMOVED SHADOW AS REQUESTED */
    content: none;
    display: none;
}

.thumbnail-item {
    --w: 20%;
    display: block;
    /* width: var(--w); - Overridden for flexbox */
    height: var(--barH);
    /* position: absolute; - Overridden for flexbox */
    bottom: 0;
    /* left: var(--l); - Overridden for flexbox */
    transform-origin: top left;
    transition: transform 0.5s, bottom 0.6s, left 0.6s, width 0.3s, box-shadow 1s;
}

.thumbnail-item img {
    display: block;
    width: auto;
    /* Natural width */
    height: 100%;
    /* Fill height of bar */
    object-fit: contain;
    /* Show full image */
    transform: scale(1);
    /* create gaps removed */
}

[type="radio"].gallery-radio {
    display: none;
}

:checked+label.thumbnail-item {
    position: absolute;
    /* Take out of flow to cover */
    left: 0;
    bottom: calc(var(--barH) + var(--gap));
    width: 100% !important;
    /* Force full width */
    height: calc(100% - var(--barH) - var(--gap));
    box-shadow: 0 0 0 transparent;
    animation: expandAnim 2s 1;
    transition: transform 0.5s, bottom 0.6s, left 0.6s, width 0.3s, box-shadow 0s;
    border-radius: 20px !important;
    overflow: hidden !important;
    z-index: 20;
}

:checked+label.thumbnail-item img {
    object-fit: contain;
    width: 100%;
    /* Full width for active image */
    border-radius: 20px !important;
    transition: transform 0.4s ease, filter 0.4s ease, box-shadow 0.4s ease;
}

/* Hover effect on expanded image - Realce más pronunciado */
:checked+label.thumbnail-item:hover img {
    transform: scale(1.15);
    filter: brightness(1.1) contrast(1.05);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    cursor: zoom-in;
}

@keyframes expandAnim {
    from {
        transform: rotateY(6deg) rotateX(3deg);
    }
}

/* Inactive labels */
:not(:checked)+.thumbnail-item {
    position: relative;
    /* In normal flow */
    width: auto !important;
    /* content based width */
    left: auto !important;
    /* ignore abs positioning */
    flex: 0 0 auto;
    /* don't shrink */
    margin: 0;
    /* No gaps */
    /* transform: translate3d(0, 0, -5px); - Removed to prevent gaps */
    transform: none;
    pointer-events: auto;
    /* border-radius: 8px; - Removed as requested */
    border-radius: 0;
    overflow: hidden;
    margin: 0;
}

:not(:checked)+.thumbnail-item:hover {
    transform: translateY(-7px);
    /* Simplified hover */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s, bottom 0.6s, left 0.6s, width 0.3s;
}

:not(:checked)+.thumbnail-item img {
    object-fit: contain;
    /* Ensure they fit nicely */
    width: auto;
    height: 100%;
    /* ensure full view */
    transform: scale(1);
}

/* Floating Shapes Animation */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
    animation: floatShape 20s infinite linear;
}

.floating-shape.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--color-verde);
    top: -10%;
    left: -10%;
    animation-duration: 25s;
}

.floating-shape.shape-2 {
    width: 200px;
    height: 200px;
    background: #656d4a;
    bottom: 10%;
    right: -5%;
    animation-duration: 18s;
    animation-direction: reverse;
}

.floating-shape.shape-3 {
    width: 150px;
    height: 150px;
    border: 2px solid var(--color-verde);
    top: 40%;
    right: 15%;
    background: transparent;
    animation-duration: 22s;
}

.floating-shape.shape-logo {
    width: 400px;
    height: 400px;
    background-image: url('../img/isotipo-web.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    top: 20%;
    left: 20%;
    opacity: 0.15;
    /* Slightly more visible than shapes */
    animation-duration: 30s;
    background-color: transparent;
    border-radius: 0;
    /* Reset border radius for image */
}

.floating-shape.shape-logo-2 {
    width: 350px;
    height: 350px;
    background-image: url('../img/isotipo-web.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    bottom: 15%;
    right: 10%;
    opacity: 0.12;
    animation-duration: 35s;
    animation-direction: reverse;
    background-color: transparent;
    border-radius: 0;
}

@keyframes floatShape {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -50px) rotate(120deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }

    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* Responsive adjustments */
/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery-wrapper {
        width: 95vw;
        height: 80vh;
        min-height: 500px;
    }
}

@media (min-width: 1200px) {
    .gallery-wrapper {
        width: 90vw;
        height: 90vh;
        max-width: 1800px;
    }
}