/* ==========================================================================
   PAGINA: SINGLE PRODUCT (WooCommerce — Corsi)
   ========================================================================== */

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

/* Reset WooCommerce */
.single-product-page .woocommerce-breadcrumb {
  display: none;
}

/* Definiamo l'animazione globale di comparsa, attesa e scomparsa */
@keyframes contatoreToastNativo {
  0% {
    transform: translateX(40px);
    opacity: 0;
  }
  10% {
    transform: translateX(0);
    opacity: 1;
  }
  90% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(40px);
    opacity: 0;
    pointer-events: none;
  }
}

/* Applichiamo l'effetto all'avviso di successo nativo */
.woocommerce-message {
  position: fixed !important;
  top: 230px !important; /* Sotto il tuo header di 200px */
  right: 30px !important;
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border-left: 4px solid #c3622e !important;
  padding: 16px 24px !important;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 99999;
  display: flex !important;
  align-items: center;
  gap: 20px;
  flex-direction: row-reverse;

  /* L'animazione dura 4 secondi totali e si ferma all'ultimo fotogramma (forwards) */
  animation: contatoreToastNativo 4s ease-in-out forwards;
}

/* Il pulsante "Visualizza carrello" dentro l'avviso */
.woocommerce-message .wc-forward {
  background-color: transparent !important;
  color: #c3622e !important;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  padding: 0 !important;
  border: none !important;
  border-bottom: 1px dashed #c3622e !important;
  float: none !important;
}

/* ==========================================================================
   SEZIONE 1: HERO PRODOTTO
   ========================================================================== */

.product-container {
  padding: 5%;
}

#hero-product {
  background-color: transparent;
  min-height: auto;
}

.hero-product-layout {
  display: grid;
  grid-template-columns: 45% 55%;
  align-items: start;
  min-height: 600px;
}

/* Colonna immagine */

.product-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 560px;
  border-radius: 0;
}

/* Colonna info */
.product-info-col {
  padding: 50px var(--px) 60px 5%;
  display: flex;
  flex-direction: column;
}

.product-tipo-label {
  font-family: "Inter", sans-serif;
  font-size: 20px;
  color: #1e1e1e;
  text-transform: uppercase;
  margin: 0 0 12px;
  line-height: 1.2;
}

.product-tipo-label strong,
.product-tipo-label b {
  font-weight: 700;
}

.product-title {
  font-size: 60px;
  line-height: 1;
  margin: 0 0 16px;
  color: var(--orange);
}

/* Nuova Pillola Docente Nera */
.product-docente-wrap {
  margin-bottom: 25px;
}

/* ==========================================================================
   STRUTTURA VISIVA ACCONTO E PREZZO TOTALE
   ========================================================================== */

/* Contenitore principale prezzo nella Single Product */
.product-deposit-container {
  font-family: "Inter", sans-serif;
  line-height: 1.45;
  margin-bottom: 25px;
  display: flex;
  flex-direction: column;
}

/* Riga "Costo del corso" */
.product-deposit-container .deposit-total-reference {
  color: #7a7a7a !important;
  font-size: 17px !important;
  font-weight: 400;
}

/* Gestione dei tag di sconto/barrato sul costo totale */
.product-deposit-container .deposit-total-reference del,
.product-deposit-container .deposit-total-reference .price-original {
  display: inline-flex;
  align-items: center;
  color: #7a7a7a;
  font-weight: 400;
  text-decoration: line-through;
  margin-right: 6px;
}

.product-deposit-container .deposit-total-reference ins,
.product-deposit-container .deposit-total-reference .price-discounted {
  text-decoration: none;
  font-weight: 600;
  color: #1e1e1e !important;
}

.product-deposit-container .deposit-total-reference bdi,
.product-deposit-container .deposit-total-reference .amount {
  color: inherit;
  font-size: 17px !important;
  font-weight: inherit;
}

.price-original {
  margin-right: 5px;
}

/* Riga "bloccalo ora a..." (Acconto) */
.product-deposit-container .deposit-main-row {
  font-weight: 700;
  color: var(--orange, #c3622e);
  font-size: 17px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* Valore numerico dell'acconto */
.product-deposit-container .dynamic-deposit-value,
.product-deposit-container #dynamic-render-deposit {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: var(--orange, #c3622e) !important;
  display: inline-block;
  vertical-align: baseline;
  margin-left: 2px;
}

.product-deposit-container .dynamic-deposit-value bdi,
.product-deposit-container #dynamic-render-deposit bdi,
.product-deposit-container #dynamic-render-deposit .amount {
  color: var(--orange, #c3622e) !important;
  font-size: 17px !important;
  font-weight: 800 !important;
}

/* Icona i delle informazioni sul pagamento */
.product-deposit-container .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: 4px;
}

.info-payment {
  display: flex;
  margin-left: 10px;
  align-items: center;
  gap: 5px;
}

#product-qty,
#product-qty:focus,
#product-qty:focus-visible,
#product-qty:active {
  border: none;
}

.qty-btn {
  padding: 0 5px;
}

.qty-btn:hover,
.qty-btn:focus,
.qty-btn:focus-visible {
  background-color: transparent;
  color: black;
}

.btn-docente-black {
  display: inline-block;
  background-color: #1e1e1e;
  color: #ffffff !important;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 8px 20px;
  border-radius: 26px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.btn-docente-black:hover {
  background-color: #000000;
  color: #fff;
}

.product-short-desc {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #1e1e1e;
  margin-bottom: 25px;
}

.product-orario {
  margin-bottom: 20px;
}

.product-orario p {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  color: #1e1e1e;
  margin: 0 0 4px;
}
.product-orario p:first-child {
  font-weight: 700;
}

/* Riga prezzo */
.product-price-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.product-price-divider {
  width: 2px;
  height: 24px;
  background-color: #1e1e1e;
  display: block;
}

.product-price-value {
  font-family: "Inter", sans-serif;
  font-size: 25px;
  font-weight: 700;
  color: #1e1e1e;
}

.product-price-note {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  color: #1e1e1e;
}

/* Form e Quantità */
.product-add-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-bottom: 40px;
}

.product-field-label {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  color: #1e1e1e;
  margin-bottom: 10px;
}

.qty-stepper {
  display: flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #1e1e1e;
  border-radius: 5px;
  overflow: hidden;
}

.single-product-page button,
.qty-btn {
  background: transparent;
}

.date-pill:hover,
.date-pill--active {
  background-color: var(--orange) !important;
}

.qty-btn {
  border: none;
  width: 35px;
  height: 40px;
  font-size: 20px;
  font-weight: 300;
  color: #1e1e1e;
  cursor: pointer;
}

.qty-input {
  width: 45px;
  height: 40px;
  border: none;
  border-left: 1px solid #1e1e1e;
  border-right: 1px solid #1e1e1e;
  background: transparent;
  text-align: center;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1e1e1e;
  -moz-appearance: textfield;
}

#variation-stock-info {
  display: none !important;
}

/* Date Pillole */
.dates-grid {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 10px;
  width: fit-content;
}

.date-pill {
  display: inline-block;
  padding: 10px 30px;
  border: 1px solid #1e1e1e;
  border-radius: 5px;
  background-color: transparent;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1e1e1e;
  cursor: pointer;
  transition: all 0.2s ease;
}

.date-pill--active {
  background-color: var(--orange);
  border-color: var(--orange);
  color: #ffffff;
}

/* Effetto "X" per date sold out come nel Figma */
.date-pill--sold-out {
  opacity: 0.5;
  cursor: not-allowed;
  position: relative;
  overflow: hidden;
}
.date-pill--sold-out::before,
.date-pill--sold-out::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -10%;
  width: 120%;
  height: 1px;
  background-color: #1e1e1e;
}
.date-pill--sold-out::before {
  transform: rotate(15deg);
}
.date-pill--sold-out::after {
  transform: rotate(-15deg);
}

/* Bottone Acquista */
.btn-acquista {
  background-color: var(--orange) !important;
  width: 360px;
  max-width: 100%;
  padding: 15px 30px;
  border-radius: 33px;
  border: none;
  font-size: 14.8px;
  transition: 0.3s ease;
}
.btn-acquista:hover {
  color: #ffffff;
  background-color: #a05835 !important;
}

/* Descrizione Lunga */
.product-long-desc {
  border-top: 1px solid #1e1e1e;
  padding-top: 25px;
}

.product-long-desc-label {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1e1e1e;
  margin: 0 0 15px;
  text-transform: uppercase;
}

.product-long-desc-body {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #1e1e1e;
}

/* Istruzioni Vestiario e Materiali (ACF OPTIONS PAGE) */
.product-instructions-desc {
  border-top: 1px solid #1e1e1e;
  padding-top: 25px;
  margin-top: 25px; /* Crea distacco dal blocco descrizione precedente */
}

.product-instructions-label {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1e1e1e;
  margin: 0 0 15px;
  text-transform: uppercase;
}

.product-instructions-body {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #1e1e1e;
}

#come-pagare {
  scroll-margin-top: 150px;
}

/* === FAQ Accordion === */
.faqs-accordion {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.faq-item {
  border-bottom: 1px solid rgba(30, 30, 30, 0.15);
}

.faq-item:first-child {
  border-top: 1px solid rgba(30, 30, 30, 0.15);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: 18px 0;
  cursor: pointer;
  text-align: left;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #1e1e1e;
  gap: 16px;
}

.faq-question:hover {
  color: var(--orange, #c3622e);
}

/* Icona + / × */
.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  position: relative;
  display: block;
}

.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  background-color: #1e1e1e;
  border-radius: 2px;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

/* Barra orizzontale */
.faq-icon::before {
  width: 100%;
  height: 2px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

/* Barra verticale */
.faq-icon::after {
  width: 2px;
  height: 100%;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.faq-question[aria-expanded="true"] {
  color: var(--orange, #c3622e);
}

.faq-question:focus {
  outline: none;
  color: #1e1e1e;
}

.faq-question[aria-expanded="true"]:focus {
  color: var(--orange, #c3622e);
}

/* Quando aperto: ruota la barra verticale → diventa × */
.faq-question[aria-expanded="true"] .faq-icon::after {
  transform: translateX(-50%) rotate(90deg);
  opacity: 0;
}

.faq-question[aria-expanded="true"] .faq-icon::before,
.faq-question[aria-expanded="true"] .faq-icon::after {
  background-color: var(--orange, #c3622e);
}

.faq-answer {
  padding: 0;
  overflow: hidden;
  max-height: 0;
  transition:
    max-height 0.35s ease,
    padding 0.35s ease;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #4a4a4a;
}

.faq-answer:not([hidden]) {
  max-height: 600px;
  padding: 0 0 18px 0;
}

.faq-answer p {
  margin: 0 0 8px;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

@keyframes flashComePagare {
  50% {
    color: #c3622e;
  }
}

.is-flashing .product-instructions-label {
  animation: flashComePagare 2s ease-in-out;
}

/* ==========================================================================
   SEZIONE 2: ALTRI CORSI (Sfondo Color Pesca)
   ========================================================================== */

.altri-corsi-section {
  padding: 80px 0 100px;
  min-height: auto;
  overflow: hidden;
}

.altri-corsi-title {
  font-size: 46px;
  color: var(--orange);
  margin-bottom: 40px;
  text-align: center;
}

.altri-corsi-swiper-outer {
  padding-left: var(--px);
}

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

.altri-corsi-swiper .swiper-slide {
  width: 423px; /* Larghezza card dal Figma */
  height: auto;
}

/* ==========================================================================
   CARD CORSO CORRELATO (Aggiornata stile "Corsi e Workshop")
   ========================================================================== */

.corso-rel-card {
  background-color: #ffffff;
  border-radius: 25px; /* Angoli molto arrotondati dal Figma */
  padding: 21px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.corso-rel-img {
  width: 100%;
  height: 316px;
  border-radius: 5px; /* L'immagine interna ha un radius più piccolo */
  overflow: hidden;
  margin-bottom: 20px;
}

.corso-rel-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.corso-rel-tipo {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  color: #1e1e1e;
  margin: 0 0 5px;
}

.corso-rel-title {
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 25px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--orange);
  line-height: 1.1;
  margin: 0 0 15px;
}

.corso-rel-meta-info p {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  color: #1e1e1e;
  margin: 0 0 5px;
}

.corso-rel-footer {
  margin-top: auto;
}
.corso-rel-footer .btn-black-pill {
  align-self: start;
  position: absolute;
  bottom: 10px;
  right: 10px;
}
@media (max-width: 1650px) {
  .corso-rel-footer {
    flex-direction: column;
    align-items: start !important;
    gap: 20px;
  }
}

.corso-rel-price {
  font-family: "Inter", sans-serif;
  font-size: 25px;
  font-weight: 700;
  color: #1e1e1e;
  margin: 0;
}

/* Bottone nero specifico per queste card */
.btn-black-pill {
  background-color: #1e1e1e;
  color: #ffffff !important;
  font-family: "Inter", sans-serif;
  font-size: 11.6px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 26px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  align-self: end;
}

.btn-black-pill:hover {
  background-color: var(--orange);
  color: #ffffff;
}

/* ==========================================================================
   GALLERIA PRODOTTO (Swiper Main + Thumbs)
   ========================================================================== */

.product-img-col {
  width: 100%;
  overflow: hidden;
}

.product-gallery-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Swiper Principale */
.product-main-swiper {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.product-main-swiper .swiper-slide {
  aspect-ratio: 1 / 1;
}

.product-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Swiper Miniature */
.product-thumbs-swiper {
  width: 100%;
  padding: 2px 0;
}

.product-thumbs-swiper .swiper-slide {
  width: 75px !important;
  height: 75px !important;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  border: 2px solid transparent;
  transition: all 0.25s ease;
}

/* Stato attivo della miniatura selezionata */
.product-thumbs-swiper .swiper-slide-thumb-active {
  opacity: 1;
  border-color: var(--orange, #c3622e);
}

.product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   FRECCE SWIPER MINIATURE (Desktop Only)
   ========================================================================== */

.product-thumbs-swiper {
  position: relative;
  padding: 0 48px; /* Spazio laterale sufficiente per ospitare i bottoni da 42px */
}

/* Bottone circolare stile singolo servizio */
.thumbs-arrow-prev,
.thumbs-arrow-next {
  width: 42px;
  height: 42px;
  background-color: var(--main-bg-color, #1e1e1e);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
  z-index: 10;
  top: 50%;
  margin-top: -21px; /* Centratura verticale perfetta per altezza 42px */
}

/* Dimensione e spessore dell'icona freccia Swiper */
.thumbs-arrow-prev::after,
.thumbs-arrow-next::after {
  font-size: 14px;
  font-weight: 700;
  color: #c3622e;
}

/* Posizionamento ai margini esterni delle miniature */
.thumbs-arrow-prev {
  left: 2px;
}

.thumbs-arrow-next {
  right: 2px;
}

/* Effetto Hover e Click (:active): Sfondo arancione, Icona bianca */
.thumbs-arrow-prev:hover:not(.swiper-button-disabled),
.thumbs-arrow-next:hover:not(.swiper-button-disabled),
.thumbs-arrow-prev:active:not(.swiper-button-disabled),
.thumbs-arrow-next:active:not(.swiper-button-disabled) {
  background-color: var(--orange, #c3622e);
  color: #ffffff;
  transform: scale(1.05);
}

.thumbs-arrow-prev:hover:not(.swiper-button-disabled)::after,
.thumbs-arrow-next:hover:not(.swiper-button-disabled)::after,
.thumbs-arrow-prev:active:not(.swiper-button-disabled)::after,
.thumbs-arrow-next:active:not(.swiper-button-disabled)::after {
  color: #ffffff; /* Icona bianca in hover e al click */
}

/* Stato disabilitato (opacità ridotta mantenendo il cerchio scuro) */
.thumbs-arrow-prev.swiper-button-disabled,
.thumbs-arrow-next.swiper-button-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .hero-product-layout {
    grid-template-columns: 1fr;
  }
  .product-info-col {
    padding: 40px var(--px);
  }
  .product-title {
    text-align: center;
    font-size: 44px;
  }
  .dates-grid {
    grid-template-columns: repeat(2, auto);
  }

  .qty-stepper {
    width: 100%;
  }

  .product-price-row {
    gap: 10px;
  }

  .altri-corsi-swiper .swiper-slide {
    width: 320px;
  }
  .corso-rel-img {
    height: 220px;
  }

  .product-main-swiper .swiper-slide {
    aspect-ratio: 4 / 3; /* Proporzione rettangolare più morbida su mobile */
  }

  .product-thumbs-swiper .swiper-slide {
    width: 60px !important;
    height: 60px !important;
  }

  .product-thumbs-swiper {
    padding: 0; /* Rimuove il padding per sfruttare tutta la larghezza su mobile */
  }

  .thumbs-arrow-prev,
  .thumbs-arrow-next {
    display: none !important;
  }
}

@media (max-width: 575px) {
  .product-tipo-label {
    font-size: 16px;
  }
  .product-title {
    font-size: 36px;
  }
  .dates-grid {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
  }
  .date-pill {
    text-align: center;
    font-size: 14px;
    padding: 10px 5px;
  }

  .altri-corsi-title {
    font-size: 36px;
  }
  .altri-corsi-swiper .swiper-slide {
    width: 280px;
  }
  .corso-rel-card {
    padding: 15px;
  }
  .corso-rel-title {
    font-size: 20px;
  }
  .btn-black-pill {
    padding: 8px 15px;
  }

  .product-price-value {
    text-wrap: nowrap;
  }
}

@media (max-width: 400px) {
  .corso-rel-footer .btn-black-pill {
    position: static;
  }
}
