/* SimpliTienda 0.7.0 — capa de compatibilidad.
   Se carga al final para aislar el checkout y los botones del CSS del tema,
   sin borrar los estilos propios que necesiten pasarelas externas. */

#stpCheckoutModal,
#stpCheckoutModal *,
#stpCheckoutModal *::before,
#stpCheckoutModal *::after,
.stq-pack-section,
.stq-pack-section *,
.stq-pack-section *::before,
.stq-pack-section *::after{
  box-sizing:border-box;
}

#stpCheckoutModal{
  z-index:2147483000!important;
  isolation:isolate!important;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif!important;
  font-size:16px!important;
  line-height:1.4!important;
  text-align:left!important;
  text-transform:none!important;
  letter-spacing:normal!important;
  color-scheme:light!important;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
#stpCheckoutModal .stp-modal-panel{
  font:inherit!important;
  color:#17211d!important;
  text-align:left!important;
}
#stpCheckoutModal button,
#stpCheckoutModal input,
#stpCheckoutModal select,
#stpCheckoutModal textarea{
  font-family:inherit!important;
  text-transform:none!important;
  letter-spacing:normal!important;
  text-shadow:none!important;
}
#stpCheckoutModal button{
  -webkit-appearance:none!important;
  appearance:none!important;
  opacity:1!important;
  visibility:visible!important;
  text-decoration:none!important;
  line-height:1.2!important;
  height:auto;
  max-width:none;
}
#stpCheckoutModal input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]):not([type="file"]),
#stpCheckoutModal select,
#stpCheckoutModal textarea{
  -webkit-appearance:none!important;
  appearance:none!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  color:#1d2d25!important;
  background-color:#fff!important;
  background-image:none!important;
  border:1px solid #d8e0db!important;
  border-radius:10px!important;
  box-shadow:none!important;
  outline:none!important;
}
#stpCheckoutModal input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]):not([type="file"]):focus,
#stpCheckoutModal select:focus,
#stpCheckoutModal textarea:focus{
  border-color:var(--stp-accent,#79c438)!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--stp-accent,#79c438) 13%,transparent)!important;
}
#stpCheckoutModal img{
  box-shadow:none!important;
  border:0;
}
#stpCheckoutModal [hidden]{display:none!important}

/* Elementos de acción propios: el tema no debe añadir iconos/pseudoelementos. */
#stpCheckoutModal .stp-next-button::before,#stpCheckoutModal .stp-next-button::after,
#stpCheckoutModal .stp-back-button::before,#stpCheckoutModal .stp-back-button::after,
#stpCheckoutModal .stp-place-order::before,#stpCheckoutModal .stp-place-order::after,
#stpCheckoutModal .stp-whatsapp-help::before,#stpCheckoutModal .stp-whatsapp-help::after,
#stpCheckoutModal .stp-agency-pick::before,#stpCheckoutModal .stp-agency-pick::after,
#stpCheckoutModal .stp-open-agency-picker::before,#stpCheckoutModal .stp-open-agency-picker::after{
  content:none!important;
  display:none!important;
}

/* Las acciones principales conservan tamaño y forma aunque el tema tenga reglas .button. */
#stpCheckoutModal .stp-next-button,
#stpCheckoutModal .stp-place-order,
#stpCheckoutModal .stp-agency-pick,
#stpCheckoutModal .stp-open-agency-picker,
#stpCheckoutModal .stp-cod-step2-order{
  width:100%!important;
  max-width:none!important;
  min-height:58px!important;
  margin-left:0!important;
  margin-right:0!important;
  padding-left:14px!important;
  padding-right:14px!important;
  border-radius:10px!important;
  font-weight:750!important;
  cursor:pointer!important;
}
#stpCheckoutModal button:disabled{
  cursor:not-allowed!important;
}


/* Controles de navegación del popup: forma propia, inmune a estilos del theme. */
#stpCheckoutModal .stp-modal-close{
  appearance:none!important;-webkit-appearance:none!important;
  position:absolute!important;top:12px!important;right:12px!important;
  width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;
  margin:0!important;padding:0!important;
  display:grid!important;place-items:center!important;
  border:1px solid #dfe6e2!important;border-radius:999px!important;
  background:#fff!important;background-image:none!important;color:#2e4339!important;
  font-size:0!important;line-height:1!important;text-indent:0!important;
  box-shadow:0 4px 14px rgba(12,34,24,.10)!important;
  transform:none!important;float:none!important;
}
#stpCheckoutModal .stp-modal-close::before,#stpCheckoutModal .stp-modal-close::after{content:none!important;display:none!important}
#stpCheckoutModal .stp-modal-close svg{display:block!important;width:16px!important;height:16px!important;margin:0!important;padding:0!important}
#stpCheckoutModal .stp-modal-close svg path{fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}
#stpCheckoutModal .stp-back-button{
  appearance:none!important;-webkit-appearance:none!important;
  width:100%!important;min-width:0!important;height:56px!important;min-height:56px!important;
  margin:0!important;padding:0 12px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;
  border:1px solid #d7e0da!important;border-radius:11px!important;
  background:#fff!important;background-image:none!important;color:#355247!important;
  font-family:inherit!important;font-size:12px!important;font-weight:750!important;line-height:1!important;
  letter-spacing:0!important;text-transform:none!important;text-decoration:none!important;
  white-space:nowrap!important;box-shadow:none!important;float:none!important;
}
#stpCheckoutModal .stp-back-button>span{display:inline!important;font-size:15px!important;font-weight:500!important;line-height:1!important}

/* No aplastamos el HTML interno de gateways externos; solo lo contenemos. */
#stpCheckoutModal .stp-gateway-fields{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:visible!important;
}
#stpCheckoutModal .stp-gateway-fields img{
  max-width:100%!important;
  height:auto;
}
#stpCheckoutModal .stp-gateway-fields iframe{
  max-width:100%!important;
}

/* Página de producto: SimpliTienda controla el área de compra en productos activados. */
body.single-product form.cart.stq-pack-active{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  padding:0!important;
  float:none!important;
  grid-template-columns:none!important;
  grid-auto-flow:row!important;
  gap:0!important;
}
body.single-product form.cart.stq-pack-active>.quantity{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  min-width:1px!important;
  min-height:1px!important;
  margin:0!important;
  padding:0!important;
  opacity:0!important;
  overflow:hidden!important;
  pointer-events:none!important;
}
body.single-product form.cart.stq-pack-active>.stp-buy-now-button,
body.single-product .product form.cart.stq-pack-active>.stp-buy-now-button{
  -webkit-appearance:none!important;
  appearance:none!important;
  position:relative!important;
  inset:auto!important;
  float:none!important;
  clear:both!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  min-height:68px!important;
  height:auto!important;
  margin:0 0 9px!important;
  padding:11px 22px!important;
  border:0!important;
  border-radius:11px!important;
  background:var(--stq-buy,#79c438)!important;
  background-image:none!important;
  color:#fff!important;
  font-family:inherit!important;
  font-size:16px!important;
  font-style:normal!important;
  line-height:1.15!important;
  text-align:center!important;
  text-decoration:none!important;
  text-transform:none!important;
  letter-spacing:normal!important;
  opacity:1!important;
  visibility:visible!important;
  box-shadow:0 8px 20px rgba(80,140,40,.22)!important;
  cursor:pointer!important;
}
body.single-product form.cart.stq-pack-active>.stp-buy-now-button::before,
body.single-product form.cart.stq-pack-active>.stp-buy-now-button::after{
  content:none!important;
  display:none!important;
}
body.single-product form.cart.stq-pack-active>.stp-buy-now-button .stp-buy-now-main{
  display:block!important;
  margin:0!important;
  padding:0!important;
  color:#fff!important;
  font-size:18px!important;
  font-weight:850!important;
  line-height:1.08!important;
  text-transform:none!important;
  letter-spacing:0!important;
}
body.single-product form.cart.stq-pack-active>.stp-buy-now-button .stp-buy-now-sub{
  display:block!important;
  margin:2px 0 0!important;
  padding:0!important;
  color:rgba(255,255,255,.94)!important;
  font-size:11px!important;
  font-weight:600!important;
  line-height:1.2!important;
  text-transform:none!important;
  letter-spacing:0!important;
}
body.single-product form.cart.stq-pack-active>button.single_add_to_cart_button,
body.single-product form.cart.stq-pack-active>.single_add_to_cart_button,
body.single-product .product form.cart.stq-pack-active button.single_add_to_cart_button.button{
  -webkit-appearance:none!important;
  appearance:none!important;
  position:relative!important;
  inset:auto!important;
  float:none!important;
  clear:both!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  min-height:58px!important;
  height:auto!important;
  margin:0!important;
  padding:10px 18px!important;
  border:1.5px solid var(--stq-selected-border,#95c233)!important;
  border-radius:10px!important;
  background:transparent!important;
  background-image:none!important;
  color:var(--stq-dark,#244b37)!important;
  font-family:inherit!important;
  font-size:14px!important;
  font-weight:700!important;
  line-height:1.2!important;
  text-align:center!important;
  text-decoration:none!important;
  text-transform:none!important;
  letter-spacing:normal!important;
  opacity:1!important;
  visibility:visible!important;
  box-shadow:none!important;
  cursor:pointer!important;
}
body.single-product form.cart.stq-pack-active>button.single_add_to_cart_button::before,
body.single-product form.cart.stq-pack-active>button.single_add_to_cart_button::after{
  content:none!important;
  display:none!important;
}

/* El selector de packs también queda aislado de precios/imágenes del tema. */
body.single-product .stq-pack-section{
  width:100%!important;
  max-width:100%!important;
  float:none!important;
  clear:both!important;
  font-family:inherit!important;
  line-height:1.35!important;
  text-transform:none!important;
  letter-spacing:normal!important;
}
body.single-product .stq-pack-section .woocommerce-Price-amount,
body.single-product .stq-pack-section .woocommerce-Price-currencySymbol,
body.single-product .stq-pack-section bdi{
  display:inline!important;
  margin:0!important;
  padding:0!important;
  color:inherit!important;
  font:inherit!important;
  white-space:nowrap!important;
}
body.single-product .stq-pack-section img{
  margin:0!important;
  padding:0!important;
  border:0!important;
  box-shadow:none!important;
  transform:none!important;
}

@media(max-width:620px){
  #stpCheckoutModal{font-size:15px!important}
  body.single-product form.cart.stq-pack-active>.stp-buy-now-button{min-height:64px!important;padding:10px 16px!important}
  body.single-product form.cart.stq-pack-active>.stp-buy-now-button .stp-buy-now-main{font-size:17px!important}
  body.single-product form.cart.stq-pack-active>.stp-buy-now-button .stp-buy-now-sub{font-size:10.5px!important}
}

@media(prefers-reduced-motion:reduce){
  #stpCheckoutModal *,body.single-product .stp-buy-now-button{
    scroll-behavior:auto!important;
  }
}


/* SimpliTienda 0.8.2 · CTAs principales más legibles */
#stpCheckoutModal .stp-next-button,
#stpCheckoutModal .stp-place-order,
#stpCheckoutModal .stp-cod-step2-order{
  min-height:68px!important;
  padding:10px 18px!important;
  border-radius:13px!important;
}
#stpCheckoutModal .stp-next-button>span,
#stpCheckoutModal .stp-place-order>span,
#stpCheckoutModal .stp-cod-step2-order>span{
  font-size:18px!important;
  font-weight:800!important;
  line-height:1.12!important;
  letter-spacing:0!important;
}
#stpCheckoutModal .stp-next-button>small,
#stpCheckoutModal .stp-place-order>small,
#stpCheckoutModal .stp-cod-step2-order>small{
  font-size:11px!important;
  font-weight:600!important;
  line-height:1.2!important;
  margin-top:2px!important;
}
@media(max-width:620px){
  #stpCheckoutModal .stp-next-button,
  #stpCheckoutModal .stp-place-order,
  #stpCheckoutModal .stp-cod-step2-order{min-height:66px!important;padding:9px 14px!important}
  #stpCheckoutModal .stp-next-button>span,
  #stpCheckoutModal .stp-place-order>span,
  #stpCheckoutModal .stp-cod-step2-order>span{font-size:17px!important}
}
