.griglia-wrapper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 40px 0;
}

/* Tablet: 2 colonne */
@media (max-width: 1024px) {
  .griglia-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Smartphone: 1 colonna */
@media (max-width: 600px) {
  .griglia-wrapper {
    grid-template-columns: 1fr;
  }
}

.griglia-item {
  position: relative; /* serve per ::after */
  border: 2px solid rgba(255, 60, 0, 0.5);
  box-shadow: 0 0 16px 2px rgba(0, 0, 0, 0.25);
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 14px;
  overflow: visible; /* per mostrare ombra ::after */
  transition: border-color 0.3s ease-in-out; /* box-shadow animato su ::after */
}

/* pseudo-element per l’ombra arancione animata */
.griglia-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: 0 0 16px 2px rgba(255, 102, 0, 0.7);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  z-index: 0;
}

/* metti contenuti sopra l’ombra */
.griglia-item > * {
  position: relative;
  z-index: 1;
}

/* al hover mostra l’ombra arancione con fade in/out */
.griglia-item:hover {
  border-color: rgba(255, 60, 0, 1);
}

.griglia-item:hover::after {
  opacity: 1;
}

.griglia-item a:first-child {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* quadrata */
  overflow: hidden;
  border-radius: 12px 12px 0 0; /* SOLO BORDI SUPERIORI SMUSSATI */
}

.griglia-item img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  display: block;
}

.griglia-item h3 {
  font-size: 16px;
  margin: 10px 0 5px;
  text-transform: uppercase;
  text-align: center;
}

.griglia-item p {
  font-size: 14px;
  color: #555;
  flex-grow: 1;
  margin: 0 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
}

/* Overlay sfumatura bianca in basso */
.griglia-item p::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 90%);
}

.griglia-item .info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.griglia-item .prezzo {
  font-weight: bold;
  color: #333;
  margin-left: 15px;
}

.griglia-item .cta {
  background: #ff6600;
  color: white;
  padding: 6px 12px;
  text-decoration: none;
  border-radius: 12px;
  font-weight: bold;
}

.griglia-item .cta:hover {
  background: #fd1700;
  color: white;
}

/* FADE-IN ANIMATION */
.fade-in {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.griglia-loader {
  display: flex;
  justify-content: center;
  margin: 40px 0;
}

.spinner {
  border: 4px solid rgba(0,0,0,0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: #09f;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.loader-hidden {
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
