

.masonry-item {
    background: #fff;
    border: 1px solid #e3e6e8;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 16px 12px 12px 12px;
    margin-bottom: 20px;
    transition: box-shadow 0.2s;
    width: 100%;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.masonry-item {
    width: 47%;      /* 2 colonne su mobile */
    min-width: 150px;
    margin-bottom: 16px;
    margin-right: 1%;
    box-sizing: border-box;
    float: left;
}

.masonry-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.14);
}

.masonry-item-img-container {
    height: 280px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 15px;
}

.masonry-item img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    display: block;
}

.masonry-item.expired img {
    opacity: 0.6;
}

.masonry-item h3 {
    font-size: 16px;
    font-weight: 500;
    color: #0f1111;
    margin: 8px 0 4px 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 40px; /* Forza lo spazio per 2 righe */
}

.masonry-item p {
    font-size: 15px;
    color: #565959;
    margin: 2px 0;
    text-align: center;
}

.masonry-item .price {
    font-size: 20px;
    color: #FF6600;
    font-weight: bold;
    margin-top: 6px;
}

.masonry-item .original-price {
    font-size: 16px;
    color: #565959;
    text-decoration: line-through;
    margin-bottom: 4px;
}

.masonry-layout {
    display: block; /* Masonry JS gestirà il layout */
    margin: 0;
    padding: 0;
}

@media (max-width: 400px) {
    .masonry-item {
        width: 100%;  /* 1 colonna su schermi molto piccoli */
        margin-right: 0;
    }
}

@media (min-width: 600px) {
    .masonry-item {
        width: 23%;  /* 4 colonne su tablet/desktop */
        margin-right: 1%;
    }
}

@media (min-width: 1024px) {
    .masonry-item {
        width: 15%;  /* 5 colonne su schermi più grandi */
        margin-right: 1%;
    }
}

@media (min-width: 400px) and (max-width: 500px) {
    .masonry-item {
        padding: 16px 0 12px 0;
    }
    .masonry-item h3 {
        font-size: 14px;
        -webkit-line-clamp: 4;
        padding: 0 10px;
        min-height: 67px;
    }
}

.discount-badge {
    position: absolute;
    top: 5%;
    right: 5px;
    width: 50px;
    height: 50px;
    background: #FF6600;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    padding: 0;
}

.expired-badge {
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    text-align: center;
    transform: translate(0, -120%);
    background: rgba(220, 53, 69, 0.95);
    color: #fff;
    font-size: 17px;
    font-weight: bold;
    padding: 6px 18px;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.masonry-item-prices {
    margin-top: 15px;
    margin-bottom: 15px;
    text-align: center;
}


.offerta-btn {
    background: #ff6600cb;
    color: #fff !important;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 5px;
    display: inline-block;
    font-weight: bold;
    transition: background 0.2s;
    width: 100%;
    text-align: center;
}

.masonry-item.expired .discount-badge,
.masonry-item.expired .offerta-btn {
    background: #a0a0a0;
}

.offerta-btn:hover {
    background: #e68a00;
}

.owl-carousel.casa .discount-badge,
.owl-carousel.casa .offerta-btn,
.masonry-casa .offerta-btn,
.masonry-casa .discount-badge {
    background: #51ba45;
}

.owl-carousel.casa .price,
.masonry-casa .price {
    color: #51ba45;
}

.owl-carousel.moda .discount-badge,
.owl-carousel.moda .offerta-btn,
.masonry-moda .discount-badge,
.masonry-moda .offerta-btn {
    background: #7a5fff;
}

.owl-carousel.moda .price,
.masonry-moda .price {
    color: #7a5fff;
}

.owl-carousel.errori .discount-badge,
.owl-carousel.errori .offerta-btn,
.masonry-errori .discount-badge,
.masonry-errori .offerta-btn {
    background: #c03228;
}

.owl-carousel.errori .price,
.masonry-errori .price {
    color: #c03228;
}

.owl-carousel.sport .discount-badge,
.owl-carousel.sport .offerta-btn,
.masonry-sport .discount-badge,
.masonry-sport .offerta-btn {
    background: #e7ed41;
}

.owl-carousel.sport .price,
.masonry-sport .price {
    color: #e7ed41;
}

.owl-carousel.bellezza .discount-badge,
.owl-carousel.bellezza .offerta-btn,
.masonry-bellezza .discount-badge,
.masonry-bellezza .offerta-btn {
    background: #ff8585;
}

.owl-carousel.bellezza .price,
.masonry-bellezza .price {
    color: #ff8585;
}

