.gallery-container {
    margin: 16px 0 0;
}

.gallery-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.gallery-item {
    flex: 0 0 calc(50% - 5px);
    aspect-ratio: 1 / 1;
    border: none;
    padding: 0;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease;
}

.gallery-row:has(.gallery-item:nth-child(3)) .gallery-item {
    flex: 0 0 calc(33.333% - 7px);
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.gallery-modal-content {
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 38px;
    color: white;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.gallery-modal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #000;
}

.current-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.gallery-nav {
    position: absolute;
    bottom: 120px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 30px;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
}

.image-counter {
    color: white;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 12px;
    border-radius: 18px;
}

.gallery-thumbnails {
    height: 100px;
    background: #222;
    padding: 10px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    justify-content: center;
}

.thumbnail {
    height: 80px;
    width: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.thumbnail.active {
    opacity: 1;
    border: 3px solid #4dabf7;
    transform: scale(1.05);
}
