.product-card {
    display: flex;
    flex-direction: row;
    align-items: stretch; /* Changed from start to stretch */
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    padding: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%; /* Ensure card takes full height of its container */
}

/* Gambar */
.product-image-wrapper {
    position: relative;
    flex: 0 0 50%;
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
}

.product-image {
    width: 100%;
    height: 188px;
    object-fit: cover;
    display: block;
}

/* Badge */
.badge-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #fff;
    border-radius: 8px;
    font-size: 10px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge-overlay i {
    font-size: 6px;
}

/* Detail */
.product-details {
    flex: 1;
    padding-left: 1rem;
    align-items: start;
}

.product-title,
.product-price,
.product-specs,
.whatsapp-btn {
    font-family: 'Inter', sans-serif;
}

.product-title {
    font-size: 16px;
    color: #000;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;  
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    word-break: break-word;
    width: 100%;
    white-space: normal;
}

.product-price {
    color: #495057;
    font-size: 14px;
    line-height: 24px;
}

.product-price .unit {
    color: #495057;
    font-size: 14px;
}

.product-specs {
    font-size: 10px;
    color: #495057;
    height: 28px;
    /* margin-bottom: 20px */
}

.whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #DEE2E6;
    border: none;
    border-radius: 12px;
    padding: 12px;
    width: 100%;
    font-size: 12px;
    color: #2A1608;
    cursor: pointer;
    transition: background 0.2s;
    /* margin-top: auto; */
}

.whatsapp-btn:hover {
    background: #eaeaea;
}

.whatsapp-btn img {
    width: 16px;
    height: 16px;
}

/* === MOBILE STYLING === */
@media (max-width: 767.98px) {
    .product-card {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        min-height: 120px;
    }
    
    .product-image-wrapper {
        flex: 0 0 120px; /* Lebar tetap untuk gambar */
        height: 120px;
        width: 120px;
    }


    .product-image {
        height: 120px;
        width: 120px;
        object-fit: cover;
    }
    
    .product-details {
        flex: 1;
        padding-left: 1rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}

/* === DESKTOP STYLING === */
@media (min-width: 768px) {
    .product-card {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        padding: 1rem;
        max-width: 100%;
        height: 100%;
    }

    .product-title{
        -webkit-line-clamp: 2
    }

    .product-image-wrapper {
        width: 100%;
        flex: none;
        border-radius: 0.875rem;
        height: 180px;
    }

    .product-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .badge-overlay {
        top: 0.75rem;
        right: 0.75rem;
        font-size: 11px;
        padding: 0.35rem 0.65rem;
        gap: 6px;
    }

    .badge-overlay i {
        font-size: 7px;
    }

    .product-details {
        padding-left: 0;
        margin-top: 1rem;
    }

    .product-title {
        height: 100%;
        font-size: 1.125rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }

    .product-price {
        font-size: 1.0625rem;
        margin-bottom: 0.5rem;
    }

    .product-price .unit {
        font-size: 0.9375rem;
    }

    .product-specs {
        font-size: 0.875rem;
        margin-bottom: 24px;
        height: 100%;
    }

    .whatsapp-btn {
        font-size: 0.9375rem;
        padding: 0.625rem 1rem;
        gap: 7px;
        width: 100%;
    }

    .whatsapp-btn img {
        width: 18px;
        height: 18px;
    }
}

/* Desktop: ubah jadi vertikal */
@media (min-width: 992px) {
    .product-card {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        padding: 1.25rem;
        max-width: 400px;
        margin: auto;
    }

    .product-image-wrapper {
        width: 100%;
        flex: none;
        border-radius: 1rem;
    }

    .product-image {
        width: 100%;
        height: 220px;
        object-fit: cover;
    }

    .badge-overlay {
        position: absolute;
        top: 1rem;
        right: 1rem;
        font-size: 12px;
        border-radius: 8px;
        padding: 6px 8px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .badge-overlay i {
        font-size: 8px;
    }

    .product-details {
        padding-left: 0;
        margin-top: 24px;
    }

    .product-title {
        font-size: 20px;
        line-height: 24px;
        color: #000;
    }

    .product-price {
        font-size: 20px;
        line-height: 24px;
        color: #495057;
    }

    .product-price .unit {
        font-size: 20px;
        line-height: 24px;
        color: #495057;
    }

    .product-specs {
        font-size: 1rem;
        line-height: 22px;
        color: #495057;
    }

    .whatsapp-btn {
        font-size: 14px;
        line-height: 20px;
        letter-spacing: -0.16px;
        padding: 14px 24px;
        gap: 8px;
        width: 100%;
        /* margin-top: auto; */
    }

    .whatsapp-btn img {
        width: 20px;
        height: 20px;
    }
}

@media (min-width: 1200px) {
    .product-card {
        max-width: 350px;
    }
}

@media (min-width: 1400px) {
    .product-card {
        width: 100%;
        max-width: 400px;
        margin: auto;
    }
}
