﻿.product-card {
    border-radius: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: white;
    cursor: pointer;
    width: 300px;
    height: 350px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    flex-shrink: 0;
}

.image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.9rem;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: 500;
}

.badge-vendo {
    display: inline-flex;
    align-items: center;
    background-color: #3FB44C;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.badge-compro {
    display: inline-flex;
    align-items: center;
    background-color: #f05700;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.product-details {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-grow: 1;
}

.product-info {
    flex: 1;
    min-width: 0; 
}

.product-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.product-price {
    color: #2ecc71;
    font-weight: bold;
    margin: 0.25rem 0;
}

.product-location {
    color: #666;
    font-size: 0.9rem;
    margin: 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-button {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    transition: transform 0.2s;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 8px;
}

    .favorite-button:hover {
        transform: scale(1.1);
    }

/* Media query per tablet */
@media (max-width: 1024px) {
    .product-card {
        width: 280px;
        height: 330px;
    }

    .product-title {
        font-size: 1rem;
    }

    .product-image {
        height: 180px;
    }
}

/* Media query per tablet piccoli e telefoni in landscape */
@media (max-width: 900px) {
    .product-card {
        width: 260px;
        height: 320px;
    }

    .product-details {
        padding: 0.8rem;
    }

    .product-image {
        height: 170px;
    }
}

/* Media query per telefoni */
@media (max-width: 768px) {
    .product-card {
        width: 240px;
        height: 310px;
    }

    .product-image {
        height: 160px;
    }

    .product-title {
        font-size: 0.95rem;
    }

    .product-location {
        font-size: 0.85rem;
    }

    .favorite-button {
        width: 25px;
        height: 25px;
    }
}

/* Media query per telefoni piccoli */
@media (max-width: 480px) {
    .product-card {
        width: 100%;
        height: auto;
        min-height: 280px;
    }

    .product-image {
        height: 180px;
    }

    .product-title {
        font-size: 0.9rem;
    }
}

/* Media query per telefoni molto piccoli */
@media (max-width: 360px) {
    .product-card {
        height: auto;
        min-height: 260px;
    }

    .product-image {
        height: 160px;
    }

    .product-details {
        padding: 0.7rem;
    }
}

/* Media query per dispositivi in modalità landscape con altezza ridotta */
@media (max-height: 500px) and (orientation: landscape) {
    .product-card {
        height: auto;
        min-height: 240px;
    }

    .product-image {
        height: 130px;
    }
}
