/* ==========================================================================
   PAGINA: CORSI E WORKSHOP
   Dipendenze: style.css (variabili, btn-primary, split-layout,
   recensioni, footer, hero-title-italic, media-col)
   ========================================================================== */

/* ==========================================================================
   WRAPPER PAGINA
   ========================================================================== */

:root {
  --corsi-falegnameria-bg: #e8bba4;
  --corsi-ceramica-bg: #f2e7d8;
}

.corsi-page {
  background-color: var(--main-bg-color);
}

/* ==========================================================================
   SEZIONE 1: HERO CORSI & WORKSHOP (Stile "svincolato")
   ========================================================================== */

#hero-corsi {
  position: relative; /* Necessario per l'immagine absolute */
  background-color: #111111;
  padding: 0px 0 120px;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 80vh;
}

/* Contenitore dei testi: sta sopra l'immagine */
.hero-corsi-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
}

.corsi-e {
  font-style: normal;
  display: block;
  color: #ffffff !important;
  margin: 0 0 -20px -40px;
}

.corsi-page .text-col {
  width: 60%;
  position: relative;
  z-index: 3;
}

/* Immagine posizionata a destra */
.hero-bg-media {
  position: absolute;
  top: 50%;
  right: 10%;
  width: 50%;
  z-index: 1;
  transform: translateY(-50%);
  object-fit: cover;
}

/* Tipografia */
.hero-corsi-title {
  font-size: 110px;
  line-height: 0.95;
  margin-bottom: 30px;
  color: #c3622e;
}

#hero-corsi .section-description {
  color: rgba(255, 255, 255, 0.85);
  width: 60%;
  margin: 20px 0 40px;
}

#hero-corsi .corsi-desc-secondary {
  font-size: 14px;
  margin-bottom: 30px;
}

/* ==========================================================================
   SEZIONE 2: BANNER CATEGORIE (Falegnameria / Ceramica)
   ========================================================================== */

#categorie-banner {
  min-height: auto;
}

.categorie-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
}

.categoria-panel {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
  text-decoration: none;
  background-size: cover;
  background-position: bottom;
  cursor: pointer;
}

.categoria-overlay {
  position: absolute;
  inset: 0;
}

.categoria-content {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 3;
  padding: 0 10% 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.categoria-overlay::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  opacity: 0.5;
  z-index: 1;
}

.categoria-title {
  font-size: calc(20px + 5vw);
  line-height: 1;
  color: #ffffff !important;
  margin: 0;
}

.categoria-btn {
  align-self: center;
  pointer-events: none;
}

/* ==========================================================================
   SEZIONI 3 & 4: GRIGLIA CORSI (Falegnameria / Ceramica)
   ========================================================================== */

.corsi-section {
  background-color: var(--main-bg-color);
  padding: 0 0 80px;
  min-height: auto;
  overflow: hidden;
}

.corsi-section .container {
  padding-top: 60px;
  padding-bottom: 0;
}

.corsi-section-title {
  text-align: center;
  font-size: 48px;
  margin-bottom: 40px;
  display: block;
}

.corsi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.corsi-empty {
  color: #666;
  font-size: 15px;
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
}

#falegnameria-corsi {
  background-color: var(--corsi-falegnameria-bg);
}

#ceramica-corsi {
  background-color: var(--corsi-ceramica-bg);
}

/* ==========================================================================
   CARD CORSO
   ========================================================================== */

.corso-card {
  background-color: #ffffff;
  border-radius: 25px;
  padding: 25px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-total-reference,
.card-deposit-price {
  font-size: 17px;
}

/* ==========================================================================
   Gestione Prezzi ed Acconto Corsi (Single Product & Card Loop)
   ========================================================================== */

/* Regole Condivise per Prezzo Barrato e Scontato */
.deposit-del-single,
.deposit-del-card,
.total-del {
  display: inline-flex;
  align-items: center;
  color: #7a7a7a;
  font-weight: 400;
  text-decoration: line-through;
}

.deposit-del-single {
  font-size: 1.4rem;
  margin-right: 8px;
}

.deposit-del-card {
  margin-right: 6px;
}

.total-del {
  margin-right: 6px;
}

.deposit-ins {
  text-decoration: none;
}

.total-ins {
  text-decoration: none;
  font-weight: 600;
  color: #1e1e1e;
}

.select-date-prompt {
  font-size: 17px;
  color: #7a7a7a;
  font-weight: 500;
  font-family: "Inter", sans-serif;
}

/* --------------------------------------------------------------------------
   Layout per Single Product
   -------------------------------------------------------------------------- */
.product-deposit-container {
  font-family: "Inter", sans-serif;
  line-height: 1.45;
  margin-bottom: 25px;
}

.deposit-total-reference {
  color: #7a7a7a;
  font-size: 16px;
}

.deposit-main-row {
  font-weight: 700;
  color: var(--orange, #c3622e);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.dynamic-deposit-value {
  font-size: 25px;
  font-weight: 800;
  color: var(--orange, #c3622e);
}

.info-payment-link {
  color: #7a7a7a;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid #7a7a7a;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  margin-left: 2px;
}

/* --------------------------------------------------------------------------
   Layout per Card e Loop
   -------------------------------------------------------------------------- */
.card-deposit-container {
  font-family: "Inter", sans-serif;
  line-height: 1.45;
  margin-top: 5px;
}

.card-total-reference {
  color: #7a7a7a;
}

.card-deposit-price {
  font-weight: 700;
  color: var(--orange, #c3622e);
}

.card-deposit-value {
  font-size: 17px;
  font-weight: 800;
  display: inline-block;
  vertical-align: baseline;
  margin-left: 2px;
}

.card-deposit-note {
  font-size: 14px;
  color: #7a7a7a;
  display: block;
  margin-top: 1px;
  font-weight: 400;
}

/* ==========================================================================
   /FINE Gestione Prezzi ed Acconto Corsi (Single Product & Card Loop)
   ========================================================================== */

.corso-card-img {
  border-radius: 5px;
  width: 100%;
  aspect-ratio: 5 / 3;
  overflow: hidden;
}

.corso-card-img h4 {
  background: white;
  z-index: 1000;
  position: absolute;
  top: 24px;
  border-radius: 0px 0px 0px 5px;
  padding: 0 0 5px 5px;
  right: 24px;
  font-size: 17px;
}

.corso-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  box-shadow: none;
}

.corso-card-body {
  padding: 20px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 0;
  gap: 6px;
}
.corso-card-body .card-body-bottom .corso-cta {
  position: absolute;
  bottom: 10px;
  right: 10px;
}
@media (max-width: 1650px) {
  .corso-card-body .card-body-bottom {
    flex-direction: column;
    align-items: start !important;
    gap: 20px;
  }
}
.corso-meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(0, 0, 0, 0.45);
  line-height: 1.4;
}

.corso-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--orange);
  font-weight: 600;
}

.corso-card-title {
  font-family: "Inter", sans-serif;
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--orange);
  margin: 0;
}

.corso-card-title a:hover {
  filter: opacity(0.8);
}

.corso-docente {
  font-size: 13px;
  margin: 0;
}

.corso-prezzo {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a1a;
}

.corso-cta {
  background-color: black;
  font-size: 11px;
  padding: 10px 24px;
  align-self: end;
}

.swiper-slide.corso-card {
  width: calc(33.3333% - 10px) !important;
  height: auto;
}

@media (min-width: 1700px) {
  .corsi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1699px) {
  .corsi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1600px) {
  #falegnameria-corsi .container {
    padding: 70px 5%;
  }
  #ceramica-corsi .container {
    padding: 70px 5%;
  }
}
@media (max-width: 1200px) {
  .corsi-grid {
    grid-template-columns: 1fr;
  }
  .swiper-slide.corso-card {
    width: calc(50% - 7.5px) !important;
  }
}

@media (min-width: 769px) {
  .corsi-grid {
    display: flex !important;
    flex-wrap: wrap;
    gap: 15px;
    transform: none !important;
    width: 100% !important;
    justify-content: center;
  }

  .swiper-corsi-mobile {
    overflow: visible;
  }
}

/* ==========================================================================
   RESPONSIVE — TABLET E SMARTPHONE RAGGRUPPATI
   ========================================================================== */

/* --- TABLET (max-width: 768px) --- */
@media (max-width: 768px) {
  /* Hero */
  #hero-corsi {
    padding: 80px 0;
  }

  .hero-bg-media {
    width: 100%;
    height: 100%;
    opacity: 0.25; /* Sfondo semi-trasparente */
    box-shadow: none;
  }

  .corsi-page .text-col {
    width: 100%;
    text-align: center;
    align-items: center;
  }

  .corsi-e {
    margin: -15px 0 -20px;
  }

  .corsi-page .text-col .btn-primary {
    align-self: center;
  }

  .hero-corsi-title {
    font-size: 56px;
  }

  /* Banner categorie */
  .categorie-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .categoria-panel {
    height: 260px;
  }

  .categoria-title {
    font-size: 48px;
  }

  /* Griglia corsi */
  .corsi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .corsi-section-title {
    font-size: 40px;
  }

  .swiper-corsi-mobile {
    overflow: visible !important;
  }

  .corsi-grid {
    display: flex !important;
    gap: 15px;
    flex-wrap: wrap;
  }

  .corso-card.swiper-slide {
    width: 100% !important;
    height: auto;
    flex-shrink: 0;
    margin-right: 0 !important;
  }
  .hero-bg-media {
    right: 0%;
  }
}

/* --- SMARTPHONE (max-width: 575px) --- */
@media (max-width: 575px) {
  /* Hero */
  #hero-corsi {
    padding: 50px 0 40px; /* Aggiustamento padding originale */
  }

  #hero-corsi .section-description {
    width: 100%;
  }

  #hero-corsi .btn-primary {
    align-self: center;
  }

  .hero-corsi-title {
    font-size: 42px;
  }

  /* Banner categorie */
  .categoria-panel {
    height: 220px;
    justify-content: center;
  }

  .categoria-title {
    font-size: 36px;
  }

  .categoria-content {
    padding: 0 var(--px) 0px;
    gap: 12px;
  }

  .categoria-btn {
    display: inline-block;
    align-self: center;
  }

  /* Griglia corsi */
  .corsi-grid {
    grid-template-columns: 1fr;
  }

  .corsi-section-title {
    font-size: 34px;
  }

  .corso-card-img h4 {
    top: 15px;
    right: 15px;
  }

  .corsi-section .container {
    padding-top: 40px;
  }

  .corsi-section {
    padding-bottom: 50px;
  }

  #hero-corsi .hero-bg-media {
    display: block !important;
  }
  .corso-card {
    padding: 15px;
    border-radius: 18px;
  }
}

@media (max-width: 400px) {
  .corso-card-body .card-body-bottom .corso-cta {
    position: static;
  }
}
