/*
 * WC Single Product – Scopelliti1887
 * -------------------------------------------------
 * Obiettivi:
 * 1) Ottimizzazione e unione regole duplicate
 * 2) Commenti chiari per sezioni e scopi
 * 3) Piccole correzioni (es. @media, margini, proprietà ridondanti)
 * Nota: manteniamo la compatibilità con Astra/WooCommerce.
 */

/* ==================================================
   TIPOGRAFIA E PREZZO
   ==================================================*/
.woocommerce div.product p.price {
  margin: 1em 0 0;
  line-height: normal;
  font-weight: bold;
}

/* Titoli interni al prodotto */
div.product h2 {
  text-transform: uppercase;
  font-size: 15px;
}

/* Omnibus / prezzo storico */
.woocommerce div.product .iworks-omnibus { margin-bottom: 0; }
.woocommerce div.product p.price:has(+ p.iworks-omnibus) { margin: 2rem 0 .5rem; }
.woocommerce-js div.product p.price ins { font-weight: bold; }

/* ==================================================
   ADD TO CART / QUANTITY / WISHLIST
   ==================================================*/
.woocommerce div.product .add-cart-container .quantity.buttons_added {
  border-radius: 20px;
  border: 1px solid;
  margin: 0;
}

/* Pulsanti +/- e campo qty */
.woocommerce-js .quantity .minus,
.woocommerce .quantity .plus,
.woocommerce div.product .add-cart-container .quantity.buttons_added input.qty {
  border: none;
  margin: 0;
  width: 1.75em;
}

/* Contenitore riga CTA: quantità + ATC + wishlist */
.add-cart-container {
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.add-cart-container .single_add_to_cart_button { /* il bottone prende lo spazio restante */
  flex: 1;
  width: 100%;
  text-align: center;
}

/* Elementi fissi (qty, wishlist) */
.add-cart-container .quantity,
.add-cart-container .tinv-wraper {
  flex: 0 0 auto;
}

/* Stile bottone ATC */
.woocommerce-js div.product form.cart .button {
  margin: 0;
  border-radius: 20px;
  background-color: var(--ast-global-color-7);
  color: #fff;
  padding: 12px 30px;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 22px;
}
.woocommerce-js div.product form.cart .button:hover {
  background-color: #2B2B2B;
}

/* ==================================================
   INFO CONSEGNA / TESTO IN EVIDENZA
   ==================================================*/
.consegnacustom span {
  display: inline-block;
  font-weight: bold;
}

/* Wrapper layout per tempi di spedizione + card WhatsApp */
.sc1887-grid {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.sc1887-grid .sc1887-grid-item { flex: 1; box-sizing: border-box; }

@media (max-width: 768px) {
  .sc1887-grid { flex-direction: column; align-items: stretch; gap: 20px; }
}

/* PALLINO STATO SPEDIZIONE / DISPONIBILITÀ */
.sc1887-grid .sc1887-grid-item:first-child {
  padding-left: 25px;
  position: relative;
}
.sc1887-grid .sc1887-grid-item:first-child p::before {
  position: absolute;
  top: 10px;
  left: 5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  content: "";
  display: block;
  background: #111111; /* default */
}
.sc1887-grid .sc1887-grid-item:first-child p.same::before { background: #068823; }
.sc1887-grid .sc1887-grid-item:first-child p.drop::before { background: #B79961; }

/* ==================================================
   4) CARD WHATSAPP
   ==================================================*/
.whatsapp-card {
  display: flex;
  align-items: center;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transition: transform .2s ease;
}
.whatsapp-card:hover { transform: translateY(-3px); }

.whatsapp-card .whatsapp-link { display: flex; align-items: center; text-decoration: none; }
.whatsapp-card .whatsapp-link:hover { color: inherit; }

.whatsapp-img {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 50%;
}
.whatsapp-img img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
}
.whatsapp-img p { margin: 0; font-weight: bold; }

.whatsapp-text { width: 50%; }
.whatsapp-text h3 { margin: 0; font-size: 40px; font-weight: 700; }
.whatsapp-text p { margin: 2px 0; font-size: .9rem; }

.whatsapp-claim { line-height: normal; padding: 5px 0; }

.whatsapp-phone { display: flex; align-items: center; gap: 6px; font-weight: bold; }
.whatsapp-phone svg { width: 27px; height: 27px; }

/* ==================================================
   ACCORDION SC1887 – STILE FLAT
   ==================================================*/
.sc1887-accordion { margin-top: 20px; border: 0; }
/* #sc1887-panel-1 ul { margin: 0 0 0 1.5em; } */

/* Item senza box, solo righe divisorie */
.sc1887-acc-item { border: 0; }

/* Titolo = pulsante */
.sc1887-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 10px 0;
  background: #fff;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #cfcfcf;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  font-size: inherit;
  line-height: 1.2;
  color: #111111;
  cursor: pointer;
  position: relative;
  transition: background .18s ease, color .18s ease;
}
.sc1887-acc-head:hover { background: transparent; border-color: #B79961; }
.sc1887-acc-head:focus { background: transparent; }

.sc1887-acc-head .sc1887-acc-svg { display: flex; align-items: center; }
.sc1887-acc-head .sc1887-acc-svg svg { transform: rotate(0deg); transition: transform .25s ease; }
.sc1887-acc-item.is-open .sc1887-acc-svg svg { transform: rotate(90deg); }
.sc1887-acc-head .sc1887-acc-svg svg path { fill: currentColor; }

/* Pannello */
.sc1887-acc-panel {
  margin: 5px 0 15px 21px;
  overflow: hidden;
  transition: height .26s ease, opacity .22s ease;
  opacity: 1;
}
.sc1887-acc-panel[hidden] { height: 0 !important; opacity: 0; }

/* Contenuti del pannello */
.sc1887-acc-inner { border: 0; font-size: 14px; line-height: 1.6; padding: 5px 0 10px; }
.sc1887-acc-inner p { margin: 0 0 10px; }
.sc1887-acc-inner p:last-child { margin-bottom: 0; }

/* Wrapper heading SEO-safe */
.sc1887-acc-title { margin: 0; padding: 0; font-size: inherit; font-weight: inherit; line-height: inherit; border: 0; }

/* Astra reset */
body.single-product .sc1887-acc-head,
body.single-product .sc1887-acc-inner { box-shadow: none; }

@media (min-width: 768px) {
  .sc1887-acc-head:hover{
  color: #B79961; 
  }
}

/* ==================================================
   GALLERIA IMMAGINI PRODOTTO
   ==================================================*/
/* Mantiene 1:1 e layout stabile */
.single-product .woocommerce-product-gallery__wrapper,
.single-product .woocommerce-product-gallery__image a,
.single-product .woocommerce-product-gallery__image img {
  aspect-ratio: 1 / 1; /* modifica se non 1:1 */
  width: 100%;
  height: auto;
  display: block;
}

/* Thumbs orizzontali con scroll */
.single-product .flex-control-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(72px, 96px);
  gap: .5rem;
  overflow-x: auto;
  padding: .5rem 0;
  -webkit-overflow-scrolling: touch;
}
.single-product .flex-control-thumbs li { list-style: none; margin: 0; }
.single-product .flex-control-thumbs img { width: 100%; height: auto; border-radius: 6px; opacity: .85; transition: opacity .2s, transform .2s; }
.single-product .flex-control-thumbs img:hover { opacity: 1; transform: scale(1.02); }

/* Per isolare i float delle colonne Astra/ Woo */
.woocommerce-js div.product { display: flow-root; }

/* Galleria sticky su viewport desktop */
@media (min-width: 922px) {
  .single-product .woocommerce-product-gallery {
    max-width: 560px;           /* limita la colonna immagine a ~560px reali */
    position: sticky !important;
    top: 150px;                 /* distanza dall'header fixed o top */
    align-self: flex-start;
  }
}

@media (max-width: 921px) {
  .single-product .sc1887-product-main-wrapper { display: block; }
}

/* ==================================================
   RELATED PRODUCTS
   ==================================================*/
   .single-product .up-sells.products,
.single-product .related.products {
  clear: both;
  float: none;
  margin-top: 3em;
}

/* ==================================================
   FORM COUPON IN PAGINA PRODOTTO
   ==================================================*/
.wc-product-coupon-wrap { margin-bottom: 15px; }
.wc-product-coupon-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wc-product-coupon-button { border-radius: 6px; }
.wc-product-coupon-notices { width: 100%; }

.wc-product-coupon-button.wc-as-link {
  font-weight: bold !important;
  background: none;
  border: none;
  padding: 10px 15px;
  margin: 0;
  font: inherit;
  transition: transform .2s ease;
}
.wc-product-coupon-button.wc-as-link:hover,
.wc-product-coupon-button.wc-as-link:focus {
  text-decoration: none;
  outline: none;
  transform: translateY(-3px);
}