/* ================= Products Section ================= */

.products-section {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
}

.products-grid {
    display: flex;
    gap: 25px;
    justify-content: center;
}

/* ================= Product Card ================= */

.product-item {
    width: 286px;
    height: 321px;
    perspective: 1200px;
    cursor: pointer;
}

.product-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s ease;
}

.product-item.is-flipped .product-card-inner {
    transform: rotateY(180deg);
}

/* Front & Back */

.product-card-front,
.product-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background: #ffffff;
    border-radius: 20px;
    padding: 18px;

    transition: box-shadow 0.35s ease, transform 0.35s ease;
}

/* Hover Effect (Desktop Only) */
.product-item:hover .product-card-front {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Back Side */
.product-card-back {
    transform: rotateY(180deg);
    text-align: center;
}

/* ================= Product Image ================= */

.product-image {
    width: 100%;
    height: 220px;
    border-radius: 16px;
    background-color: #ffffff;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Image Variants */
.product-image.probe-repair {
    background-image: url('../images/probe-repair.png');
}

.product-image.ultrasound-machine {
    background-image: url('../images/ultrasound-machine.png');
}

.product-image.ultrasound-printer {
    background-image: url('../images/printer-main.png');
}

.product-image.spare-parts-main {
    background-image: url('../images/spare-parts-main.png');
}

/* ================= Text ================= */

.product-name {
    margin-top: 16px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 18px;
    text-transform: uppercase;
    color: #0A2F2F;
    text-align: center;
}

.product-card-back h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 10px;
    color: #0A2F2F;
}

.product-card-back p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 14px;
    line-height: 1.4;
    color: #0A2F2F;
}

/* ================= Fade Up Animation ================= */

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.show {
    opacity: 1;
    transform: translateY(0);
}

/* ================= Tablet (≤768px) ================= */
@media (max-width: 768px) {

    .products-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr); /* 4 per row */
        gap: 16px;
        justify-items: center;
    }

    .product-item {
        width: 100%;
        height: 260px; /* prevents pill collapse */
    }

    .product-card-inner {
        height: 100%;
    }

    .product-card-front,
    .product-card-back {
        padding: 12px;
    }

    .product-image {
        height: 120px;
    }

    .product-name {
        font-size: 13px;
        margin-top: 8px;
    }

    .product-card-back h4 {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .product-card-back p {
        font-size: 11px;
        line-height: 1.3;
    }
}

/* ================= Mobile (≤400px) ================= */

@media (max-width: 400px) {

    .products-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .product-item {
        width: 100%;
        height: 140px;
    }

    .product-card-front,
    .product-card-back {
        padding: 6px;
        border-radius: 12px;
    }

    .product-image {
        height: 80px;
        border-radius: 8px;
    }

    .product-name {
        font-size: 6px;
        margin-top: 6px;
    }

    .product-card-back h4 {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .product-card-back p {
        font-size: 6px;
        line-height: 1.2;
    }
}
