/* Layout */
.btn-loadmore {
    background-color: #0a7dbc;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: 0.3s;
}

.btn-loadmore:hover {
    background-color: #06648f;
}

.card2unit-container {
    width: 98%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    /* IMPORTANT */
    gap: 25px;
    padding: 40px 10px;
    direction: rtl;
}

/* Each card should auto-fit 4 per row */
.card2unit-card {
    flex: 1 1 calc(25% - 25px);
    /* 4 per row */
    max-width: calc(25% - 25px);
    /* prevent growing */
    text-align: center;
    position: relative;
    cursor: pointer;
    min-width: 240px;
    overflow: hidden;
    direction: rtl;
    /* FORCE CARD START FROM RIGHT */

    /* keeps cards nice on small screens */
}

.card2unit-image {
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    background-color: aqua;
    border-radius: 22px;

}

.card2unit-image img {
    object-fit: fill;
    width: 100%;
    transform: scale(1);
    transition: 0.4s ease-in-out
}

/* Title */
.card2unit-title {
    font-size: 24px;
    margin-top: 12px;
    color: #ff8c32;
    font-family: 'Cairo', sans-serif;
}

/* Hover Layer */
.card2unit-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 400px;
    opacity: 0;
    transition: 0.5s ease;
    display: none;
    justify-content: center;
    align-items: center;
}

.card2unit-hover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hover Effect */
.card2unit-card:hover .card2unit-image img {
    opacity: 1;
    /* fade OUT original image */
    transform: scale(1.12);
}

.card2unit-card:hover .card2unit-hover {
    opacity: 1;
    /* fade IN airplane window */
}

/* ------ Responsive Breakpoints ------ */

/* 3 per row (large tablets / laptops) */
@media (max-width: 1100px) {
    .card2unit-card {
        flex: 1 1 calc(33.33% - 25px);
        max-width: calc(33.33% - 25px);
    }
}

/* 2 per row (tablets) */
@media (max-width: 900px) {
    .card2unit-card {
        flex: 1 1 calc(50% - 25px);
        max-width: calc(50% - 25px);
    }
}

/* 1 per row (mobile) */
@media (max-width: 600px) {
    .card2unit-card {
        flex: 1 1 90%;
        max-width: 90%;
        margin: 0 auto;
    }

    .card2unit-image,
    .card2unit-hover {
        height: 400px;
    }
}