/* Mucha & Kalma Personalizador Woo v1.4.2
   Layout anti-compresión para WooCommerce + Astra + Elementor.
   Objetivo: el personalizador siempre ocupa una fila completa antes de cantidad/botón. */

/* 1) Domar el formulario de WooCommerce sin romper variaciones */
body.single-product form.cart,
body.single-product .summary form.cart,
body.single-product div.product form.cart,
body.single-product .woocommerce-variation-add-to-cart,
body.single-product form.cart .woocommerce-variation-add-to-cart{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:wrap !important;
  align-items:stretch !important;
  gap:12px !important;
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}

/* 2) El personalizador ocupa fila completa. Sin excepciones: evitar compresión por tema o constructor. */
body.single-product form.cart .mkpwoo-box,
body.single-product .summary form.cart .mkpwoo-box,
body.single-product div.product form.cart .mkpwoo-box,
body.single-product .woocommerce-variation-add-to-cart .mkpwoo-box,
body.single-product form.cart .woocommerce-variation-add-to-cart .mkpwoo-box{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  flex:0 0 100% !important;
  flex-basis:100% !important;
  grid-column:1 / -1 !important;
  order:-999 !important;
  clear:both !important;
  float:none !important;
  box-sizing:border-box !important;
}

/* 3) Caja visual */
.mkpwoo-box{
  position:relative !important;
  isolation:isolate !important;
  border:1px solid #eadbc8 !important;
  background:#fffaf4 !important;
  border-radius:16px !important;
  padding:16px !important;
  margin:16px 0 18px !important;
  box-shadow:0 10px 24px rgba(70,42,18,.07) !important;
  overflow:hidden !important;
}

.mkpwoo-inner{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
}

.mkpwoo-head{
  display:flex !important;
  justify-content:space-between !important;
  align-items:flex-start !important;
  gap:12px !important;
  width:100% !important;
  margin:0 0 12px !important;
}

.mkpwoo-head h3{
  font-size:18px !important;
  line-height:1.15 !important;
  margin:0 0 4px !important;
  color:#2c2018 !important;
  font-weight:800 !important;
  letter-spacing:-.01em !important;
}

.mkpwoo-head p{
  margin:0 !important;
  color:#7d6a57 !important;
  font-size:13px !important;
  line-height:1.35 !important;
}

.mkpwoo-extra{
  flex:0 0 auto !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:28px !important;
  padding:5px 10px !important;
  border-radius:999px !important;
  background:#ead8ba !important;
  color:#5a3c18 !important;
  font-weight:800 !important;
  font-size:12px !important;
  white-space:nowrap !important;
}

.mkpwoo-body{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
}

/* 4) Campos. Desktop doble lado en 2 columnas; single siempre 1 columna limpia */
.mkpwoo-grid{
  display:grid !important;
  grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  gap:12px !important;
  width:100% !important;
}

.mkpwoo-field{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin:0 0 12px !important;
  padding:0 !important;
  box-sizing:border-box !important;
}

.mkpwoo-field label{
  display:block !important;
  font-size:13px !important;
  line-height:1.25 !important;
  font-weight:800 !important;
  color:#2c2018 !important;
  margin:0 0 7px !important;
}

.mkpwoo-field input[type="text"]{
  -webkit-appearance:none !important;
  appearance:none !important;
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  height:auto !important;
  min-height:46px !important;
  border:1px solid #d8c5ac !important;
  border-radius:12px !important;
  padding:11px 13px !important;
  background:#fff !important;
  color:#1f1f1f !important;
  box-sizing:border-box !important;
  font-size:15px !important;
  line-height:1.3 !important;
  box-shadow:none !important;
}

.mkpwoo-field input[type="text"]::placeholder{color:#b9aa99 !important;opacity:1 !important;}
.mkpwoo-field input[type="text"]:focus{
  outline:none !important;
  border-color:#a87932 !important;
  box-shadow:0 0 0 3px rgba(168,121,50,.14) !important;
}

.mkpwoo-field small{
  display:block !important;
  color:#7d6a57 !important;
  font-size:12px !important;
  line-height:1.3 !important;
  margin-top:6px !important;
}

.mkpwoo-counter{font-weight:800 !important;color:#2c2018 !important;}

.mkpwoo-check{
  display:flex !important;
  width:100% !important;
  max-width:100% !important;
  gap:10px !important;
  align-items:flex-start !important;
  font-size:12.5px !important;
  line-height:1.35 !important;
  color:#2c2018 !important;
  cursor:pointer !important;
  box-sizing:border-box !important;
}

.mkpwoo-check input{
  flex:0 0 auto !important;
  width:16px !important;
  height:16px !important;
  min-width:16px !important;
  margin:1px 0 0 !important;
  accent-color:#111 !important;
}

.mkpwoo-confirm{
  background:#fff !important;
  border:1px solid #eadbc8 !important;
  border-radius:12px !important;
  padding:11px !important;
  margin:0 !important;
}

.mkpwoo-box .required{color:#b94a48 !important;}

/* 5) Cantidad y botón debajo del bloque */
body.single-product form.cart .quantity,
body.single-product .woocommerce-variation-add-to-cart .quantity{
  order:1 !important;
  flex:0 0 auto !important;
  float:none !important;
  margin:0 !important;
}

body.single-product form.cart .single_add_to_cart_button,
body.single-product .woocommerce-variation-add-to-cart .single_add_to_cart_button{
  order:2 !important;
  flex:1 1 220px !important;
  min-width:220px !important;
  margin:0 !important;
}

/* 6) Tablet: todo en una sola columna para evitar compresión */
@media (max-width: 921px){
  .mkpwoo-box{padding:15px !important;border-radius:15px !important;margin:14px 0 16px !important;}
  .mkpwoo-head{display:block !important;}
  .mkpwoo-extra{margin-top:8px !important;}
  .mkpwoo-grid{grid-template-columns:1fr !important;gap:0 !important;}
  .mkpwoo-field input[type="text"]{min-height:48px !important;font-size:16px !important;}
}

/* 7) Móvil: botón abajo ancho completo */
@media (max-width: 600px){
  body.single-product form.cart,
  body.single-product .summary form.cart,
  body.single-product div.product form.cart,
  body.single-product .woocommerce-variation-add-to-cart{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:wrap !important;
    gap:10px !important;
  }

  .mkpwoo-box{padding:14px !important;border-radius:14px !important;}
  .mkpwoo-head h3{font-size:17px !important;}
  .mkpwoo-head p{font-size:12.5px !important;}
  .mkpwoo-confirm{font-size:12px !important;}

  body.single-product form.cart .quantity,
  body.single-product .woocommerce-variation-add-to-cart .quantity{
    flex:0 0 92px !important;
  }

  body.single-product form.cart .single_add_to_cart_button,
  body.single-product .woocommerce-variation-add-to-cart .single_add_to_cart_button{
    flex:1 1 calc(100% - 104px) !important;
    min-width:0 !important;
  }
}

@media (max-width: 420px){
  body.single-product form.cart .quantity,
  body.single-product .woocommerce-variation-add-to-cart .quantity,
  body.single-product form.cart .single_add_to_cart_button,
  body.single-product .woocommerce-variation-add-to-cart .single_add_to_cart_button{
    flex:0 0 100% !important;
    width:100% !important;
    min-width:100% !important;
  }
}
