/* Gallery Styles */
.fh5co-section-gray {
    position: relative;
    padding: 40px 0;
}
.gallery-track {
    display: flex;
    gap: 20px; /* Increased gap for better spacing */
    padding: 20px 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    align-items: center; /* Vertical centering */
    touch-action: manipulation; /* Improve mobile response */
    scroll-snap-type: x mandatory;
}

.gallery-track img {
    flex: 0 0 auto;
    border-radius: 10px;
    pointer-events: auto !important; /* Force clickability */
    position: relative;
    z-index: 1;
    cursor: pointer;
    object-fit: contain; /* Show full image */
    scroll-snap-align: start;
    height: 40vh; /* Relative to viewport height */
    min-width: 300px; /* Minimum width constraint */
    max-width: 500px; /* Maximum width constraint */
    width: auto;
    aspect-ratio: var(--ar);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #f8f8f8;
}

.gallery-track img:hover {
    transform: scale(1.03);
}

@media (max-width: 768px) {
    .gallery-track img {
        height: 30vh;
        min-width: 200px;
        max-width: 300px;
    }
}

/* Keep existing modal styles */

/* Keep the rest of your modal styles the same */

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Modal Styles */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    text-align: center;
}

.current-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-prev {
    left: 20px;
}

.modal-prev::after {
    content: '';
    border: solid #fff;
    border-width: 0 3px 3px 0;
    display: inline-block;
    padding: 10px;
    transform: rotate(135deg);
}

.modal-next {
    right: 20px;
}

.modal-next::after {
    content: '';
    border: solid #fff;
    border-width: 0 3px 3px 0;
    display: inline-block;
    padding: 10px;
    transform: rotate(-45deg);
}

.download-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.download-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.download-btn:active {
    background: #e0e0e0;
    transform: scale(0.95);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
}

.download-btn .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background-color: rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}


@media (max-width: 768px) {
    .gallery-item {
        width: 250px;
        height: 160px;
    }
    
    .modal-nav {
        width: 40px;
        height: 40px;
    }
    
    .download-btn {
        bottom: 10px;
        right: 10px;
        padding: 8px 16px;
    }
}