/* =====================================================================
   Il Garage del Vino: scheda prodotto.
   ---------------------------------------------------------------------
   Riferimento: mockups/prodotto.html. Markup di Blocksy (layout a due
   colonne) e di inc/product.php; barra d'acquisto fissa e carosello dei
   correlati in assets/js/theme.js.
   ===================================================================== */

:root {
  --gdv-i-region: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M3.5 12h17M12 3.5c2.6 2.4 3.8 5.2 3.8 8.5s-1.2 6.1-3.8 8.5c-2.6-2.4-3.8-5.2-3.8-8.5S9.4 5.9 12 3.5z'/%3E%3C/svg%3E");
  --gdv-i-grapes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='10' r='2.2'/%3E%3Ccircle cx='13.5' cy='10' r='2.2'/%3E%3Ccircle cx='11.2' cy='14' r='2.2'/%3E%3Ccircle cx='7' cy='14' r='2.2'/%3E%3Ccircle cx='15.6' cy='14' r='2.2'/%3E%3Ccircle cx='9.2' cy='18' r='2.2'/%3E%3Ccircle cx='13.6' cy='18' r='2.2'/%3E%3Cpath d='M11 7.8V5c0-1 1-2 2.5-2'/%3E%3C/svg%3E");
  --gdv-i-bottle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2.5h4V7c0 1 2 2 2 4.5V21H8V11.5C8 9 10 8 10 7z'/%3E%3Cpath d='M8 14h8'/%3E%3C/svg%3E");
  --gdv-i-percent: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='m9 15 6-6'/%3E%3Ccircle cx='9.3' cy='9.3' r='.9'/%3E%3Ccircle cx='14.7' cy='14.7' r='.9'/%3E%3C/svg%3E");
  --gdv-i-bubbles: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.4 3h5.2l-.4 7.4a2.2 2.2 0 0 1-4.4 0z'/%3E%3Cpath d='M12 12.6V20M9 21h6'/%3E%3Ccircle cx='11.3' cy='8.6' r='.4'/%3E%3Ccircle cx='12.7' cy='6.4' r='.4'/%3E%3Cpath d='M16.5 4.5h.01M18 7.5h.01M17.2 10.5h.01'/%3E%3C/svg%3E");
  --gdv-i-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M4 10h16M8 3v4M16 3v4'/%3E%3C/svg%3E");
}

/* ---------- Galleria --------------------------------------------------- */
.single-product .woocommerce-product-gallery .ct-media-container {
  overflow: hidden;
  border-radius: var(--r-lg);
  background: #fff;
}
/* Riquadro 3/4 come nelle card: bottiglie scontornate intere con il margine, foto verticali
   (gdv-foto-intera, inc/cards.php) a tutto riquadro */
.single-product .woocommerce-product-gallery .ct-media-container img {
  aspect-ratio: 3 / 4 !important;
  padding: 1.5rem;
  object-fit: contain !important;
}
.single-product .woocommerce-product-gallery .ct-media-container img.gdv-foto-intera {
  padding: 0;
  object-fit: cover !important;
}
.single-product .flexy-pills [data-type="thumbs"] .ct-media-container,
.single-product .flexy-pills .ct-media-container {
  border-radius: var(--r);
  background: #fff;
}
/* Miniature (in colonna a sinistra della foto, migrazione 041): meno margine della foto grande */
.single-product .woocommerce-product-gallery .flexy-pills .ct-media-container img {
  padding: 0.4rem;
}

/* ---------- Colonna di destra ----------------------------------------- */
.single-product .entry-summary .product_title {
  margin-bottom: 0.9rem;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 0.98;
}
.gdv-pdp-brand {
  margin: -0.4rem 0 0;
}
.gdv-pdp-brand a {
  color: var(--c-ink);
  font-family: var(--f-mono);
  font-size: 0.95rem;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.3em;
}
.gdv-pdp-brand a:hover {
  color: var(--c-accent-text);
}

.single-product .entry-summary .price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
  margin-top: 0.9rem;
  color: var(--c-ink);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.single-product .entry-summary .price .sale-price {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
}
.single-product .entry-summary .price ins {
  order: -1;
  text-decoration: none;
}
.single-product .entry-summary .price del {
  color: var(--c-text-soft);
  font-size: 1rem;
  font-weight: 400;
}
.gdv-pdp-badge {
  align-self: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--c-accent);
  color: var(--c-ink);
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.5;
}
/* "Tasse incluse · Spedizione in 3-5 giorni lavorativi" attaccato al prezzo (Blocksy dà al prezzo 35px di margine sotto) */
.single-product .entry-summary .price:has(+ .gdv-pdp-tax) {
  margin-bottom: 0;
}
.single-product .entry-summary .gdv-pdp-tax {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0.35rem 0 0.6rem;
  color: var(--c-text-soft);
  font-size: 0.85rem;
}
.gdv-pdp-tax__sep {
  margin-inline: 0.5rem;
}

/* Prezzo per i professionisti (inc/b2b.php): prezzo grande, nota sull'IVA, sotto il prezzo al pubblico */
.single-product .entry-summary .price:has(.gdv-b2b) {
  display: block;
}
.gdv-b2b {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.6rem;
}
.single-product .entry-summary .gdv-b2b__now {
  color: var(--c-ink);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
}
.single-product .entry-summary .gdv-b2b__now :is(ins, small) {
  text-decoration: none;
}
.single-product .entry-summary .gdv-b2b__note {
  color: var(--c-accent-text);
  font-size: 0.82rem;
  font-weight: 600;
}
.single-product .entry-summary .gdv-b2b__public {
  flex-basis: 100%;
  color: var(--c-text-soft);
  font-size: 0.82rem;
  font-weight: 400;
}
.single-product .entry-summary .gdv-b2b__public :is(del, ins) {
  font-size: inherit;
  font-weight: inherit;
}
/* Nella barra d'acquisto fissa solo il prezzo e la nota sull'IVA */
.gdv-sticky-buy .gdv-b2b {
  gap: 0 0.4rem;
}
.gdv-sticky-buy .gdv-b2b__note {
  color: var(--c-text-soft);
  font-size: 0.8rem;
}
.gdv-sticky-buy .gdv-b2b__public {
  display: none;
}

/* Disponibilità con il pallino */
.single-product .entry-summary .stock {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  color: var(--c-ok, #2e7d4f);
  font-size: 0.95rem;
}
.single-product .entry-summary .stock::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}
.single-product .entry-summary .stock.out-of-stock {
  color: var(--c-accent-text);
}

/* ×1 ×3 ×6 sopra quantità e pulsante (inc/product.php, theme.js) */
.gdv-qty-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.single-product .entry-summary .gdv-qty-preset {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.4rem 1rem;
  border: 1px solid var(--c-grey-2);
  border-radius: var(--r);
  background: #fff;
  color: var(--c-ink);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.single-product .entry-summary .gdv-qty-preset:hover {
  border-color: var(--c-ink);
}
.single-product .entry-summary .gdv-qty-preset[aria-pressed="true"] {
  border-color: var(--c-ink);
  background: var(--c-ink);
  color: #fff;
}
.gdv-qty-preset small {
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: var(--c-accent);
  color: var(--c-ink);
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 400;
}
.gdv-qty-presets__note {
  flex-basis: 100%;
  margin: 0;
  color: var(--c-text-soft);
  font-size: 0.85rem;
}

/* Quantità e pulsante */
.single-product .entry-summary .ct-product-add-to-cart {
  margin-top: 1.1rem;
}

/* "Avvisami" quando torna disponibile (funzione di WooCommerce, migrazione 038): nella scheda di un
   prodotto esaurito, riquadro bianco con l'email e il pulsante sulla stessa riga */
.single-product .entry-summary .wc_bis_form {
  margin-top: 0.25rem;
  padding: 1.25rem;
  border-radius: var(--r-lg);
  background: #fff;
}
.single-product .entry-summary .wc_bis_form h3 {
  margin: 0 0 0.85rem;
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}
.single-product .entry-summary .wc_bis_form__form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.single-product .entry-summary .wc_bis_form__input {
  flex: 1 1 220px;
  min-height: 48px;
}
.single-product .entry-summary .wc_bis_form__button {
  min-height: 48px;
  padding-inline: 1.5rem;
}

.single-product .entry-summary .ct-cart-actions {
  gap: 0.6rem;
}
.single-product .entry-summary .single_add_to_cart_button {
  flex: 1;
  min-height: 54px;
  font-size: 1.05rem;
}
/* Quantità come nel mockup: numero e frecce su e giù in una colonna a destra, in un unico riquadro
   (Blocksy "Type 1", migrazione 012; le frecce di Blocksy sono pulsanti assoluti sopra il campo) */
.single-product .entry-summary .quantity {
  --quantity-height: 54px;
  --quantity-width: 82px;
  --quantity-icon-size: 10px;
  border-radius: var(--r);
}
div.quantity[data-type="type-1"] input[type="number"] {
  --theme-form-field-border-initial-color: var(--c-grey-2);
  --theme-form-field-border-focus-color: var(--c-ink);
  --theme-form-field-background-initial-color: #fff;
  --theme-form-field-background-focus-color: #fff;
  padding-inline: 0 28px;
  border-inline-end-width: 1px;
  border-radius: var(--r) !important;
  color: var(--c-ink);
  font-size: 1rem;
  font-weight: 600;
}
div.quantity[data-type="type-1"] :is(.ct-increase, .ct-decrease) {
  inset-inline-end: 1px;
  width: 28px;
  max-width: none;
  border-inline-start: 1px solid var(--c-grey-2);
  background: #fff;
  color: var(--c-ink);
}
div.quantity[data-type="type-1"] :is(.ct-increase, .ct-decrease):hover {
  background: var(--c-bg);
  color: var(--c-ink);
}
div.quantity[data-type="type-1"] .ct-increase {
  top: 1px;
  height: calc(50% - 1px);
  border-start-end-radius: calc(var(--r) - 1px);
}
div.quantity[data-type="type-1"] .ct-decrease {
  bottom: 1px;
  height: calc(50% - 1px);
  border-top: 1px solid var(--c-grey-2);
  border-end-end-radius: calc(var(--r) - 1px);
}

/* Dati del vino */
.gdv-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
  margin: 2rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--c-grey-2);
}
.gdv-fact {
  position: relative;
  padding-left: calc(30px + 0.8rem);
}
.gdv-fact::before {
  content: "";
  position: absolute;
  top: 0.1rem;
  left: 0;
  width: 30px;
  height: 30px;
  background-color: var(--c-ink);
  -webkit-mask: var(--gdv-icon) center / contain no-repeat;
  mask: var(--gdv-icon) center / contain no-repeat;
}
.gdv-fact--region { --gdv-icon: var(--gdv-i-region); }
.gdv-fact--grapes { --gdv-icon: var(--gdv-i-grapes); }
.gdv-fact--bottle { --gdv-icon: var(--gdv-i-bottle); }
.gdv-fact--percent { --gdv-icon: var(--gdv-i-percent); }
.gdv-fact--glass { --gdv-icon: var(--gdv-i-glass); }
.gdv-fact--bubbles { --gdv-icon: var(--gdv-i-bubbles); }
.gdv-fact--calendar { --gdv-icon: var(--gdv-i-calendar); }
/* Altri attributi del prodotto (inc/product.php, gdv_wine_facts()): un'etichetta */
.gdv-fact--tag { --gdv-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 12.2V4.5a1 1 0 0 1 1-1h7.7l8.3 8.3a1 1 0 0 1 0 1.4l-7.3 7.3a1 1 0 0 1-1.4 0z'/%3E%3Ccircle cx='8' cy='8' r='1.4'/%3E%3C/svg%3E"); }
.gdv-fact dt {
  color: var(--c-text-soft);
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
}
.gdv-fact dd {
  margin: 0.1rem 0 0;
  color: var(--c-ink);
  font-weight: 500;
  line-height: 1.35;
}

/* Descrizione breve */
.single-product .woocommerce-product-details__short-description {
  margin-top: 2rem;
}
.single-product .woocommerce-product-details__short-description p {
  max-width: 62ch;
  margin: 0;
}
.single-product .woocommerce-product-details__short-description p + p {
  margin-top: 0.45rem;
}

/* ---------- Sotto la scheda ---------------------------------------------- */
.single-product div.product > .gdv-impegni {
  margin-top: clamp(2rem, 5vw, 3rem);
}

/* Questo vino fa per me? */
.gdv-section .gdv-forme__title {
  margin-bottom: 2.5rem;
  text-align: center;
  text-transform: uppercase;
  font-size: clamp(2rem, 4vw, 3rem);
}
.gdv-forme__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
}
.gdv-section.gdv-forme h3 {
  margin-bottom: 1.1rem;
  font-size: 2rem;
}
.gdv-section.gdv-forme h3:not(:first-child) {
  margin-top: 2.25rem;
}
.gdv-forme__col > p {
  max-width: 62ch;
}
.gdv-section.gdv-forme .gdv-forme__lead {
  margin: -0.6rem 0 1rem;
  color: var(--c-text-soft);
  font-size: 0.9rem;
}
/* Il profilo: le 12 caratteristiche, accese (con la spunta) quelle del testo (inc/wine-profile.php) */
.gdv-taste {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gdv-taste li {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--c-ink);
  color: var(--c-text-soft);
  font-family: var(--f-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.gdv-taste li.is-on {
  color: var(--c-ink);
  font-weight: 800;
}
.gdv-taste li.is-on::after {
  content: "✓";
  color: var(--c-accent-text);
  font-family: var(--f-body);
  font-weight: 700;
}
/* Note aromatiche (cerchi colorati) e abbinamenti (icone) */
.gdv-aromas,
.gdv-pairings {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.gdv-aromas li,
.gdv-pairings li {
  margin: 0;
  color: var(--c-ink);
  font-size: 0.9rem;
  line-height: 1.25;
  text-align: center;
}
.gdv-aromas li {
  width: 84px;
}
.gdv-aromas span {
  display: block;
  width: 76px;
  height: 76px;
  margin: 0 auto 0.4rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.45), transparent 40%), var(--a);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.gdv-pairings li {
  width: 92px;
}
/* Icone degli abbinamenti (inc/wine-profile.php) in un cerchio bianco, come i cerchi degli aromi */
.gdv-pairings svg {
  display: block;
  box-sizing: border-box;
  width: 76px;
  height: 76px;
  margin: 0 auto 0.45rem;
  padding: 15px;
  border-radius: 50%;
  background: #fff;
  color: var(--c-ink);
}
.gdv-pairings .c { fill: #f5ead6; }
.gdv-pairings .s { fill: var(--c-accent-soft); }
.gdv-pairings .b { fill: #e1e8ef; }
.gdv-pairings .o { fill: #f8d9bd; }
.gdv-pairings .a { fill: #e3b979; }
.gdv-pairings .w { fill: #fff; }
.gdv-pairings .rf { fill: var(--c-accent); }
.gdv-pairings :is(.r, .i) { stroke: none; }
.gdv-pairings .r { fill: var(--c-accent); }
.gdv-pairings .i { fill: currentColor; }
.gdv-section.gdv-forme .gdv-forme__small {
  color: var(--c-text-soft);
  font-size: 0.92rem;
}
.gdv-section.gdv-forme .gdv-pairings + .gdv-forme__small {
  margin-top: 1.75rem;
}
.gdv-forme__plain {
  max-width: 760px;
  margin-inline: auto;
}
.gdv-forme__plain > * + * {
  margin-top: 0.8rem;
}
.gdv-tech {
  margin: 0;
}
.gdv-tech div {
  padding: 0.35rem 0;
}
.gdv-tech dt {
  display: inline;
  color: var(--c-ink);
  font-weight: 700;
}
.gdv-tech dt::after {
  content: ": ";
}
.gdv-tech dd {
  display: inline;
  margin: 0;
}
.gdv-section .gdv-tech__note {
  margin-top: 0.8rem;
  color: var(--c-text-soft);
  font-size: 0.92rem;
}

.gdv-btn-dark-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0.7rem 1.4rem;
  border-radius: var(--r);
  background: var(--c-ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.gdv-btn-dark-link:hover {
  background: var(--c-ink-dark);
  color: #fff;
}

/* Correlati: "Ti potrebbero piacere" in carosello */
.single-product .related.products {
  padding-block: 0 var(--gdv-section, 4rem);
}
.single-product .related.products .ct-module-title {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  text-transform: none;
}
.single-product .related.products ul.products {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3 * 1.5rem) / 4);
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--c-ink) var(--c-line);
}
.single-product .related.products ul.products > li {
  scroll-snap-align: start;
}

/* ---------- Barra d'acquisto fissa (creata da theme.js) ------------------ */
.gdv-sticky-buy {
  position: fixed;
  inset: auto 0 0;
  z-index: 40;
  border-top: 1px solid var(--c-line);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transform: translateY(110%);
  transition: transform 0.25s ease;
}
.gdv-sticky-buy.is-visible {
  transform: none;
}
.gdv-sticky-buy__in {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: var(--theme-normal-container-max-width, 1440px);
  margin-inline: auto;
  padding: 0.7rem var(--gdv-gut, 1.5rem) calc(0.7rem + env(safe-area-inset-bottom, 0px));
}
.gdv-sticky-buy__img {
  flex: none;
  width: 44px;
  height: 56px;
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
}
.gdv-sticky-buy__name {
  margin: 0;
  color: var(--c-ink);
  font-weight: 600;
  line-height: 1.25;
}
.gdv-sticky-buy__price {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.gdv-sticky-buy__price del,
.gdv-sticky-buy__price .gdv-pdp-badge,
.gdv-sticky-buy__price .screen-reader-text {
  display: none;
}
.gdv-sticky-buy__price ins {
  text-decoration: none;
}
.gdv-sticky-buy .wp-element-button {
  min-width: 220px;
  margin-left: auto;
}
.has-gdv-sticky-buy .ct-back-to-top {
  bottom: 5.5rem;
}

/* ---------- Responsive ----------------------------------------------------- */
@media (max-width: 1100px) {
  .single-product .related.products ul.products {
    grid-auto-columns: calc((100% - 2 * 1.5rem) / 3);
  }
}
@media (max-width: 860px) {
  .gdv-forme__grid {
    grid-template-columns: 1fr;
  }
  .single-product .related.products ul.products {
    gap: 1rem;
    grid-auto-columns: calc((100% - 1.2rem) / 2.2);
  }
  .gdv-sticky-buy .wp-element-button {
    min-width: 0;
  }
}
@media (max-width: 560px) {
  .gdv-facts {
    grid-template-columns: 1fr;
  }
  .gdv-sticky-buy__img {
    display: none;
  }
  .gdv-sticky-buy__name {
    font-size: 0.85rem;
  }
}
