.gallery-section {
    padding: 120px 20px 60px;
    /* Top padding to account for fixed header if any, or just spacing */
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    aspect-ratio: 4/3;
    /* Maintain aspect ratio */
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Back Button Styles */
.gallery-actions {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-start;
    /* Align to left or center as preferred, contact uses center */
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #e91b5b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
    text-decoration: none;
}

.btn-back:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

/* Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Prevent scrolling within modal background */
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;

    /* Flexbox for perfect centering */
    align-items: center;
    justify-content: center;
}

.image-modal.is-open {
    display: flex;
    opacity: 1;
}

.image-modal__content {
    display: block;
    max-width: 95%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
    object-fit: contain;
}

.image-modal__close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
}

.image-modal__close:hover,
.image-modal__close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@keyframes zoomIn {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .image-modal__close {
        top: 15px;
        right: 20px;
        font-size: 35px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns for mobile */
        gap: 10px;
        /* Reduced gap */
    }
}