/**
 * Modern Gallery Widget - Frontend Styles
 * 
 * @package BigBrandify Elementor Extension
 */

/* Base Gallery Styles */
.bbw-modern-gallery-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Prevent text selection while dragging */
.bbw-modern-gallery-wrapper.dragging-active {
    user-select: none;
    -webkit-user-select: none;
}

.bbw-modern-gallery-wrapper.dragging-active * {
    cursor: grabbing !important;
}

/* Gallery Container */
.bbw-modern-gallery-wrapper .modern-gallery-container {
    width: 100%;
    position: relative;
}

/* Empty State Styles */
.bbw-modern-gallery-wrapper .gallery-empty-state {
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    margin: 20px 0;
}

.bbw-modern-gallery-wrapper .gallery-empty-state p {
    margin: 0;
    font-size: 16px;
    color: #6c757d;
}

/* Error State Styles */
.bbw-modern-gallery-wrapper.gallery-error-state {
    opacity: 0.8;
}

.bbw-modern-gallery-wrapper .gallery-error-message {
    padding: 40px 20px;
    text-align: center;
    background: #fff5f5;
    border: 2px solid #fed7d7;
    border-radius: 8px;
    margin: 20px 0;
}

.bbw-modern-gallery-wrapper .gallery-error-message p {
    margin: 0;
    font-size: 16px;
    color: #c53030;
}

/* Filter Navigation Styles */
/* Filter Navigation Styles - Inline with horizontal scrolling */
.bbw-modern-gallery-wrapper .gallery-filters {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}

.bbw-modern-gallery-wrapper .gallery-filters.filter-position-bottom {
    margin-bottom: 0;
    margin-top: 30px;
}

/* Old filter button styles removed - replaced with bbw-filter-button */

/* Gallery Layout Base Styles (to be expanded) */
.bbw-modern-gallery-wrapper .gallery-content {
    position: relative;
    width: 100%;
}

/* Carousel Layout Styles */
.bbw-modern-gallery-wrapper .gallery-carousel {
    position: relative;
    overflow: hidden;
}

.bbw-modern-gallery-wrapper .carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.bbw-modern-gallery-wrapper .carousel-track {
    display: flex;
    position: relative;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    cursor: grab;
}

.bbw-modern-gallery-wrapper.dragging-active .carousel-track {
    cursor: grabbing;
}

.bbw-modern-gallery-wrapper .carousel-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

/* Navigation positioning */
.bbw-modern-gallery-wrapper .carousel-navigation.nav-position-top {
    order: -1;
    margin-top: 0;
    margin-bottom: 20px;
}

.bbw-modern-gallery-wrapper .carousel-navigation.nav-position-bottom {
    order: 1;
    margin-top: 20px;
    margin-bottom: 0;
}

.bbw-modern-gallery-wrapper .carousel-navigation.nav-align-left {
    justify-content: flex-start;
}

.bbw-modern-gallery-wrapper .carousel-navigation.nav-align-center {
    justify-content: center;
}

.bbw-modern-gallery-wrapper .carousel-navigation.nav-align-right {
    justify-content: flex-end;
}

.bbw-modern-gallery-wrapper .nav-arrow {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.bbw-modern-gallery-wrapper .nav-arrow svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: all 0.3s ease;
}

.bbw-modern-gallery-wrapper .nav-arrow i {
    font-size: 20px;
    line-height: 1;
}

.bbw-modern-gallery-wrapper .nav-arrow:hover {
    background: #fff;
    transform: translateY(-2px);

}

.bbw-modern-gallery-wrapper .nav-arrow:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Grid Layout Styles */
.bbw-modern-gallery-wrapper .gallery-grid {
    display: grid;
    gap: var(--grid-spacing, 20px);
    grid-template-columns: repeat(var(--grid-columns, 3), 1fr);
    width: 100%;
    position: relative;
}

/* Grid auto-fit for better responsiveness */
@supports (grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))) {
    .bbw-modern-gallery-wrapper .gallery-grid.auto-fit {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Layout Mode Specific Adjustments */
.bbw-modern-gallery-wrapper[data-layout="carousel"] .gallery-grid {
    display: none;
}

.bbw-modern-gallery-wrapper[data-layout="grid"] .gallery-carousel {
    display: none;
}

/* Custom Cursor Base (to be expanded) */
.bbw-modern-gallery-wrapper .custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: rgba(25, 25, 25, 0.9);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    transform: translate3d(0, 0, 0) scale(0);
    opacity: 0;
    transition: transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                opacity 0.2s ease;
    z-index: 10000;
    will-change: transform, opacity;
}

.bbw-modern-gallery-wrapper .custom-cursor.active {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
}

.bbw-modern-gallery-wrapper .custom-cursor.dragging {
    transform: translate3d(0, 0, 0) scale(0.9);
    background-color: rgba(0, 0, 0, 1);
}

/* Hide custom cursor on touch devices */
@media (pointer: coarse) {
    .bbw-modern-gallery-wrapper .custom-cursor {
        display: none;
    }
}

/* Gallery Item Styles */
.bbw-modern-gallery-wrapper .gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px;
    background: #f8f9fa;
}

.bbw-modern-gallery-wrapper .gallery-item .image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Aspect ratio support */
.bbw-modern-gallery-wrapper .gallery-item .image-wrapper[style*="aspect-ratio"] {
    height: auto;
}

.bbw-modern-gallery-wrapper .gallery-item .image-wrapper[style*="aspect-ratio"] img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bbw-modern-gallery-wrapper .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

/* Removed zoom effect as requested */
/* Removed zoom effects as requested */

/* Carousel specific styles */
.bbw-modern-gallery-wrapper .carousel-item {
    flex-shrink: 0;
    width: calc((100vw - 100px) / 3.5);
    max-width: 350px;
    min-width: 250px;
    height: 400px;
    margin-right: 20px;
    position: relative;
}

.bbw-modern-gallery-wrapper .carousel-item .image-wrapper {
    overflow: hidden;
    background-color: #f0f0f0;
    height: 100%;
    position: relative;
}

/* Enhanced image setup for parallax */
.bbw-modern-gallery-wrapper .carousel-item img {
    position: absolute;
    width: 140%;
    max-width: 140vw !important;
    height: 120%;
    top: -10%;
    left: -30%;
    object-fit: cover;
    will-change: transform;
}

/* Grid specific styles */
.bbw-modern-gallery-wrapper .grid-item {
    aspect-ratio: 1;
    min-height: 200px;
    width: 100%;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Grid item visibility states */
.bbw-modern-gallery-wrapper .grid-item.grid-item-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Infinite scroll sentinel */
.bbw-modern-gallery-wrapper .infinite-scroll-sentinel {
    height: 1px;
    width: 100%;
    pointer-events: none;
}

.bbw-modern-gallery-wrapper .grid-item.grid-initialized {
    opacity: 1;
    transform: translateY(0);
}

.bbw-modern-gallery-wrapper .grid-item.is-in-view {
    opacity: 1;
    transform: translateY(0);
}

.bbw-modern-gallery-wrapper .grid-item.grid-item-hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.bbw-modern-gallery-wrapper .grid-item .image-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;
}

.bbw-modern-gallery-wrapper .grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Removed zoom effect as requested */

/* Responsive carousel adjustments */
@media (max-width: 1024px) {
    .bbw-modern-gallery-wrapper .carousel-item {
        width: calc((100vw - 80px) / 2.5);
        margin-right: 15px;
    }
}

@media (max-width: 768px) {
    .bbw-modern-gallery-wrapper .carousel-item {
        width: calc((100vw - 60px) / 1.3);
        margin-right: 10px;
    }
    
    .bbw-modern-gallery-wrapper .carousel-navigation {
        margin-top: 15px;
        gap: 10px;
    }
    
    .bbw-modern-gallery-wrapper .nav-arrow {
        width: 40px;
        height: 40px;
    }
    
    /* Grid responsive adjustments */
    .bbw-modern-gallery-wrapper .gallery-grid {
        gap: var(--grid-spacing, 15px);
    }
    
    .bbw-modern-gallery-wrapper .grid-item {
        min-height: 180px;
    }
}

@media (max-width: 480px) {
    .bbw-modern-gallery-wrapper .gallery-grid {
        gap: var(--grid-spacing, 10px);
    }
    
    .bbw-modern-gallery-wrapper .grid-item {
        min-height: 150px;
    }
    
    .bbw-modern-gallery-wrapper .grid-item.grid-item-hover {
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
}

/* Enhanced filter animation states */
.bbw-modern-gallery-wrapper .gallery-item {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform, opacity;
}

.bbw-modern-gallery-wrapper .gallery-item.filtered-out {
    opacity: 0;
    /* Removed zoom intro animation as requested */
    pointer-events: none;
    visibility: hidden;
}

.bbw-modern-gallery-wrapper .gallery-item.filtered-in {
    opacity: 1;
    /* Removed zoom intro animation as requested */
    pointer-events: auto;
    visibility: visible;
}

/* Grid-specific filter animations with position preservation */
.bbw-modern-gallery-wrapper .gallery-grid .gallery-item.filtered-out {
    transform: translateY(20px);
    margin: 0; /* Remove margins during transition to prevent layout shifts */
}

.bbw-modern-gallery-wrapper .gallery-grid .gallery-item.filtered-in {
    transform: translateY(0);
}

/* Carousel-specific filter animations */
.bbw-modern-gallery-wrapper .gallery-carousel .gallery-item.filtered-out {
    transform: translateX(-20px);
    width: 0; /* Collapse width to prevent blank spaces */
    margin: 0;
    overflow: hidden;
}

.bbw-modern-gallery-wrapper .gallery-carousel .gallery-item.filtered-in {
    transform: translateX(0);
}

/* Smooth grid repositioning during filtering */
.bbw-modern-gallery-wrapper .gallery-grid.filtering {
    transition: grid-template-columns 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.bbw-modern-gallery-wrapper .gallery-grid.filtering .gallery-item {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1), 
                grid-column 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                grid-row 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Prevent layout shifts during filtering */
.bbw-modern-gallery-wrapper.filtering {
    overflow: hidden;
}

.bbw-modern-gallery-wrapper.filtering .gallery-item.filtered-out {
    position: absolute;
    z-index: -1;
}

/* Loading States */
.bbw-modern-gallery-wrapper .gallery-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Lazy Loading States */
.bbw-modern-gallery-wrapper .lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bbw-modern-gallery-wrapper .lazy-image.lazy-loading {
    opacity: 0.3;
}

.bbw-modern-gallery-wrapper .lazy-image.lazy-loaded {
    opacity: 1;
}

.bbw-modern-gallery-wrapper .lazy-image.lazy-error {
    opacity: 0.5;
    background: #f8f9fa url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/></svg>') center/50px no-repeat;
}

/* Image placeholder while loading */
.bbw-modern-gallery-wrapper .image-wrapper {
    position: relative;
    background: #f0f0f0;
}

.bbw-modern-gallery-wrapper .image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Hide loading animation when image is loaded */
.bbw-modern-gallery-wrapper .image-wrapper:has(.lazy-loaded)::before,
.bbw-modern-gallery-wrapper .image-wrapper:has(img:not(.lazy-image))::before {
    opacity: 0;
}

/* Fallback for browsers that don't support :has() */
.bbw-modern-gallery-wrapper .gallery-item.image-loaded .image-wrapper::before {
    opacity: 0;
}

/* Overlay styles */
.bbw-modern-gallery-wrapper .image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.bbw-modern-gallery-wrapper .gallery-item:hover .image-wrapper::after {
    opacity: 1;
}

/* Elementor Editor Compatibility */
.elementor-editor-active .bbw-modern-gallery-wrapper .custom-cursor {
    display: none;
}

/* Performance optimizations */
.bbw-modern-gallery-wrapper * {
    box-sizing: border-box;
}

.bbw-modern-gallery-wrapper .gallery-item img {
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Accessibility improvements */
.bbw-modern-gallery-wrapper .gallery-item:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Grid Navigation Styles */
.bbw-modern-gallery-wrapper .grid-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
}

/* Duplicate removed - using consolidated styles below */

.bbw-modern-gallery-wrapper .load-more-button .button-loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Remove hover animation from navigation arrows */
.bbw-modern-gallery-wrapper .nav-arrow {
    padding: 12px 24px;
    transition: all 0.3s ease;
}

.bbw-modern-gallery-wrapper .nav-arrow:hover {
    animation: none;
    transform: translateY(-2px);
}

/* Button container padding */
.bbw-modern-gallery-wrapper .gallery-filters,
.bbw-modern-gallery-wrapper .grid-navigation,
.bbw-modern-gallery-wrapper .carousel-navigation {
    padding: 10px;
}

/* Mobile filter buttons - inline scrollable with gradient corners */
@media (max-width: 768px) {
    .bbw-modern-gallery-wrapper .gallery-filters {
        display: flex;
        flex-direction: row;
        gap: 8px;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 15px 25px;
        margin: 0 -25px 30px -25px;
        position: relative;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    .bbw-modern-gallery-wrapper .gallery-filters::-webkit-scrollbar {
        display: none;
    }
    
    /* Enhanced gradient fade effect on corners */
    .bbw-modern-gallery-wrapper .gallery-filters::before,
    .bbw-modern-gallery-wrapper .gallery-filters::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 30px;
        pointer-events: none;
        z-index: 3;
    }
    
    /* .bbw-modern-gallery-wrapper .gallery-filters::before {
        left: 0;
        background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%);
    }
    
    .bbw-modern-gallery-wrapper .gallery-filters::after {
        right: 0;
        background: linear-gradient(to left, rgba(255,255,255,1) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%);
    } */
    
    .bbw-modern-gallery-wrapper .bbw-filter-button {
        flex-shrink: 0;
        white-space: nowrap;
        min-width: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .bbw-modern-gallery-wrapper .gallery-grid {
        gap: 15px;
    }
    
    .bbw-modern-gallery-wrapper .load-more-button {
        padding: 12px 24px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .bbw-modern-gallery-wrapper .gallery-placeholder {
        padding: 30px 15px;
    }
    
    .bbw-modern-gallery-wrapper .gallery-placeholder p {
        font-size: 16px;
    }
}/*
 Image Intro Animation - Blurred Fade-Up Effect */
.bbw-modern-gallery-wrapper .gallery-item.image-intro-animation {
    animation: blurredFadeUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes blurredFadeUp {
    0% {
        opacity: 0;
        transform: translate3d(0, 20px, 0) scale(0.9);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0px);
    }
}

/* Smooth filtering transitions */
.bbw-modern-gallery-wrapper.filtering .gallery-item {
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.bbw-modern-gallery-wrapper .gallery-item.filtered-out {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.bbw-modern-gallery-wrapper .gallery-item.filtered-in {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Sticky Filter Navigation */
.bbw-modern-gallery-wrapper .gallery-filters.sticky-enabled {
    position: relative;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.bbw-modern-gallery-wrapper .gallery-filters.sticky-active {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: calc(100vw - 40px);
    overflow-x: auto;
    white-space: nowrap;
}

.bbw-modern-gallery-wrapper .gallery-filters.sticky-active::-webkit-scrollbar {
    height: 4px;
}

.bbw-modern-gallery-wrapper .gallery-filters.sticky-active::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.bbw-modern-gallery-wrapper .gallery-filters.sticky-active::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

.bbw-modern-gallery-wrapper .gallery-filters.sticky-active::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Sticky filter positioning classes */
.bbw-modern-gallery-wrapper .gallery-filters.sticky-position-top {
    top: var(--sticky-offset, 20px);
}

.bbw-modern-gallery-wrapper .gallery-filters.sticky-position-bottom {
    bottom: var(--sticky-offset, 20px);
}

.bbw-modern-gallery-wrapper .gallery-filters.sticky-align-left {
    left: var(--sticky-offset, 20px);
}

.bbw-modern-gallery-wrapper .gallery-filters.sticky-align-center {
    left: 50%;
    transform: translateX(-50%);
}

.bbw-modern-gallery-wrapper .gallery-filters.sticky-align-right {
    right: var(--sticky-offset, 20px);
}

/* Sticky filter buttons in horizontal scroll */
.bbw-modern-gallery-wrapper .gallery-filters.sticky-active .filter-button {
    display: inline-block;
    margin-right: 10px;
    flex-shrink: 0;
}

.bbw-modern-gallery-wrapper .gallery-filters.sticky-active .filter-button:last-child {
    margin-right: 0;
}

/* Enhanced filter button animations - controlled by Elementor */

/* Improved grid item transitions */
.bbw-modern-gallery-wrapper .gallery-grid.filtering .grid-item {
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}



/* Responsive adjustments for sticky filters */
@media (max-width: 768px) {
    .bbw-modern-gallery-wrapper .gallery-filters.sticky-active {
        padding: 10px 15px;
        max-width: calc(100vw - 20px);
    }
    
    .bbw-modern-gallery-wrapper .gallery-filters.sticky-align-center {
        left: 10px;
        right: 10px;
        transform: none;
        width: calc(100% - 20px);
    }
}

/* Performance optimizations */
.bbw-modern-gallery-wrapper .gallery-item {
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.bbw-modern-gallery-wrapper .gallery-item img {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}/* Consolid
ated Image Intro Animation - Default Blurred Fade-Up Effect */
.bbw-modern-gallery-wrapper .gallery-item {
    opacity: 0;
    transform: translate3d(0, 20px, 0) scale(0.9);
    filter: blur(4px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.bbw-modern-gallery-wrapper .gallery-item.image-loaded,
.bbw-modern-gallery-wrapper .gallery-item.grid-item-visible,
.bbw-modern-gallery-wrapper .gallery-item.filtered-in {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0px);
}

/* Filter Loading Overlay */
.bbw-modern-gallery-wrapper .filter-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.bbw-modern-gallery-wrapper .filter-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bbw-modern-gallery-wrapper .filter-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 124, 186, 0.2);
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: filterSpinner 1s linear infinite;
}

@keyframes filterSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Blank Slate Filter Button Classes with Minimal Defaults */
.bbw-modern-gallery-wrapper .bbw-filter-button {
    /* Essential functional styles only */
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    box-sizing: border-box;
    /* Minimal default styling - all changeable through Elementor */
    padding: 15px;
    border: none;
    border-bottom: 1px solid transparent;
    background: transparent;
    color: #333333; /* Dark text */
    font: inherit;
    margin: 0;
    outline: none;
    /* Remove browser defaults */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Remove any shadows or effects */
    box-shadow: none;
    text-shadow: none;
    transform: none;
    transition: all 0.3s ease;
}

.bbw-modern-gallery-wrapper .bbw-filter-button:focus {
    /* Basic focus outline for accessibility */
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
x
/* Active state with minimal default styling */
.bbw-modern-gallery-wrapper .bbw-filter-button.active {
    background: #ffffff; /* White background for active */
    border-bottom-color: #007cba; /* Primary Elementor color */
    color: #333333; /* Dark text */
}



/* Ensure no hover effects by default */
.bbw-modern-gallery-wrapper .bbw-filter-button:hover {
    /* No default hover effects - controlled by Elementor */
}

/* Remove any pseudo-elements that might add effects */
.bbw-modern-gallery-wrapper .bbw-filter-button::before,
.bbw-modern-gallery-wrapper .bbw-filter-button::after {
    display: none;
}

/* Loading state */
.bbw-modern-gallery-wrapper .bbw-filter-button.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Horizontally Scrolling Filter Navigation */
.bbw-modern-gallery-wrapper .gallery-filters {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 10px 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.bbw-modern-gallery-wrapper .gallery-filters::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.bbw-modern-gallery-wrapper .gallery-filters.filter-position-bottom {
    margin-bottom: 0;
    margin-top: 30px;
}

/* Sticky Navigation Specific Styles */
.bbw-modern-gallery-wrapper .gallery-filters.sticky-active {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: calc(100vw - 40px);
}

/* Sticky State Button Styles - Controlled by Elementor */

/* Responsive adjustments - Container only */
@media (max-width: 768px) {
    .bbw-modern-gallery-wrapper .gallery-filters {
        gap: 10px;
        padding: 5px 0;
    }
    
    .bbw-modern-gallery-wrapper .gallery-filters.sticky-active {
        padding: 10px 15px;
        max-width: calc(100vw - 20px);
    }
}/
* Sticky Filter Navigation */
.bbw-modern-gallery-wrapper .gallery-filters.sticky-active {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Auto-hide animation for sticky filters - slide down out of view */
.bbw-modern-gallery-wrapper .gallery-filters.sticky-active.sticky-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Smooth show animation - slide up into view */
.bbw-modern-gallery-wrapper .gallery-filters.sticky-active:not(.sticky-hidden) {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Load More Button Styles */
/* Load More Button Base Styles - Minimal defaults that can be overridden by Elementor */
.bbw-modern-gallery-wrapper .load-more-button {
    display: inline-block;
    padding: 12px 24px;
    background: #007cba;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 20px 0 0 0;
    position: relative;
    overflow: hidden;
    outline: none;
    line-height: 1.4;
}

.bbw-modern-gallery-wrapper .load-more-button:hover {
    background: #005a87;
}

.bbw-modern-gallery-wrapper .load-more-button:disabled,
.bbw-modern-gallery-wrapper .load-more-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.bbw-modern-gallery-wrapper .load-more-container {
    text-align: center;
    margin-top: 30px;
}

/* Loading spinner for load more button */
.bbw-modern-gallery-wrapper .load-more-button .button-loading {
    display: none;
}

.bbw-modern-gallery-wrapper .load-more-button.loading .button-text {
    display: none;
}

.bbw-modern-gallery-wrapper .load-more-button.loading .button-loading {
    display: inline-block;
}

.bbw-modern-gallery-wrapper .load-more-button .button-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: loadMoreSpin 1s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes loadMoreSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}/* Filter
 Button Border Dimensions Support */
.bbw-modern-gallery-wrapper .bbw-filter-button {
    /* Base styles for filter buttons */
    display: inline-block;
    padding: 15px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 5px;
    border-radius: 4px;
}

/* Filter button border styles - Elementor DIMENSIONS control will override these */
.bbw-modern-gallery-wrapper .bbw-filter-button {
    border-style: solid;
    border-width: 2px; /* Default fallback, will be overridden by Elementor */
}

.bbw-modern-gallery-wrapper .bbw-filter-button.active {
    background: white;
    color: #333333;
}

/* Ensure filter buttons remain inline on all devices */
.bbw-modern-gallery-wrapper .gallery-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.bbw-modern-gallery-wrapper .gallery-filters::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.bbw-modern-gallery-wrapper .bbw-filter-button {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .bbw-modern-gallery-wrapper .gallery-filters {
        padding: 0 10px;
    }
    
    .bbw-modern-gallery-wrapper .bbw-filter-button {
        margin: 0 3px;
        padding: 12px;
        font-size: 14px;
    }
}