.gallery-masonry {
    columns: 4;
    column-gap: 1.5rem;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    display: block;
    transition: transform var(--transition-slow);
}

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

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.9) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.gallery-item-info h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
}

.gallery-item-info p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 1;
}

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

.lightbox-close svg {
    width: 24px;
    height: 24px;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

.lightbox-nav {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.lightbox-prev,
.lightbox-next {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary);
}

.lightbox-prev svg,
.lightbox-next svg {
    width: 24px;
    height: 24px;
}

.lightbox-counter {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: white;
}

@media (max-width: 1200px) {
    .gallery-masonry {
        columns: 3;
    }
}

@media (max-width: 768px) {
    .gallery-masonry {
        columns: 2;
    }
}

@media (max-width: 480px) {
    .gallery-masonry {
        columns: 1;
    }
}

.gallery-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 3rem;
}

.gallery-filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.gallery-filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.gallery-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.gallery-grid {
    display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.gallery-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.gallery-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gallery-card:hover .gallery-card-image img {
    transform: scale(1.1);
}

.gallery-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.gallery-card:hover .gallery-card-overlay {
    opacity: 1;
}

.gallery-card-overlay .btn {
    margin-bottom: 1rem;
}

.gallery-card-content {
    padding: 1.25rem;
}

.gallery-card-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(220, 38, 38, 0.1);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.gallery-card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.gallery-card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.gallery-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.gallery-card-meta svg {
    width: 14px;
    height: 14px;
    margin-right: 0.25rem;
}

.gallery-zoom {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 50%;
    color: white;
    transition: transform var(--transition-fast);
}

.gallery-card:hover .gallery-zoom {
    transform: scale(1.1);
}

.gallery-zoom svg {
    width: 24px;
    height: 24px;
}

.gallery-slider {
    position: relative;
    overflow: hidden;
}

.gallery-slider-track {
    display: flex;
    transition: transform 0.5s ease;
}

.gallery-slider-item {
    flex: 0 0 100%;
}

.gallery-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
}

.gallery-slider-nav:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.gallery-slider-nav.prev {
    left: 1rem;
}

.gallery-slider-nav.next {
    right: 1rem;
}

.gallery-slider-nav svg {
    width: 24px;
    height: 24px;
}

.gallery-slider-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.gallery-slider-dot {
    width: 10px;
    height: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.gallery-slider-dot:hover,
.gallery-slider-dot.active {
    background: var(--primary);
    border-color: var(--primary);
}

.gallery-compare {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.compare-item {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.compare-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compare-label {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--bg-overlay);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.gallery-fullscreen {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.98);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-fullscreen img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.gallery-fullscreen-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 1.5rem;
}

.gallery-fullscreen-close:hover {
    background: var(--primary);
}

.gallery-fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
}

.gallery-fullscreen-nav:hover {
    background: var(--primary);
}

.gallery-fullscreen-nav.prev {
    left: 2rem;
}

.gallery-fullscreen-nav.next {
    right: 2rem;
}

.gallery-fullscreen-info {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
}

.gallery-fullscreen-info h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.gallery-fullscreen-info p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-compare {
        grid-template-columns: 1fr;
    }
    
    .gallery-slider-nav {
        display: none;
    }
}
