.p-wrap {
    display: flex;
    flex-wrap: wrap;
}

.p-content {
    flex: 1;
    margin-left: 20px;
    display: flex;
    flex-wrap: wrap;
}

.p-item {
    border: 2px solid var(--main-color);
    position: relative;
    border-radius: 7px;
}

.p-item .p-img,
.p-item p {
    position: absolute;
    text-align: center;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transition: transform 1s;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.p-item .p-img {
    transform: rotateY(0deg);
}

.p-item p {
    transform: rotateY(-180deg);
    background-color: var(--main-color);
    color: white;
    margin-bottom: 0px;
    font-size: 20px;
    font-weight: 600;
}

.p-item:hover p {
    transform: rotateY(0deg);
}

.p-item:hover .p-img {
    transform: rotateY(180deg);
}

.p-img img {
    width: 65%;
    overflow: hidden;
}

@media screen and (max-width:420px) {
    .p-item {
        width: 48%;
        margin: 5px 1%;
        height: 130px;
    }

    .p-content {
        margin-left: 0px;
    }
}
@media screen and (min-width:420px) {
    .p-item {
        width: 48%;
        margin: 5px 1%;
        height: 170px;
    }

    .p-content {
        margin-left: 0px;
    }
}


@media screen and (min-width:576px) {
    .p-item {
        width: 32%;
        margin: 5px 0.66%;
        height: 150px;
    }

    .p-content {
        margin-left: 0px;
    }
}

@media screen and (min-width:786px) {
    .p-item {
        width: 32%;
        height: 180px;
    }

    .p-content {
        margin-left: 0px;
    }
}

@media screen and (min-width:992px) {
    .p-item {
        width: 32%;
        height: 180px;
    }
    .p-content {
        margin-left: 20px;
    }
}
@media screen and (min-width:1200px) {
    .p-item {
        width: 32%;
        height: 178px;
    }
    .p-content {
        margin-left: 20px;
    }
}