.gallery {
    margin-top: 32px;
}

.gallery-tab {
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    list-style: none;
    padding: 0;
    margin: 0;
}

.gallery-tab button {
    background-color: inherit;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 8px 12px;
    display: block;
    background: #f2f2f2;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-size: 17px;
    flex-grow: 1;
    text-align: center;
}

.gallery-tab button:hover {
    background-color: #ddd;
    transform: translateY(-3px);
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

.gallery-tab button.active {
    background-color: #3498db;
    color: #fff;
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);
}

.tabcontent {
    display: none;
}

.tabcontent.active {
    display: block;
}

.img-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: auto;
    grid-gap: 5px;
    margin-top: 10px;
    justify-content: center;
}

.gallery-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: cover;
    margin-top: 2px;
    cursor: pointer;
}


/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    padding-top: 100px;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

@media screen and (max-width: 768px) {

    .img-row {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .prev,
    .next {
        padding: 20px;
    }


    .modal-content {
        max-width: 100%;
        height: auto;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}


/* Hide by default */
.rotate-device {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 10px;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    z-index: 9999;
}

/* Show on mobile devices in portrait */
@media only screen and (max-width: 600px) and (orientation: portrait) {

    .gallery-tab {
        flex-direction: column;
    }

    .gallery-tab button {
        flex-grow: 1;
        margin-bottom: 10px;
    }

    .rotate-device {
        display: block;
    }


}