:root {
    --masonry-gap-desktop: 20px;
    --masonry-gap-tablet: 16px;
    --masonry-gap-mobile: 16px;
    --masonry-gap: var(--masonry-gap-desktop);
    --masonry-columns: 3;
}

/* Gallery Container */
.gallery-filter-wrapper {
    max-width: 100%;
    margin: 1.25em 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Enhanced Filters */
.gallery-filters {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 1em;
    padding: 1.5625em;
    margin-bottom: 1.875em;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75em;
    margin-bottom: 0.9375em;
}

.filter-container label {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin: 0;
}

.filter-icon {
    font-size: 1.125rem;
}



/* Loading State */
.gallery-loading {
    text-align: center;
    padding: 3.75em 1.25em;
    background: white;
    border-radius: 0.75em;
    margin: 1.25em 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25em;
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 0.1875rem solid #f3f4f6;
    border-top: 0.1875rem solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

/* Enhanced Masonry Grid - Pure CSS Columns */
.masonry-grid {
    column-count: var(--masonry-columns);
    column-gap: var(--masonry-gap);
    width: 100%;
    margin-top: 1.875em;
}

.masonry-item {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: var(--masonry-gap);
    cursor: pointer;
    border-radius: 1em;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: white;
    box-sizing: border-box;
    opacity: 0;
    transform: scale(1);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-item.is-positioned {
    opacity: 1;
    transition: opacity 1s ease-in-out, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-item:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    transform: scale(1);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-item:hover img {
    transform: scale(1.05);
}

/* Image Overlay */
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    padding: 1.25em;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    line-height: 1.4;
    color: white;
    box-sizing: border-box;
}

.masonry-item:hover .image-overlay {
    transform: translateY(0);
}

.image-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375em;
}

.category-tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25em 0.5em;
    border-radius: 0.75em;
    font-size: 0.6875rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* No Images Message */
.no-images-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5em 1.25em;
    color: #6c757d;
    background: white;
    border-radius: 1em;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.no-images-icon {
    font-size: 4rem;
    margin-bottom: 1.25em;
    opacity: 0.5;
}

.no-images-message h3 {
    margin: 0 0 0.9375em 0;
    font-size: 1.5rem;
    color: #495057;
}

.no-images-message p {
    margin: 0;
    font-size: 1rem;
    max-width: 25em;
    margin: 0 auto;
    line-height: 1.6;
}

/* Pagination */
.pagination-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75em 1em;
    margin: 0.125em;
    background: white;
    border: 2px solid #dee2e6;
    color: #495057;
    text-decoration: none;
    border-radius: 0.625em;
    font-weight: 500;
    font-size: 0.933rem;
    min-width: 44px;
    height: 44px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.page-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
    text-decoration: none;
    transform: translateY(-2px);
}

.page-btn.active {
    background: linear-gradient(135deg, #0073aa, #005a87);
    border-color: #0073aa;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.page-btn.disabled {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

.page-btn.disabled:hover {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #adb5bd;
    transform: none;
    box-shadow: none;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 3.125em;
    height: 3.125em;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: all;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: scale(1);
}

/* Responsive Design - Pure CSS */
@media (max-width: 899px) {
    :root {
        --masonry-columns: 2;
        --masonry-gap: var(--masonry-gap-tablet);
    }

    .categories_filter .elementor-field-textual {
        min-width: 15.625em;
    }
}

@media (max-width: 599px) {
    :root {
        --masonry-columns: 1;
        --masonry-gap: var(--masonry-gap-mobile);
    }

    .categories_filter .elementor-field-textual {
        width: 100%;
        min-width: auto;
    }

    .pagination-buttons {
        gap: 0.25em;
    }

    .page-btn {
        padding: 0.625em 0.75em;
        font-size: 0.75rem;
        min-width: 36px;
        height: 36px;
    }

    .nav-btn {
        position: static;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .no-images-message {
        background: #34495e;
        color: #ecf0f1;
    }
}

.categories_filter {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
    margin-bottom: 1.25em;
}

.categories_filter .elementor-field-group {
    margin: 0;
    flex: 1 1 auto;
    min-width: 12.5em;
}

@media (max-width: 599px) {
    .categories_filter {
        flex-direction: column;
        gap: 0.75em;
    }

    .categories_filter .elementor-field-group {
        width: 100%;
        min-width: auto;
    }
}