/* -- Gallery Filter -- */
.gallery-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}
.gallery-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all .3s;
}
.gallery-filter-btn svg {
    flex-shrink: 0;
    transition: stroke .3s;
}
.gallery-filter-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: #fafafa;
}
.gallery-filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}
.gallery-filter-btn.active svg {
    stroke: #fff;
}

/* Active Label + Count */
.gallery-active-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 .5%;
}
.gallery-active-text {
    font-size: .85rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.gallery-count {
    font-size: .85rem;
    font-weight: 600;
    color: #aaa;
}

/* -- Gallery Core -- */
.gallery-wrapper {
    position: relative;
    max-width: 1450px;
    width: 100%;
    margin: 0 auto;
}
.gallery-message {
    font-size: 1.1rem;
    text-align: center;
    padding-top: 85px;
}
.gallery-loader {
    position: absolute;
    top: 160px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    border: 5px solid #eee;
    border-top-color: var(--accent-color);
    transition: opacity .4s;
    animation: spin .75s linear infinite;
}
.gallery-loader.gallery-fade-out {
    opacity: 0;
    pointer-events: none;
}
@keyframes spin {
    to { transform: translateX(-50%) rotate(360deg); }
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    transform: translateY(50px);
    opacity: 0;
    min-height: 500px;
    transition: transform .4s, opacity .4s;
}
.gallery-fade-in {
    transform: translateY(0);
    opacity: 1;
}
.gallery-fade-out {
    opacity: 0;
}
.gallery-item {
    position: relative;
    width: 24%;
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px .5% 0;
    border-radius: 8px;
}
.gallery-item img {
    width: auto;
    height: 115%;
    transition: opacity .4s, transform .4s;
}
.gallery-item img.vertical-img {
    width: 115%;
    height: auto;
}
.gallery-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    fill: #111;
    opacity: 0;
    transition: opacity .4s;
}
.gallery-item:hover .gallery-icon {
    opacity: 1;
}
.gallery-item:hover img {
    opacity: .6;
    transform: scale(1.05);
}

/* Empty State */
.gallery-empty {
    width: 100%;
    text-align: center;
    padding: 80px 20px;
    color: #999;
}
.gallery-empty svg {
    display: block;
    margin: 0 auto 15px;
    stroke: #ccc;
}
.gallery-empty p {
    font-size: 1rem;
    font-weight: 500;
}

@media screen and (max-width: 1200px) {
    .gallery-item {
        width: 32.3333333333%;
    }
}

@media screen and (max-width: 900px) {
    .gallery-item {
        width: 49%;
    }
    .gallery-filter {
        gap: 8px;
    }
    .gallery-filter-btn {
        padding: 8px 14px;
        font-size: .82rem;
    }
}

@media screen and (max-width: 600px) {
    .gallery-item,
    .gallery-item img {
        width: 100%;
        height: auto;
    }
    .gallery-filter-btn span {
        display: none;
    }
    .gallery-filter-btn {
        padding: 10px 14px;
    }
    .gallery-active-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}