/* Contenitore griglia */
.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 20px 50px;
  margin: 0 auto;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* Forza 4 colonne nella homepage anche per utenti loggati */
body.home .grid-container,
body.logged-in.home .grid-container {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 20px;
  padding: 20px 50px;
}

/* Card del prodotto */
.product-card {
  background: #fff;
  padding: 15px;
  text-align: center;
  font-family: sans-serif;
  margin-bottom: 30px;
  margin-left: 10px;
  margin-right: 10px;
  position: relative;
}

.product-card .thumbnail {
  margin-bottom: 12px;
}

.product-card .thumbnail img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
}

.product-card .title {
  font-size: 1.3rem;
  font-weight: bold;
  margin: -21px 0;
  color: #222;
}

.product-card .excerpt {
  font-size: 1.25rem;
  color: #666;
 	margin-bottom: 10px;
 	margin-top: 0px;
	font-weight: lighter;
}

.product-card .status-sold {
  background-color: crimson;
  color: white;
  padding: 12px 8px;
  border-radius: 50%; /* Rende il badge circolare */
  font-size: 0.9rem; /* Stessa dimensione del badge percentuale */
  font-weight: bold;
  white-space: nowrap;
  margin-top: 8px;
  display: inline-block;
  text-align: center;
}

.product-card .status-reserved {
  font-size: 1.3rem ;
  font-weight: bold !important;
  color: black;
  margin-top: 8px;
}

/* Contenitore prezzi */
.product-card .price-container {
  margin: 10px 0;
}

/* Prezzo originale (barrato) */
.product-card .price-original {
  margin-bottom: 5px;
}

.product-card .old-price {
  text-decoration: line-through;
  color: #000;
  font-size: 1.2rem;
  font-weight: bold;
}

/* Prezzo scontato con badge sconto */
.product-card .price-discounted {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-card .new-price {
  color: #000;
  font-size: 1.3rem;
  font-weight: bold;
}

/* Badge percentuale sconto */
.product-card .discount-badge {
  background-color: #000;
  color: white;
  padding: 13px 8px;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: bold;
  white-space: nowrap;
}

/* Prezzo normale (senza sconto) */
.product-card .price {
  color: #000;
  font-size: 1.2rem;
  font-weight: bold;
  margin: 10px 0;
}

/* Free shipping */
.product-card .free-shipping {
  background-color: #000;
  color: #fff;
  font-size: 0.9rem;
  font-weight: bold;
  font-style: italic;
  padding: 4px 8px;
  border-radius: 0px !important;
  display: inline-block;
	border: 1px solid #000;
  margin-top: 4px;
}



/* Prezzo su richiesta */
.product-card .price-request {
  font-style: italic;
  color: #777;
	font-size: 1.0rem;
}

/* Icona preferiti (solo loggati) */
.product-card .favorite-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  cursor: pointer;
  color: #aaa;
  transition: color 0.3s ease;
}

.favorite-button,
.favorites-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.favorite-button:hover,
.favorites-toggle:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.favorite-button svg,
.favorites-toggle svg {
  width: 24px;
  height: 24px;
  transition: all 0.3s ease;
}

.favorite-button .dashicons {
  vertical-align: middle;
}



/* Responsive breakpoints */

/* Extra large screens (4 columns) - Default già impostato sopra */
@media (min-width: 1400px) {
  .grid-container {
    gap: 25px;
    padding: 25px 60px;
  }
  
  /* Forza 4 colonne nella homepage anche per utenti loggati */
  body.home .grid-container,
  body.logged-in.home .grid-container {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px;
    padding: 25px 60px;
  }
}

/* Large screens (4 columns) */
@media (min-width: 1200px) and (max-width: 1399px) {
  .grid-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px 50px;
  }
  
  /* Forza 4 colonne nella homepage anche per utenti loggati */
  body.home .grid-container,
  body.logged-in.home .grid-container {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px;
    padding: 20px 50px;
  }
}

/* Medium-large screens (3 columns) */
@media (min-width: 992px) and (max-width: 1199px) {
  .grid-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 18px 40px;
  }
  
  /* Forza 3 colonne nella homepage anche per utenti loggati */
  body.home .grid-container,
  body.logged-in.home .grid-container {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 18px;
    padding: 18px 40px;
  }
  
  .product-card {
    margin-left: 8px;
    margin-right: 8px;
  }
}

/* iPad Pro e Tablets grandi landscape (3 colonne) */
@media (min-width: 1024px) and (max-width: 1199px) {
  .grid-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 18px 30px;
  }
  
  .product-card {
    margin-left: 5px;
    margin-right: 5px;
    margin-bottom: 20px;
    padding: 14px;
  }
  
  .product-card .thumbnail img {
    max-height: 240px;
  }
  
  .product-card .title {
    font-size: 1.25rem;
  }
  
  .product-card .excerpt {
    font-size: 1.30rem;
	  color: #666;
  }
}

/* iPad e Tablets landscape (3 colonne) */
@media (min-width: 768px) and (max-width: 1023px) {
  .grid-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px 25px;
  }
  
  .product-card {
    margin-left: 3px;
    margin-right: 3px;
    margin-bottom: 18px;
    padding: 12px;
  }
  
  .product-card .thumbnail img {
    max-height: 220px;
  }
  
  .product-card .title {
    font-size: 1.2rem;
  }
  
  .product-card .excerpt {
    font-size: 1.3rem;
  }
  
  .product-card .price,
  .product-card .new-price {
    font-size: 1.25rem;
  }
}

/* Tablets portrait e dispositivi medi (3 colonne) */
@media (min-width: 576px) and (max-width: 767px) {
  .grid-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 12px 15px;
  }
  
  .product-card {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 16px;
    padding: 10px;
  }
  
  .product-card .thumbnail img {
    max-height: 180px;
  }
  
  .product-card .title {
    font-size: 1.1rem;
    margin: 8px 0 6px 0;
  }
  
  .product-card .excerpt {
    font-size: 1.2rem;
    margin-bottom: 8px;
  }
  
  .product-card .price,
  .product-card .new-price {
    font-size: 1.2rem;
  }
  
  .product-card .old-price {
    font-size: 1.1rem;
  }
  
  .product-card .discount-badge {
    font-size: 0.85rem;
    padding: 10px 5px;
    border-radius: 50%;
  }
}

/* Mobile phones (1 column) - FORZA 1 COLONNA SU TUTTI I DISPOSITIVI MOBILI */
@media (max-width: 575px) {
  .grid-container,
  body.home .grid-container,
  body.logged-in.home .grid-container {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 12px !important;
    margin: 0 !important;
  }
  
  .product-card {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 15px;
    padding: 15px;
    max-width: 100%;
  }
  
  .product-card .thumbnail {
    margin-bottom: 15px;
  }
  
  .product-card .thumbnail img {
    max-height: 250px;
  }
  
  .product-card .title {
    font-size: 1.3rem;
    margin: 12px 0 8px 0;
  }
  
  .product-card .excerpt {
    font-size: 1.4rem;
    margin-bottom: 12px;
	  color:#666;
  }
  
  .product-card .price,
  .product-card .new-price {
    font-size: 1.4rem;
  }
  
  .product-card .old-price {
    font-size: 1.2rem;
  }
  
  .product-card .discount-badge {
    font-size: 1rem;
    padding: 13px 8px;
    border-radius: 50%;
  }
  
  .product-card .free-shipping {
    font-size: 1rem;
    padding: 6px 10px;
    margin-top: 8px;
  }
  
  /* Ottimizzazione pulsante preferiti per mobile */
  .favorite-button,
  .favorites-toggle {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
  }
  
  .favorite-button svg,
  .favorites-toggle svg {
    width: 22px;
    height: 22px;
  }
}

/* Mobile phones piccoli e iPhone (ottimizzazione extra) */
@media (max-width: 375px) {
  .grid-container,
  body.home .grid-container,
  body.logged-in.home .grid-container {
    grid-template-columns: 1fr !important;
    padding: 8px !important;
    gap: 10px !important;
  }
  
  .product-card {
    padding: 12px;
    margin-bottom: 12px;
  }
  
  .product-card .title {
    font-size: 1.2rem;
  }
  
  .product-card .excerpt {
    font-size: 1.3rem;
  }
}
