image-gallery {
    display: block;
    width: 100%;
}

image-gallery .gallery-preview {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

image-gallery .gallery-image {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
}

image-gallery .gallery-image:hover {
    filter: brightness(0.95);
}

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

image-gallery .thumbnail {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    background-color: #fff;
}

image-gallery .thumbnail:hover {
    border-color: #4CAF50;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

/* Fullscreen Overlay */
.gallery-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 16px;
    gap: 16px;
    box-sizing: border-box;
}

.gallery-fullscreen-overlay .close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 2px solid white;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10000;
    padding: 0;
    font-weight: bold;
    line-height: 1;
}

.gallery-fullscreen-overlay .close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: #4CAF50;
    color: #4CAF50;
}

.gallery-fullscreen-overlay .fullscreen-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    max-width: 90%;
    max-height: 70vh;
    flex: 1;
}

.gallery-fullscreen-overlay .fullscreen-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 100%;
}

.gallery-fullscreen-overlay .fullscreen-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.gallery-fullscreen-overlay .nav-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    padding: 12px 16px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.gallery-fullscreen-overlay .nav-btn:hover {
    background: white;
    transform: scale(1.1);
}

.gallery-fullscreen-overlay .nav-btn:active {
    transform: scale(0.95);
}

/* Thumbnail bar */
.gallery-fullscreen-overlay .fullscreen-thumbnails {
    display: flex;
    gap: 8px;
    justify-content: center;
    max-width: 90%;
    overflow-x: auto;
    padding: 0 8px;
}

.gallery-fullscreen-overlay .fs-thumbnail {
    width: 80px;
    height: 80px;
    border: 2px solid #666;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.gallery-fullscreen-overlay .fs-thumbnail:hover {
    opacity: 1;
    border-color: #4CAF50;
}

.gallery-fullscreen-overlay .fs-thumbnail.active {
    border-color: #4CAF50;
    opacity: 1;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.gallery-fullscreen-overlay .fs-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Image counter */
.gallery-fullscreen-overlay .image-counter {
    position: absolute;
    bottom: 16px;
    left: 16px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    image-gallery .collage {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
}