/* =========================================================
   CLIENTY — EMERGENCY PRODUCT FIX V2
   Objetivo: evitar pantalla blanca, imágenes fijas e iconos gigantes
   en fichas WooCommerce tras quitar Elementor.
   ========================================================= */

/* Asegurar que el contenido del producto no queda oculto */
body.single-product .site-main,
body.single-product #content,
body.single-product main,
body.single-product .page-content,
body.single-product .entry-content,
body.single-product:not([class*="elementor-page-"]) .site-main {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-width: none !important;
}

/* Contenedor general del producto */
body.single-product .site-main {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.single-product .woocommerce div.product {
  width: min(1180px, calc(100% - 40px)) !important;
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 44px 0 70px !important;
  display: grid !important;
  grid-template-columns: minmax(260px, 500px) minmax(300px, 1fr) !important;
  gap: 48px !important;
  align-items: start !important;
}

/* Quitar floats clásicos de Woo */
body.single-product .woocommerce div.product div.images,
body.single-product .woocommerce div.product div.summary {
  float: none !important;
  width: auto !important;
  clear: none !important;
}

/* Imagen del producto: NO fija, NO sticky */
body.single-product .woocommerce div.product div.images,
body.single-product .woocommerce-product-gallery {
  position: static !important;
  top: auto !important;
  width: 100% !important;
  max-width: 500px !important;
  margin: 0 !important;
}

/* Imagen principal controlada */
body.single-product .woocommerce div.product div.images img,
body.single-product .woocommerce-product-gallery img,
body.single-product .woocommerce-product-gallery__image img,
body.single-product img.wp-post-image {
  display: block !important;
  width: 100% !important;
  max-width: 500px !important;
  max-height: 500px !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 auto !important;
  border-radius: 22px !important;
}

/* Miniaturas controladas */
body.single-product .woocommerce-product-gallery .flex-control-thumbs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin: 16px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs li {
  width: 68px !important;
  float: none !important;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs img {
  width: 68px !important;
  height: 68px !important;
  max-width: 68px !important;
  max-height: 68px !important;
  object-fit: contain !important;
  border-radius: 12px !important;
  border: 1px solid #e5e7eb !important;
}

/* Columna resumen */
body.single-product .woocommerce div.product div.summary {
  width: 100% !important;
  max-width: 560px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Título */
body.single-product .product_title,
body.single-product .entry-title {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size: clamp(30px, 4vw, 54px) !important;
  line-height: 1.05 !important;
  letter-spacing: -0.05em !important;
  font-weight: 900 !important;
  color: #111827 !important;
  margin: 0 0 18px !important;
}

/* Precio */
body.single-product .woocommerce div.product p.price,
body.single-product .woocommerce div.product span.price {
  color: #111827 !important;
  font-size: clamp(30px, 4vw, 48px) !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  margin: 0 0 22px !important;
}

body.single-product .woocommerce div.product p.price del,
body.single-product .woocommerce div.product span.price del {
  display: inline !important;
  opacity: .35 !important;
  font-size: .55em !important;
  margin-right: 10px !important;
}

body.single-product .woocommerce div.product p.price ins,
body.single-product .woocommerce div.product span.price ins {
  text-decoration: none !important;
}

/* Descripción corta */
body.single-product .woocommerce-product-details__short-description {
  color: #4b5563 !important;
  font-size: 17px !important;
  line-height: 1.65 !important;
  margin: 0 0 26px !important;
}

/* Formulario de compra */
body.single-product form.cart {
  display: grid !important;
  gap: 16px !important;
  margin: 26px 0 !important;
  padding: 22px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 22px !important;
  background: #f8fafc !important;
}

/* Variaciones */
body.single-product table.variations {
  width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
}

body.single-product table.variations tr,
body.single-product table.variations td,
body.single-product table.variations th {
  display: block !important;
  width: 100% !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 0 12px !important;
  text-align: left !important;
}

body.single-product table.variations label {
  display: block !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #111827 !important;
  margin: 0 0 7px !important;
}

body.single-product table.variations select,
body.single-product form.cart input,
body.single-product form.cart select {
  width: 100% !important;
  min-height: 48px !important;
  padding: 10px 14px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  color: #111827 !important;
  font: inherit !important;
}

/* Cantidad */
body.single-product .quantity {
  display: inline-flex !important;
  align-items: center !important;
  width: auto !important;
}

body.single-product .quantity input.qty {
  width: 82px !important;
  text-align: center !important;
}

/* Botón comprar */
body.single-product .single_add_to_cart_button,
body.single-product button.single_add_to_cart_button,
body.single-product .woocommerce button.button.alt {
  width: 100% !important;
  min-height: 56px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: #111827 !important;
  color: #ffffff !important;
  font-size: 17px !important;
  font-weight: 900 !important;
  text-transform: none !important;
  box-shadow: 0 16px 32px rgba(17, 24, 39, .16) !important;
  cursor: pointer !important;
}

body.single-product .single_add_to_cart_button:hover,
body.single-product .woocommerce button.button.alt:hover {
  background: #000000 !important;
  color: #ffffff !important;
}

/* =========================================================
   CORRECCIÓN IMPORTANTE: ICONOS / SVG GIGANTES
   ========================================================= */

/* Cualquier SVG dentro del contenido del producto queda limitado */
body.single-product .summary svg,
body.single-product .entry-summary svg,
body.single-product .woocommerce-product-details__short-description svg,
body.single-product .woocommerce-tabs svg,
body.single-product .woocommerce-Tabs-panel svg,
body.single-product .product_meta svg,
body.single-product .entry-content svg,
body.single-product .page-content svg {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* Si algún bloque antiguo usa iconos enormes como imagen */
body.single-product .summary img[src*="icon"],
body.single-product .entry-summary img[src*="icon"],
body.single-product .woocommerce-product-details__short-description img[src*="icon"],
body.single-product .woocommerce-tabs img[src*="icon"],
body.single-product .woocommerce-Tabs-panel img[src*="icon"],
body.single-product .entry-content img[src*="icon"] {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain !important;
}

/* Bloques de características antiguos */
body.single-product .ch-image-feature svg,
body.single-product .cy-feature svg,
body.single-product .cy-icon svg,
body.single-product .feature-icon svg,
body.single-product .icon svg,
body.single-product [class*="icon"] svg {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
}

/* Si Elementor dejó iconos SVG sin tamaño */
body.single-product .elementor-icon,
body.single-product .elementor-icon svg,
body.single-product .elementor-widget-icon svg,
body.single-product .elementor-icon-box-icon svg {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  font-size: 32px !important;
  line-height: 1 !important;
}

/* Evitar que SVG hereden tamaños absurdos de contenedores */
body.single-product svg[width="100%"],
body.single-product svg[height="100%"] {
  width: 28px !important;
  height: 28px !important;
}

/* No tocar el icono flotante de WhatsApp */
#clienty-whatsapp-float-button img,
#clienty-whatsapp-float-button svg,
body.single-product #clienty-whatsapp-float-button img,
body.single-product #clienty-whatsapp-float-button svg {
  width: 50px !important;
  height: 50px !important;
  max-width: 50px !important;
  max-height: 50px !important;
}

/* Descripción larga / tabs */
body.single-product .woocommerce-tabs {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 980px !important;
  margin: 48px auto 0 !important;
  padding: 0 !important;
  clear: both !important;
}

body.single-product .woocommerce-Tabs-panel {
  color: #374151 !important;
  font-size: 17px !important;
  line-height: 1.75 !important;
}

/* Productos relacionados */
body.single-product .related.products,
body.single-product .upsells.products {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 1180px !important;
  margin: 56px auto 0 !important;
}

/* Responsive */
@media (max-width: 900px) {
  body.single-product .woocommerce div.product {
    display: block !important;
    width: min(100% - 28px, 720px) !important;
    padding: 28px 0 60px !important;
  }

  body.single-product .woocommerce div.product div.images,
  body.single-product .woocommerce-product-gallery {
    position: static !important;
    max-width: 100% !important;
    margin: 0 auto 28px !important;
  }

  body.single-product .woocommerce div.product div.summary {
    max-width: 100% !important;
  }

  body.single-product .woocommerce div.product div.images img,
  body.single-product .woocommerce-product-gallery img,
  body.single-product img.wp-post-image {
    max-width: 100% !important;
    max-height: 360px !important;
  }
}

@media (max-width: 520px) {
  body.single-product .product_title,
  body.single-product .entry-title {
    font-size: 30px !important;
  }

  body.single-product .woocommerce div.product p.price,
  body.single-product .woocommerce div.product span.price {
    font-size: 32px !important;
  }

  body.single-product .woocommerce-product-details__short-description {
    font-size: 16px !important;
  }
}