/* =============================================================================
   ME STUDIO — product.css
   Stili della PAGINA PRODOTTO singola (WooCommerce + Blocksy).
   Caricato solo su is_product() dall'enqueue condizionale.

   SEZIONI:
     1. Layout galleria + colonna riepilogo
     2. Attributi prodotto (variazioni in colonna)
     3. Sottotitolo prodotto (campo custom _ms_subtitle)
     4. Prezzo: "IVA inclusa" + stato spedizione
     5. Guida alle taglie
     6. Selezione misura (swatch variazioni)
     7. Motivazioni (spedizione/reso/punti)
     8. Schede prodotto (accordion tab)
     9. Galleria miniature Flexy (DISATTIVATA — vedi nota)
    10. Banner Me Club
    11. Galleria stacked → slider custom (frecce + dots)
   ============================================================================= */
.entry-summary-items > .ct-product-add-to-cart {
  margin-bottom: 15px !important;
  padding-bottom: 26px;
  border-bottom: 1px solid #f3f3f3;
}

.type-product.product .yith-par-message-variation,
.type-product.product .yith-par-message {
  margin-top: 15px !important;
}

/* accordion*/
.woocommerce-tabs[data-type*="type-3"] .ct-accordion-heading {
  padding: 18px 8px !important;
  border: 1px solid #f3f3f3 !important;
}
.woocommerce-tabs[data-type*="type-3"] .entry-content {
  box-shadow: none !important;
  background-color: var(--theme-palette-color-8) !important;
}
/* =============================================================================
   0. BREADCRUMBS DI BLOCKSY
   ============================================================================= */
.ct-breadcrumbs {
  margin-top: 20px !important;
  margin-bottom: 20px !important;
}

/* =============================================================================
   1. LAYOUT GALLERIA + COLONNA RIEPILOGO
   ============================================================================= */

/* Spazio sopra la pagina prodotto (stacca dal margine header). */
.single-product [data-vertical-spacing*="top"] {
  padding-top: 90px !important;
}
@media (max-width: 998.99px) {
  .single-product [data-vertical-spacing*="top"] {
    padding-top: 0 !important;
  }
}
@media (min-width: 999px) {
  .ms-gallery-controls {
    display: none;
  }
}
/* [DISATTIVATO] Larghezza galleria custom su desktop. Tenuto come riferimento
   se un domani si vuole ridefinire la proporzione galleria/riepilogo. */
/* @media (min-width: 1000px) {
  .ct-default-gallery,
  .ct-stacked-gallery {
    width: calc(var(--product-gallery-width, 50%) - 6vw);
  }
} */

/* [DISATTIVATO] Prima immagine della galleria stacked a doppia colonna. */
/* .ct-stacked-gallery-container .ct-media-container:nth-child(1) {
  grid-column: 1/3;
  position: relative;
} */

/* Fondo della galleria (colore tenue dietro le foto). */
.ct-default-gallery,
.ct-stacked-gallery {
  background-color: var(--theme-palette-color-6);
}

/* Padding inferiore del blocco prodotto. */
.product .product-entry-wrapper.is-width-constrained {
  padding-bottom: var(--theme-content-vertical-spacing) !important;
}

/* Desktop: il riepilogo occupa tutta la larghezza disponibile della sua colonna
   (annulla i vincoli di larghezza del tema), con un filo di padding a destra. */
@media (min-width: 1000px) {
  .product .product-entry-wrapper.is-width-constrained {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    width: 100%;
    padding-right: 2vw;
  }
}

/* =============================================================================
   2. ATTRIBUTI PRODOTTO
   Mette etichetta e valore in colonna invece che affiancati.
   ============================================================================= */
.ct-product-attribute {
  flex-direction: column;
}
.ct-product-attribute .ct-attributes-label {
  margin-right: auto; /* etichetta allineata a sinistra */
}

/* =============================================================================
   3. SOTTOTITOLO PRODOTTO
   Campo custom _ms_subtitle (es. "Waterproof"), stampato sotto il titolo.
   ============================================================================= */
.ms-product-subtitle {
  --theme-font-family: ct_font_aujournuit, Sans-Serif;
  font-family: var(--theme-font-family);
  font-weight: 400;
  font-size: 17px;
  margin-bottom: 26px !important;
}

/* Larghezza massima della descrizione breve (leggibilità: ~50 caratteri/riga). */
.woocommerce-product-details__short-description p {
  max-width: 50ch;
  font-size: 19px !important;
}

/* =============================================================================
   4. PREZZO — "IVA inclusa" + stato spedizione
   (I testi sono generati in woocommerce-functions.php, sezione prezzo.)
   ============================================================================= */

/* "IVA inclusa": piccolo, accanto al prezzo. */
.ms-tax {
  font-size: 14px;
  opacity: 0.75;
  color: var(--theme-palette-color-3);
  letter-spacing: 0;
  font-weight: 400;
}

/* Stato spedizione ("Ti mancano X €..."): sotto il prezzo. */
.ms-shipping-status {
  margin-top: 4px;
  display: block;
  opacity: 0.75;
  color: var(--theme-palette-color-3);
  letter-spacing: 0;
  font-weight: 400;
}

/* Spedizione raggiunta: colore diverso + grassetto.
   NB: la prima regola .is-free è sovrascritta dalla seconda (color-5 vince).
   Se serve, unificare in una sola regola. */
.ms-shipping-status.is-free {
  color: var(--theme-palette-color-3);
}
.ms-shipping-status.is-free {
  color: var(--theme-palette-color-5);
  font-weight: 600;
}

/* =============================================================================
   6. SELEZIONE MISURA (swatch variazioni)
   ============================================================================= */

/* Spazio tra le righe della tabella variazioni. */
form.variations_form table.variations tr {
  gap: 6px !important;
}

/* Centra i controlli variazione nella cella. */
.entry-summary-items table.variations td {
  justify-content: center;
}

/* Swatch non selezionato: testo sbiadito (40% opacità del marrone). */
.ct-swatch-container .ct-swatch-content {
  color: rgba(73, 55, 43, 0.4) !important;
}
/* Swatch attivo (misura selezionata): testo pieno. */
.ct-swatch-container.active .ct-swatch-content {
  color: var(--theme-palette-color-4) !important;
}

/* =============================================================================
   7. MOTIVAZIONI (blocchi spedizione / reso / punti)
   Limita la larghezza delle descrizioni per un'impaginazione ordinata.
   ============================================================================= */
.motivazioni .desc {
  max-width: 13ch;
}
.motivazioni .desc-3 {
  max-width: 17ch;
}

/* =============================================================================
   8. SCHEDE PRODOTTO (accordion tab: Descrizione, Spedizione e reso)
   ============================================================================= */
.woocommerce-tabs[data-type*="type-3"] .ct-accordion-heading {
  border-color: var(--theme-palette-color-7);
}
.woocommerce-tabs[data-type*="type-3"] .entry-content {
  box-shadow: inset 0 2px 4px -2px rgba(0, 0, 0, 0.12); /* ombra interna sottile */
  background-color: #fdfdfd;
  padding-left: 1vw;
  padding-right: 1vw;
}

/* =============================================================================
   8.BENNER ME CLUB
   ============================================================================= */

.ms-meclub-banner .me-club-img img {
  width: 180px;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 689px) {
  .ms-meclub-banner .me-club-img img {
    width: 100px;
    height: 100px;
  }
}
/* =============================================================================
   11. GALLERIA STACKED → SLIDER CUSTOM (frecce + dots)
   -----------------------------------------------------------------------------
   Blocksy serve la galleria in layout "stacked" (figure impilate). Un JS
   vanilla (view.js / child-script) la trasforma in slider: crea un wrapper
   esterno FERMO (.ms-gallery-wrap) e ci sposta dentro lo scroller
   (.ct-stacked-gallery-container), poi inietta frecce e dots NEL WRAPPER.
   Perché nel wrapper e non nello scroller: lo scroller scorre orizzontalmente,
   quindi frecce/dots messi lì scorrerebbero via con le immagini. Nel wrapper
   fermo restano visibili.
   ============================================================================= */

/* --- Stato base della galleria stacked come slider ---
   NB: queste tre regole sono ridondanti con quelle dentro .ms-gallery-wrap
   più sotto (che vincono per specificità). Tenute per il caso in cui il JS
   non abbia ancora avvolto lo scroller nel wrapper (fallback visivo). */

.woocommerce-product-gallery
  .ct-stacked-gallery-container
  .ct-media-container:nth-child(1) {
  grid-column: 1 / 3;
  position: relative;
}

@media (min-width: 999.98px) {
  .woocommerce-product-gallery .ct-stacked-gallery-container {
    border-top: 1px solid #e5e5e5;
  }
}
@media (min-width: 999.98px) {
  .woocommerce-product-gallery .ct-stacked-gallery-container::after {
    position: absolute;
    content: "";
    right: 0;
    top: 0;
    height: 100%;
    width: 1px;
    background-color: #e5e5e5;
  }
}

@media (max-width: 998.99px) {
  .product-entry-wrapper:has(
      .woocommerce-product-gallery:not(
        [data-gallery="top"],
        [data-gallery="columns-top"]
      )
    )
    .woocommerce-product-gallery {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 15px;
    margin-bottom: 15px !important;
  }
  .ct-stacked-gallery-container {
    position: relative;
    display: flex !important;
    overflow: hidden;
    scroll-behavior: smooth;
  }
  .ct-stacked-gallery-container .ct-media-container {
    flex: 0 0 100%; /* una foto per volta, piena larghezza */
    margin: 0;
    scroll-snap-align: start;
  }
  .ct-stacked-gallery-container .ct-media-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Wrapper: colonna (immagine sopra, controlli sotto) */
  .ms-gallery-wrap {
    position: relative;
  }

  /* Scroller immagini */
  .ms-gallery-wrap .ct-stacked-gallery-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .ms-gallery-wrap .ct-stacked-gallery-container::-webkit-scrollbar {
    display: none;
  }
  .ms-gallery-wrap .ct-media-container {
    flex: 0 0 100%;
    margin: 0;
    scroll-snap-align: start;
  }
  .ms-gallery-wrap .ct-media-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Barra controlli: dots al centro, frecce a destra */
  .ms-gallery-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* tre colonne: vuoto | dots | frecce */
    align-items: center;
    margin-top: 1rem;
  }

  /* Dots: colonna centrale, centrati */
  .ms-gallery-dots {
    grid-column: 2;
    display: flex;
    gap: 8px;
    justify-content: center;
  }

  /* Frecce: colonna destra, allineate a destra */
  .ms-gallery-arrows {
    grid-column: 3;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
  }

  .ms-gallery-arrow--next,
  .ms-gallery-arrow--prev {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--wp--preset--color--palette-color-3);
    cursor: pointer;
    transition: background 0.2s ease;
  }
  .ms-gallery-arrow--next:hover svg,
  .ms-gallery-arrow--prev:hover svg {
    fill: var(--wp--preset--color--palette-color-1);
  }
  .ms-gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(73, 55, 43, 0.25);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease;
  }
  .ms-gallery-dot.is-active {
    background: var(--wp--preset--color--palette-color-3);
  }
}

/* ------------------------------------------------------------------------- 
   Aggiungi al carrello POPUP
   ------------------------------------------------------------------------- */
.ct-module-title {
  font-size: 0.725rem !important;
  font-weight: 400 !important;
  letter-spacing: 2px;
}
#ct-added-to-cart-popup .ct-added-to-cart-message {
  font-size: 0.8rem !important;
}
#ct-added-to-cart-popup .ct-added-to-cart-popup-shipping {
  font-weight: 400 !important;
}

.ct-suggested-products--cart-popup [data-products] .ct-product-title {
  font-weight: 400 !important;
}
.ct-suggested-products--cart-popup [data-products] .price {
  font-size: 1rem !important;
}

#ct-added-to-cart-popup .ct-popup-actions {
  flex-direction: row-reverse;
  gap: 5px !important;
}

#ct-added-to-cart-popup .ct-popup-actions a {
  min-width: 100%;
}

#ct-added-to-cart-popup .ct-media-container img {
  aspect-ratio: 1 / 1 !important;
}

#ct-added-to-cart-popup .woocommerce-loop-product__title {
  color: var(--theme-palette-color-2) !important;
  font-size: 0.9rem !important;
}
#ct-added-to-cart-popup .ct-product-title-price .price {
  font-weight: 500 !important;
  font-size: 0.9rem !important;
}

#ct-added-to-cart-popup .ct-added-to-cart-popup-total {
  font-size: 0.95rem !important;
}
#ct-added-to-cart-popup .ct-product-bundles {
  font-weight: 400 !important;
}

#ct-added-to-cart-popup
  :is(.ct-product-attributes, .ct-product-bundles, .ct-product-totals) {
  border-top: 1px solid var(--theme-palette-color-7) !important;
}
#ct-added-to-cart-popup
  :is(.ct-added-to-cart-product, .ct-popup-actions):not(:last-child) {
  border-bottom: 1px solid var(--theme-palette-color-7) !important;
}

@media (max-width: 689.98px) {
  #ct-added-to-cart-popup .ct-popup-actions {
    flex-direction: column;
  }
}

/* ------------------------------------------------------------------------- 
   Floating bar
   ------------------------------------------------------------------------- */
/*Struttura*/
.ct-drawer-canvas[data-floating-bar] {
  --floating-bar-height: auto;
  box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px !important;
}
.ct-drawer-canvas[data-floating-bar] .ct-drawer-inner {
  min-width: 500px !important;
  bottom: 20px !important;
  right: unset !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
}
.ct-floating-bar {
  height: 100% !important;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 5px;
  border-radius: 0;
}
.ct-floating-bar .ct-container {
  width: 100% !important;
}

.ct-floating-bar .edt-tax-shipping-info {
  display: none;
}
.ct-floating-bar .product-title {
  font-size: 13px !important;
  font-weight: 400 !important;
}
/*Quantity*/
.ct-floating-bar .quantity[data-type="type-2"] {
  height: 100%;
}

.ct-floating-bar .quantity[data-type="type-2"] input[type="number"] {
  border-color: var(--theme-palette-color-5) !important;
  height: 100%;
}
/*Button*/
.ct-floating-bar .ct-floating-bar-actions form,
.ct-floating-bar .ct-floating-bar-actions .button {
  height: 100%;
  font-size: 11px;
}

.ct-floating-bar .added_to_cart {
  display: none !important;
}

.ct-floating-bar .ct-media-container {
  max-width: 55px !important;
}

.ct-floating-bar :is(.price, .stock) {
  font-size: 0.925rem !important;
}

.ct-floating-bar .product-price {
  row-gap: 10px;
}
.ct-floating-bar .edt-instead-of {
  font-size: 0.7rem !important;
}

@media (max-width: 689.98px) {
  .ct-drawer-canvas[data-floating-bar] .ct-drawer-inner {
    width: 95% !important;
    min-width: auto !important;
    right: 2.5% !important;
  }
  .ct-floating-bar .ct-media-container {
    display: block !important;
  }

  .ct-floating-bar-actions
    :is(
      .added_to_cart,
      .single_add_to_cart_button,
      .product_type_variable.button
    ) {
    position: relative;
    min-width: 60px !important;
    max-width: 60px !important;
  }

  .ct-floating-bar-actions
    :is(
      .product_type_variable.button,
      .single_add_to_cart_button:not(.loading)
    ):after {
    position: absolute;
    left: 52%;
    font-size: 0.725rem !important;
    transform: translateX(-50%);
  }
}

.ct-out-of-stock .ct-swatch-content {
  opacity: 1 !important;
  color: #222 !important;
}
[data-swatches-type="button"] [aria-pressed="true"] .ct-swatch {
  --swatch-button-text-color: #222 !important;
  --swatch-button-border-color: #222 !important;
  --swatch-button-background-color: rgba(255, 255, 255, 0);
  border-width: 1px !important;
}
