/* ==========================================================================
   JUSTTICKETS – VERSIONE Ottimizzata, Ordinata, Commentata
   ========================================================================== */

.justtickets-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  box-sizing: border-box;
}

/* Griglia desktop */
.justtickets-wrapper.layout-desktop-grid {
  display: grid;
  justify-content: flex-start;
}

.justtickets-wrapper.layout-desktop-grid.cols-1 { grid-template-columns: 1fr; }
.justtickets-wrapper.layout-desktop-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.justtickets-wrapper.layout-desktop-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.justtickets-wrapper.layout-desktop-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ==========================================================================
   2) CARD BASE
   ========================================================================== */

.jt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e8ebf1;
  border-radius: 10px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: box-shadow .2s, transform .15s;
}

.jt-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

/* Overlay clickabile */
.jt-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: auto;
}

/* Permette click sull’overlay e sui contenuti quando serve */
.jt-card .jt-card-overlay {
  pointer-events: auto !important;
  z-index: 20 !important;
}

.jt-card * {
  pointer-events: auto; /* non blocchiamo più tutto */
}

/* Il pulsante deve SEMPRE essere cliccabile */
.jt-btn {
  position: relative;
  z-index: 30 !important;
  pointer-events: auto !important;
}


/* ==========================================================================
   3) MEDIA (immagine / icona)
   ========================================================================== */

.jt-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #eef1f5;
  overflow: hidden;
}

.jt-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Icon mode */
.jt-main-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.jt-main-icon svg,
.jt-main-icon i {
  width: 40px;
  height: 40px;
  color: #023169;
}
/* ------------------------------------------
   Riduzione altezza immagini SOLO su desktop
------------------------------------------- */
@media (min-width: 769px) {
  .jt-media {
    aspect-ratio: 3 / 2 !important; /* era 4/3 */
    max-height: 150px; /* limite opzionale */
  }
}

/* ==========================================================================
   4) CONTENUTO
   ========================================================================== */

.jt-content {
  display: flex;
  flex-direction: column;
  padding: 14px 16px 16px;
  gap: 6px;
  flex: 1 1 auto;
}

/* Titoli */
.jt-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: #f3a90b;
}
.jt-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  padding-bottom: 10px;
}

/* Descrizione breve */
.jt-desc {
  font-size: 13px;
  color: #313131;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   5) EXTRA (icone + testo)
   ========================================================================== */

.jt-extras {
  display: flex;
  flex-direction: column;
  gap: 0px;
}
.jt-extra-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.jt-extra-icon svg,
.jt-extra-icon i {
  width: 16px;
  height: 16px;
  color: #023169;
}
/* Fix allineamento verticale icona + testo */
.jt-extra-item {
  display: flex;
  align-items: center !important;
}

.jt-extra-item .jt-extra-icon i,
.jt-extra-item .jt-extra-icon svg {
  display: inline-block;
  vertical-align: middle;
  line-height: 1 !important;
}

.jt-extra-item .jt-extra-text {
  display: inline-block;
  vertical-align: middle;
  line-height: 1.2;
  padding-top: 2px;
}


/* ==========================================================================
   6) BADGES
   ========================================================================== */

.jt-badge {
  position: absolute;
  top: 10px;
  left: 8px;
  padding: 0 10px;
  background: #023169;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.jt-badge2,
.jt-badge3 {
  display: inline-flex;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin: 4px 0;
  white-space: nowrap;
  width: max-content !important;
  align-self: flex-start !important;
}
.jt-badge2 { color: #fff; }
.jt-badge3 { color: #023169; }

/* Contenitore immagine + badge */
.jt-media-wrap {
    position: relative;
    display: block;
}

/* Badge sopra l'immagine */
.jt-media-wrap .jt-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
}




/* ==========================================================================
   7) RATING
   ========================================================================== */

.jt-rating {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.jt-stars {
  display: flex;
  gap: 2px;
}
.jt-stars i { color: #FAB510; font-size: 11px; }

/* ==========================================================================
   8) PREZZO
   ========================================================================== */

.jt-price {
  font-size: 18px;
  margin-top: 4px;
}
.jt-price-prefix { color: #555; text-transform: lowercase; }
.jt-price-current { color: #e63946; font-weight: 700; }
.jt-price-old {
  font-size: 12px;
  text-decoration: line-through;
  color: #888;
  margin-left: 3px;
}
/* Rating sopra */
.jt-rating-block {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

/* Riga prezzo + pulsante */
.jt-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* SE IL PREZZO ESISTE → pulsante a destra */
.jt-price + .jt-btn {
  margin-left: auto;
}

/* ==========================================================================
   9) FOOTER (rating + prezzo + pulsante)
   ========================================================================== */

/* Layout base */
.jt-footer {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0px;
  gap: 8px;
}
.jt-footer-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.jt-footer-right {
  display: flex;
  align-items: flex-end;
}

/* Pulsante */
.jt-btn {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px !important;
  font-weight: 600 !important;
  background: #E83E72 !important;
  color: #fff !important;
  text-decoration: none !important;
  transition: .15s !important;
}
.jt-btn:hover {
  background: #012247;
  transform: translateY(-1px);
}

/* ==========================================================================
   10) DESKTOP – Card orizzontale
   ========================================================================== */
@media only screen and (min-width: 1168px) {
.justtickets-wrapper.layout-desktop-horizontal .jt-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

.justtickets-wrapper.layout-desktop-horizontal .jt-media {
    aspect-ratio: auto !important;
    height: 100% !important;
    max-height: none !important;
}

.justtickets-wrapper.layout-desktop-horizontal .jt-media img {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
}

/* Aumenta dimensioni testi SOLO per card orizzontali desktop */
.justtickets-wrapper.layout-desktop-horizontal .jt-title {
    font-size: 26px !important;
}

.justtickets-wrapper.layout-desktop-horizontal .jt-desc {
    font-size: 15px !important;
    line-height: 1.4;
}

.justtickets-wrapper.layout-desktop-horizontal .jt-extra-item {
    font-size: 15px !important;
}

.justtickets-wrapper.layout-desktop-horizontal .jt-price {
    font-size: 20px !important;
}

.justtickets-wrapper.layout-desktop-horizontal .jt-btn {
    font-size: 15px !important;
    padding: 10px 18px !important;
}
/* Aumenta dimensione icone nei bullet SOLO nel layout orizzontale desktop */
.justtickets-wrapper.layout-desktop-horizontal .jt-extra-icon svg {
    width: 20px !important;
    height: 20px !important;
 }
}
/* ============================================
   LISTA DESKTOP — prezzo vicino al pulsante
===============================================*/
.justtickets-wrapper.layout-desktop-horizontal .jt-price-row {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 12px !important;
    width: auto !important;
}

.justtickets-wrapper.layout-desktop-horizontal .jt-price {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin: 0 !important;
}

.justtickets-wrapper.layout-desktop-horizontal .jt-btn {
    margin-left: 0 !important;
}


/* ==========================================================================
   11) DESKTOP GRID – FIX PULSANTE IN FONDO
   ========================================================================== */

@media (min-width: 769px) {

  /* Footer in colonna come su mobile */
  .justtickets-wrapper.layout-desktop-grid .jt-footer {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  /* Pulsante sotto, allineato a sinistra */
  .justtickets-wrapper.layout-desktop-grid .jt-footer-right {
    justify-content: flex-start !important;
  }
  .justtickets-wrapper.layout-desktop-grid .jt-footer-right .jt-btn {
    align-self: flex-start !important;
  }

  /* Rating più compatto in linea */
  .justtickets-wrapper.layout-desktop-grid .jt-rating {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }
}

/* ==========================================================================
   12) MOBILE – TUTTO in UNA SOLA MEDIA QUERY
   ========================================================================== */

@media (max-width:768px) {

  /* Griglia -> singola card */
  .justtickets-wrapper.layout-desktop-grid {
    grid-template-columns: 1fr !important;
  }

  /* Modalità verticale */
  .justtickets-wrapper.layout-mobile-vertical .jt-media {
    aspect-ratio: 4/3;
  }

  /* Layout mobile "orizzontale compatto" */
  .justtickets-wrapper.layout-mobile-horizontal-compact .jt-card {
    display: flex;
    flex-direction: row;
  }
  .justtickets-wrapper.layout-mobile-horizontal-compact .jt-media {
    width: 120px;
    aspect-ratio: 1/1;
    flex-shrink: 0;
  }
  .justtickets-wrapper.layout-mobile-horizontal-compact .jt-desc {
    display: none;
  }

  /* Footer impilato: prezzo sopra, bottone sotto */
  .justtickets-wrapper.layout-mobile-horizontal-compact .jt-footer {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px;
  }

  .justtickets-wrapper.layout-mobile-horizontal-compact .jt-footer-left,
  .justtickets-wrapper.layout-mobile-horizontal-compact .jt-footer-right {
    width: 100%;
    text-align: left;
  }

  .justtickets-wrapper.layout-mobile-horizontal-compact .jt-btn {
    align-self: flex-start !important;
  }

  /* Rating in un’unica linea */
  .justtickets-wrapper.layout-mobile-horizontal-compact .jt-rating {
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
  /* Pulsante */
.jt-btn {
  font-size: 12px !important;
 }
 .jt-badge2,
.jt-badge3 {
  font-size: 11px;
  font-weight: 600;
  margin: 4px 0;
 }
 .jt-content {
  gap: 2px;
 }
}

/* ==========================================================================
   13) MOBILE GRID
   ========================================================================== */
.justtickets-wrapper.layout-mobile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* ===========================================
   MOBILE – Pulsante sempre SOTTO e a SINISTRA
   =========================================== */
@media (max-width: 768px) {

  /* Il blocco prezzo+pulsante torna impilato */
  .jt-price-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }

  /* Pulsante sempre a sinistra in mobile */
  .jt-price-row .jt-btn {
    align-self: flex-start !important;
    margin-left: 0 !important;
  }
  .jt-extras {
  display: none;
 }
  .justtickets-wrapper.layout-mobile-horizontal-compact .jt-price-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        width: 100% !important;
    }
 .jt-badge {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;

        max-width: 110px !important; /* margini interni */
        display: block; 
    }

}


