
/* Mecano Lab V78 - lightbox immagini prodotto e immagini tecniche in descrizione */

.mecano-product-gallery .woocommerce-product-gallery__trigger{
  display:none !important;
}

.mecano-product-gallery .woocommerce-product-gallery__image > a{
  position:relative;
  display:block;
  cursor:zoom-in;
}

.mecano-product-gallery .woocommerce-product-gallery__image > a::after{
  content:"";
  position:absolute;
  right:16px;
  bottom:16px;
  width:42px;
  height:42px;
  border:1px solid rgba(255,255,255,.55);
  border-radius:50%;
  background:
    rgba(12,18,24,.78)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3Cpath d='M11 8v6M8 11h6'/%3E%3C/svg%3E")
    center/22px 22px no-repeat;
  box-shadow:0 8px 20px rgba(0,0,0,.24);
  pointer-events:none;
  transition:transform .18s ease, background-color .18s ease;
}

.mecano-product-gallery .woocommerce-product-gallery__image > a:hover::after{
  transform:scale(1.06);
  background-color:var(--orange, #f15a13);
}

.mecano-product-lightbox{
  position:fixed;
  inset:0;
  z-index:2147483600;
  display:none;
  align-items:center;
  justify-content:center;
  padding:34px;
  background:rgba(4,7,10,.78);
  backdrop-filter:blur(5px);
}

.mecano-product-lightbox.is-open{
  display:flex;
}

.mecano-product-lightbox__dialog{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:auto;
  max-width:min(1100px, 88vw);
  max-height:calc(100vh - 68px);
  padding:14px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:20px;
  background:#fff;
  box-shadow:0 28px 90px rgba(0,0,0,.48);
}

.mecano-product-lightbox__image{
  display:block;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:78vh;
  border-radius:12px;
  object-fit:contain;
  touch-action:pinch-zoom;
  user-select:none;
  -webkit-user-drag:none;
}

.mecano-product-lightbox__close{
  position:absolute;
  top:-18px;
  right:-18px;
  z-index:2;
  display:grid;
  place-items:center;
  width:46px;
  height:46px;
  padding:0;
  border:2px solid #fff;
  border-radius:50%;
  background:#111820;
  color:#fff;
  font-family:Arial, sans-serif;
  font-size:29px;
  font-weight:400;
  line-height:1;
  cursor:pointer;
  box-shadow:0 10px 26px rgba(0,0,0,.35);
  transition:background .18s ease, transform .18s ease;
}

.mecano-product-lightbox__close:hover,
.mecano-product-lightbox__close:focus{
  background:var(--orange, #f15a13);
  transform:scale(1.05);
  outline:none;
}

body.mecano-product-lightbox-open{
  overflow:hidden;
}

@media (max-width:700px){
  .mecano-product-gallery .woocommerce-product-gallery__image > a::after{
    right:10px;
    bottom:10px;
    width:38px;
    height:38px;
    background-size:20px 20px;
  }

  .mecano-product-lightbox{
    padding:10px;
    background:rgba(4,7,10,.86);
  }

  .mecano-product-lightbox__dialog{
    width:calc(100vw - 20px);
    max-width:none;
    max-height:calc(100vh - 20px);
    padding:8px;
    border-radius:16px;
  }

  .mecano-product-lightbox__image{
    max-width:100%;
    max-height:calc(100vh - 56px);
    border-radius:10px;
  }

  .mecano-product-lightbox__close{
    top:8px;
    right:8px;
    width:44px;
    height:44px;
    border-width:1px;
    font-size:27px;
  }
}

@media (prefers-reduced-motion:reduce){
  .mecano-product-lightbox__close,
  .mecano-product-gallery .woocommerce-product-gallery__image > a::after{
    transition:none;
  }
}

/* Immagini tecniche inserite nella descrizione del prodotto */
.mecano-product-details a.mecano-description-lightbox{
  position:relative;
  display:block;
  width:fit-content;
  max-width:100%;
  margin:24px auto;
  cursor:zoom-in;
  line-height:0;
}

.mecano-product-details a.mecano-description-lightbox img{
  display:block;
  max-width:100%;
  height:auto;
  margin:0 auto!important;
}

.mecano-product-details a.mecano-description-lightbox::after{
  content:"";
  position:absolute;
  right:16px;
  bottom:16px;
  width:42px;
  height:42px;
  border:1px solid rgba(255,255,255,.55);
  border-radius:50%;
  background:
    rgba(12,18,24,.78)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3Cpath d='M11 8v6M8 11h6'/%3E%3C/svg%3E")
    center/22px 22px no-repeat;
  box-shadow:0 8px 20px rgba(0,0,0,.24);
  pointer-events:none;
  transition:transform .18s ease, background-color .18s ease;
}

.mecano-product-details a.mecano-description-lightbox:hover::after{
  transform:scale(1.06);
  background-color:var(--orange, #f15a13);
}

@media (max-width:700px){
  .mecano-product-details a.mecano-description-lightbox::after{
    right:10px;
    bottom:10px;
    width:38px;
    height:38px;
    background-size:20px 20px;
  }
}

@media (prefers-reduced-motion:reduce){
  .mecano-product-details a.mecano-description-lightbox::after{
    transition:none;
  }
}


/* V78: le immagini inserite normalmente nella descrizione vengono riconosciute automaticamente */
.mecano-product-details .woocommerce-Tabs-panel--description img{
  cursor:zoom-in;
}

/* Mecano Lab V82 - lightbox più ampio, utile anche per immagini verticali */
.mecano-product-lightbox{
  padding:18px!important;
}
.mecano-product-lightbox__dialog{
  max-width:min(1480px,96vw)!important;
  max-height:calc(100vh - 36px)!important;
  padding:8px!important;
  border-radius:18px!important;
}
.mecano-product-lightbox__image{
  max-width:94vw!important;
  max-height:90vh!important;
}
@media(max-width:700px){
  .mecano-product-lightbox{
    padding:8px!important;
  }
  .mecano-product-lightbox__dialog{
    width:calc(100vw - 16px)!important;
    max-height:calc(100vh - 16px)!important;
  }
  .mecano-product-lightbox__image{
    max-height:calc(100vh - 38px)!important;
  }
}
