/* MeteoSystem Woo Mobile Recovery v1.3.0
 * Correzione Avada: il blocco acquisto esiste ma puo' essere fuori posizione.
 * La regola principale e' server-safe: mai nascondere il blocco acquisto originale.
 */
.mswmr-native-panel { display: none; }
@media screen and (max-width: 767px) {
  body.single-product.mswmr-product-enabled .ms-product-breadcrumbs-wrap {
    padding-top: 8px !important; padding-bottom: 0 !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-hero {
    padding-top: 8px !important;
    padding-bottom: 12px !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-hero .fusion-builder-row {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 12px !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-hero .ms-product-gallery {
    display: flex !important;
    position: relative !important;
    order: 0 !important;
    --awb-order-small: 0;
    --awb-width-small: 100%;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-hero .ms-product-gallery img {
    max-width: 100% !important;
    height: auto !important;
  }
  /* Ripristino anche in assenza di JS: il blocco Avada originale non sparisce. */
  body.single-product.mswmr-product-enabled .ms-product-hero .ms-product-info {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    position: relative !important;
    order: 1 !important;
    --awb-width-small: 100%;
    --awb-order-small: 1;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  /* Il blocco viene spostato dal JS SUBITO DOPO l'hero / galleria,
     FUORI dal flex di Avada (non sotto i vantaggi). */
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached {
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    inset: auto !important;
    float: none !important;
    clear: both !important;
    order: 0 !important;
    --awb-width-small: 100%;
    --awb-order-small: 0;
    flex: none !important;
    box-sizing: border-box !important;
    width: calc(100% - 32px) !important;
    max-width: 1180px !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 2px auto 20px !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    clip-path: none !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached > .fusion-column-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached > .fusion-column-wrapper > * {
    min-width: 0 !important;
    max-width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .fusion-title,
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .fusion-woo-price-tb,
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .fusion-woo-short-description,
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .fusion-woo-cart-tb {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached h1 {
    font-size: clamp(27px, 7.3vw, 34px) !important;
    line-height: 1.22 !important;
    margin: 0 0 12px !important;
    overflow-wrap: anywhere !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .price {
    font-size: 26px !important;
    line-height: 1.3 !important;
    margin: 0 0 13px !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .woocommerce-product-details__short-description,
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .fusion-woo-short-description {
    font-size: 15px !important;
    line-height: 1.65 !important;
    overflow-wrap: anywhere !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached form.cart {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .single_add_to_cart_button {
    min-height: 48px !important;
    max-width: 100% !important;
    white-space: normal !important;
  }
  /* Fallback Woo nativo soltanto in assenza della colonna Avada */
  body.single-product.mswmr-product-enabled .mswmr-native-panel.mswmr-visible {
    display: block !important;
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 1180px;
    margin: 0 auto 20px;
    padding: 20px 18px;
    color: #0b2445;
    background: #fff;
    border: 1px solid #e0e7f1;
    border-radius: 14px;
    font-family: inherit;
  }
  body.single-product.mswmr-product-enabled .mswmr-native-panel .mswmr-title {
    font-size: clamp(27px, 7.3vw, 34px); line-height: 1.22; margin: 0 0 10px; color: #0b2445;
  }
  body.single-product.mswmr-product-enabled .mswmr-native-panel .mswmr-price {
    font-size: 26px; font-weight: 700; color: #f12f59; margin: 0 0 10px;
  }
  body.single-product.mswmr-product-enabled .mswmr-native-panel .mswmr-short-desc {
    font-size: 15px; line-height: 1.65; color: #35516f; margin: 0 0 16px;
  }
  body.single-product.mswmr-product-enabled .mswmr-native-panel form.cart {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  }
  body.single-product.mswmr-product-enabled .mswmr-native-panel .single_add_to_cart_button {
    min-height: 48px; background: #ff2855; color: #fff; border-radius: 8px;
  }
  body.single-product.mswmr-product-enabled .ms-product-features {
    padding-top: 4px !important; padding-bottom: 22px !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-description {
    padding-top: 8px !important;
    padding-bottom: 36px !important;
  }
}


/* v1.3.1 - sola rifinitura margini mobile, senza modificare il carrello.
 * L'elemento .ms-product-info viene spostato dal JS v1.3 fra hero e vantaggi.
 * Evitare regole generiche su .fusion-layout-column o form.cart.
 */
@media only screen and (max-width: 767px) {
  body.single-product.mswmr-product-enabled .ms-product-hero {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-hero .ms-product-gallery {
    margin-bottom: 2px !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached {
    box-sizing: border-box !important;
    width: calc(100% - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    min-width: 0 !important;
    margin: 10px auto 14px !important;
    padding: 0 !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached > .fusion-column-wrapper {
    box-sizing: border-box !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .fusion-title {
    margin-bottom: 5px !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .price {
    margin-bottom: 12px !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .woocommerce-product-details__short-description p {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .woocommerce-product-details__short-description p:last-child {
    margin-bottom: 0 !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-info.mswmr-detached .ms-product-bottom-meta {
    margin-top: 10px !important;
    padding-top: 8px !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-features {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 8px !important;
    padding-bottom: 10px !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-features .ms-feature-item {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    min-height: 0 !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-description {
    margin-top: 0 !important;
    padding-top: 16px !important;
    padding-bottom: 32px !important;
  }
  body.single-product.mswmr-product-enabled .ms-product-description .ms-product-tabs {
    margin-top: 0 !important;
  }
}


/* ============================================================
 * MeteoSystem Woo Mobile Recovery 1.3.2 - Anti-restringimento
 * Solo box acquisto gia' spostato dal JS v1.3.
 * Evita il ricalcolo % delle colonne Avada dopo il load.
 * ============================================================ */
@media only screen and (max-width: 767px) {
  body.single-product.mswmr-product-enabled
  .ms-product-info.mswmr-detached {
    /* La larghezza ora dipende dallo schermo, NON dal parent Avada. */
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 0 0 calc(100vw - 32px) !important;
    width: calc(100vw - 32px) !important;
    min-width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    margin: 12px auto 18px !important;
    padding: 0 !important;
    float: none !important;
    inset: auto !important;
    transform: none !important;
    overflow: visible !important;
    --awb-width-small: 100%;
    --awb-width-medium: 100%;
  }

  body.single-product.mswmr-product-enabled
  .ms-product-info.mswmr-detached > .fusion-column-wrapper {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.single-product.mswmr-product-enabled
  .ms-product-info.mswmr-detached > .fusion-column-wrapper > * {
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* I componenti WooCommerce restano originali e cliccabili. */
  body.single-product.mswmr-product-enabled
  .ms-product-info.mswmr-detached form.cart {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}
@media (max-width: 767px) {
  .ms-product-info.mswmr-detached {
    padding: 18px !important;
    box-sizing: border-box !important;
  }
}