.phmg-gallery {
    width: 100%;
    margin: 0 auto;
    padding: 10px 0;
}

.phmg-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    text-align: center;
}

.phmg-filter {
    border: 1px solid #ddd;
    background: #fff;
    color: #222;
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all .2s ease;
    font-size: 14px;
}

.phmg-filter.is-active,
.phmg-filter:hover {
    background: #222;
    border-color: #222;
    color: #fff;
}

.phmg-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.phmg-card {
    position: relative;
    overflow: hidden;
    border: 0;
    padding: 0;
    border-radius: 14px;
    background: #f5f5f5;
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

.phmg-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.phmg-card:hover img {
    transform: scale(1.04);
}

.phmg-actions {
    display: flex;
    justify-content: center;
    margin-top: 26px;
}

.phmg-load-more {
    align-items: center;
    justify-content: center;
    border: 1px solid #222;
    background: #222;
    color: #fff;
    border-radius: 999px;
    padding: 10px 22px;
    cursor: pointer;
    font-size: 14px;
    transition: opacity .2s ease;
}

.phmg-load-more:hover {
    opacity: .85;
}

.phmg-load-more[hidden] {
    display: none;
}

.phmg-loader {
    text-align: center;
    padding: 24px 0;
    color: #555;
}

.phmg-lightbox {
    position: fixed;
    z-index: 99999;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(0, 0, 0, .86);
    padding: 24px;
}

.phmg-lightbox[hidden] {
    display: none;
}

.phmg-lightbox-image {
    max-width: min(1100px, 92vw);
    max-height: 82vh;
    object-fit: contain;
    border-radius: 10px;
}

.phmg-lightbox-title {
    margin-top: 12px;
    color: #fff;
    font-size: 15px;
    text-align: center;
}

.phmg-lightbox-close {
    position: absolute;
    top: 16px;
    right: 22px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 991px) {
    .phmg-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .phmg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .phmg-filter {
        padding: 7px 12px;
        font-size: 13px;
    }
}
