.home-gallery-section {
    border-top: 1px solid var(--border);
    background: linear-gradient(135deg, #f8fafc 0%, var(--bg-alt) 100%);
    padding: 84px 0 72px;
    overflow: hidden;
    position: relative;
}

.home-gallery-section .section-header {
    margin-bottom: 36px;
    padding: 0 24px;
}

.home-gallery-viewport {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.home-gallery-track {
    display: flex;
    gap: 16px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    touch-action: pan-y;
    width: 100%;
}

.homepage-gallery-slide {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: var(--white);
    min-height: 260px;
    cursor: pointer;
    flex: 0 0 calc(25% - 12px);
    max-width: calc(25% - 12px);
    min-width: 0;
}

.homepage-gallery-slide .gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease, filter 0.45s ease;
    transform-origin: center;
    display: block;
}

.homepage-gallery-slide .gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.04) 0%, rgba(15, 23, 42, 0.82) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.homepage-gallery-slide:hover .gallery-img {
    transform: scale(1.05);
    filter: saturate(1.05);
}

.homepage-gallery-slide:hover .gallery-overlay {
    opacity: 1 !important;
}

.home-gallery-thumbs {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    padding: 18px 24px 0;
    width: 100%;
    scroll-behavior: smooth;
}

.homepage-gallery-thumb {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    opacity: 0.55;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.homepage-gallery-thumb.active {
    opacity: 1;
    border-color: var(--accent);
    transform: translateY(-2px);
}

.home-gallery-section .empty-catalog {
    max-width: 720px;
    margin: 0 auto;
    border-radius: 24px;
}

@media (max-width: 1024px) {
    .homepage-gallery-slide {
        flex: 0 0 calc(50% - 8px);
        max-width: calc(50% - 8px);
    }

    .home-gallery-thumbs {
        justify-content: flex-start;
        padding-inline: 16px;
    }
}

@media (max-width: 640px) {
    .home-gallery-section {
        padding: 72px 0 60px;
    }

    .home-gallery-section .section-header {
        padding: 0 16px;
    }

    .home-gallery-track {
        gap: 12px;
    }

    .homepage-gallery-slide {
        flex: 0 0 100%;
        max-width: 100%;
        border-radius: 18px;
        min-height: 240px;
    }

    .homepage-gallery-slide .gallery-overlay {
        padding: 18px;
    }

    .home-gallery-thumbs {
        padding: 16px 16px 0;
        gap: 8px;
    }

    .homepage-gallery-thumb {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }
}
