.gallery-header {
    padding: 120px 0 50px;
    text-align: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gallery-title {
    font-size: 2.8rem;
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, #999 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.gallery-subtitle {
    color: var(--text-gray);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.gallery-section {
    padding: 50px 0 80px;
}

.filter-container {
    margin-bottom: 45px;
}


.filter-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-trigger i:first-child {
    color: var(--primary-color);
    margin-right: 12px;
}

.filter-trigger i:last-child {
    transition: transform 0.3s ease;
}

.filter-trigger.active i:last-child {
    transform: rotate(180deg);
}


.filter-bar-desktop {
    display: none;
}

.bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2500;
    pointer-events: none;
}

.bottom-sheet.active {
    pointer-events: auto;
}

.bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bottom-sheet.active .bottom-sheet-overlay {
    opacity: 1;
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    padding: 25px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 70vh;
    overflow-y: auto;
}

.bottom-sheet.active .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-sheet-header h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
}

.bottom-sheet-close {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-light);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bottom-sheet-close:hover {
    background: var(--primary-color);
    color: #000;
    transform: rotate(90deg);
}

.bottom-sheet-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-gray);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.filter-option span {
    flex: 1;
    text-align: left;
}

.filter-option i {
    opacity: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.filter-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
}

.filter-option.active {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--primary-color);
    color: var(--text-light);
}

.filter-option.active i {
    opacity: 1;
}

.gallery-masonry {
    column-count: 1;
    column-gap: 20px;
    padding-bottom: 50px;
    min-height: 300px;
}

.masonry-item {
    position: relative;
    margin-bottom: 20px;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    will-change: transform, opacity;
}

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


.masonry-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 40%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
}

.masonry-info {
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-category {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.masonry-info h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}


.masonry-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

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

.masonry-item:hover .masonry-overlay {
    opacity: 1;
}

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


.load-more-wrapper {
    text-align: center;
    margin: 36px 0;
}

.load-more-btn {
    background: #d4af37;
    color: #000;
    padding: 14px 32px;
    border-radius: 28px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: #f0c75e;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
}

#loadMoreBtn {
    display: none;
}


.gallery-empty {
    width: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.gallery-empty p {
    color: #999;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    max-width: 400px;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    object-fit: contain;
    animation: zoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}


.lightbox-close {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 2001;
}

.lightbox-close:hover {
    background: var(--primary-color);
    color: #000;
    transform: rotate(90deg);
}


.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 2001;
}

.lightbox-prev {
    left: 25px;
}

.lightbox-next {
    right: 25px;
}

.lightbox-nav:hover {
    background: var(--primary-color);
    color: #000;
    transform: translateY(-50%) scale(1.1);
}


.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2001;
    max-width: 90%;
    text-align: center;
}

@media (min-width: 768px) {
    .gallery-header {
        padding: 140px 0 60px;
    }

    .gallery-title {
        font-size: 4rem;
    }

    .gallery-subtitle {
        font-size: 1.15rem;
    }

    .filter-trigger {
        display: none;
    }

    .bottom-sheet {
        display: none;
    }

    .filter-bar-desktop {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .filter-btn {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 8px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: var(--text-gray);
        padding: 13px 24px;
        border-radius: 50px;
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .filter-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--text-light);
        transform: translateY(-2px);
    }

    .filter-btn.active {
        background: var(--primary-color);
        color: #000;
        border-color: var(--primary-color);
        font-weight: 600;
        box-shadow: 0 8px 20px rgba(212, 175, 55, 0.25);
    }

    
    .gallery-masonry {
        column-count: 2;
        column-gap: 25px;
    }

    .masonry-item {
        margin-bottom: 25px;
    }

    .gallery-empty p {
        font-size: 1.1rem;
    }
}

@media (min-width: 1024px) {
    .gallery-section {
        padding: 60px 0 100px;
    }

    
    .gallery-masonry {
        column-count: 3;
        column-gap: 30px;
    }

    .masonry-item {
        margin-bottom: 30px;
    }

    .masonry-info h3 {
        font-size: 1.6rem;
    }
}

@media (min-width: 1440px) {
    
    .gallery-masonry {
        column-count: 4;
        column-gap: 35px;
    }

    .masonry-item {
        margin-bottom: 35px;
    }
}

@media (max-width: 767px) {
    .gallery-header {
        padding: 100px 0 40px;
    }

    .gallery-title {
        font-size: 2.5rem;
    }

    .gallery-subtitle {
        font-size: 0.95rem;
        padding: 0 10px;
    }

    .masonry-item {
        border-radius: 10px;
        margin-bottom: 15px;
    }

    .masonry-info h3 {
        font-size: 1.3rem;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }

    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .lightbox-prev {
        left: 15px;
    }

    .lightbox-next {
        right: 15px;
    }

    .lightbox-caption {
        bottom: 20px;
        font-size: 0.85rem;
        padding: 12px 20px;
    }

    .gallery-empty {
        min-height: 250px;
    }

    .gallery-empty p {
        font-size: 0.95rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .masonry-item,
    .masonry-item img,
    .masonry-overlay,
    .filter-btn,
    * {
        transition: none !important;
        animation: none !important;
    }
}


.filter-btn:focus-visible,
.filter-option:focus-visible,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible,
.load-more-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}