/* AE 2026-10-15: layout único para tarjetas del catálogo y relacionados.
   Cargado al final para prevalecer sobre estilos del plugin Compra Rápida. */
body .ae-products-grid, body ul.products.ae-products-grid,
body.woocommerce ul.products, body.woocommerce-page ul.products {
  align-items: stretch !important;
  align-content: start !important;
}
body .ae-products-grid > li.product.ae-product-card,
body ul.products > li.product.ae-product-card,
body.woocommerce ul.products > li.product.ae-product-card,
body.woocommerce-page ul.products > li.product.ae-product-card {
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
body ul.products > li.product.ae-product-card > .ae-product-card__link {
  display: block !important;
  flex: 0 0 auto !important;
}
body ul.products > li.product.ae-product-card .ae-product-card__body {
  box-sizing: border-box !important;
  min-height: 0 !important;
  height: auto !important;
  flex: 0 0 auto !important;
  padding: 13px 14px 4px !important;
  margin: 0 !important;
  gap: 5px !important;
  align-items: center !important;
}
body ul.products > li.product.ae-product-card .ae-product-card__title {
  box-sizing: border-box !important;
  min-height: 2.3em !important;
  height: auto !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}
body ul.products > li.product.ae-product-card .ae-product-card__price {
  min-height: 0 !important;
  margin: 0 !important;
}
body ul.products > li.product.ae-product-card .ae-product-card__actions,
body ul.products > li.product.ae-product-card .ae-product-card__actions.ae-qb-unified-card {
  box-sizing: border-box !important;
  display: flex !important;
  flex: 0 0 auto !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  align-self: stretch !important;
  min-height: 0 !important;
  height: auto !important;
  margin: auto 0 0 !important;
  padding: 7px 14px 16px !important;
  gap: 7px !important;
  text-align: center !important;
}
body ul.products > li.product.ae-product-card .ae-product-card__actions .ae-qb,
body ul.products > li.product.ae-product-card .ae-product-card__actions .ae-qb-context-category {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  align-items: center !important;
  text-align: center !important;
}
body ul.products > li.product.ae-product-card .ae-qb-context-category .ae-qb-price,
body ul.products > li.product.ae-product-card .ae-qb-context-category .ae-qb-label {
  width: 100% !important;
  text-align: center !important;
}
body ul.products > li.product.ae-product-card .ae-qb-context-category select,
body ul.products > li.product.ae-product-card .ae-qb-context-category .ae-qb-actions {
  width: 100% !important;
  max-width: 100% !important;
}
body ul.products > li.product.ae-product-card .ae-product-card__actions > a.button {
  margin: 0 auto !important;
}
@media (max-width: 767px) {
  body ul.products > li.product.ae-product-card .ae-product-card__title { min-height: 0 !important; }
  body ul.products > li.product.ae-product-card .ae-product-card__actions { padding: 7px 10px 14px !important; }
}

/* v2: La plantilla real usa <article class="ae-product-card">, no <li>.
   Por ello las reglas anteriores nunca coincidían con estas fichas. */
body .ae-products-grid { align-items: stretch !important; grid-auto-rows: auto !important; }
body .ae-products-grid > .ae-product-card,
body .ae-products-grid > li.product,
body .ae-products-grid > li.product > article.ae-product-card,
body .ae-products-grid article.ae-product-card,
body.woocommerce ul.products article.ae-product-card {
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
body .ae-products-grid .ae-product-card__link { flex: 0 0 auto !important; }
body .ae-products-grid .ae-product-card__body {
  box-sizing: border-box !important;
  flex: 0 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 12px 14px 3px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
}
body .ae-products-grid .ae-product-card__title {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 2.4em !important;
  margin: 0 !important;
  text-align: center !important;
}
body .ae-products-grid .ae-product-card__price { min-height: 0 !important; margin: 0 !important; text-align: center !important; }
body .ae-products-grid .ae-product-card__actions {
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  align-items: center !important;
  align-self: center !important;
  width: calc(100% - 28px) !important;
  max-width: 250px !important;
  flex: 0 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
  margin: auto auto 0 !important;
  padding: 7px 0 20px !important;
  gap: 8px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center !important;
}
body .ae-products-grid .ae-product-card__actions .ae-qb,
body .ae-products-grid .ae-product-card__actions .ae-qb-context-category {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center !important;
}
body .ae-products-grid .ae-product-card__actions .ae-qb-price,
body .ae-products-grid .ae-product-card__actions .ae-qb-label { text-align: center !important; width: 100% !important; }
body .ae-products-grid .ae-product-card__actions .button,
body .ae-products-grid .ae-product-card__actions select { display: block !important; width: 100% !important; max-width: 100% !important; margin-left: auto !important; margin-right: auto !important; }

/* v3: acciones iguales en productos simples y variables */
body .ae-products-grid article.ae-product-card .ae-product-card__actions {width:calc(100% - 28px)!important;max-width:250px!important;margin:auto auto 0!important;}
body .ae-products-grid article.ae-product-card .ae-qb-actions {display:flex!important;flex-direction:column!important;gap:8px!important;width:100%!important;}
body .ae-products-grid article.ae-product-card .ae-qb-actions button {width:100%!important;max-width:none!important;margin:0!important;}
body .ae-products-grid article.ae-product-card .ae-qb-simple {padding:0!important;margin:0!important;}

/* v4: precios simples y variables alineados bajo el nombre.
   El espacio flexible se coloca ENTRE precio/selector y botones,
   no por encima del precio. */
body .ae-products-grid article.ae-product-card .ae-product-card__actions {
  margin: 0 auto !important;
  flex: 1 1 auto !important;
  justify-content: flex-start !important;
  align-self: center !important;
  display: flex !important;
  flex-direction: column !important;
}
body .ae-products-grid article.ae-product-card .ae-product-card__actions > .ae-qb {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
}
body .ae-products-grid article.ae-product-card .ae-qb-context-category .ae-qb-price {
  order: -3 !important;
  flex: 0 0 auto !important;
  margin: 0 0 9px !important;
}
body .ae-products-grid article.ae-product-card .ae-qb-context-category .ae-qb-label {
  order: -2 !important;
}
body .ae-products-grid article.ae-product-card .ae-qb-context-category .ae-qb-select {
  order: -1 !important;
}
body .ae-products-grid article.ae-product-card .ae-qb-context-category .ae-qb-actions {
  margin-top: auto !important;
  flex: 0 0 auto !important;
}
body .ae-products-grid article.ae-product-card .ae-qb-context-category .ae-qb-message,
body .ae-products-grid article.ae-product-card .ae-qb-context-category .ae-qb-data {
  order: 2 !important;
}

/* v5: separación clara entre presentación y botón sin alterar la alineación */
body .ae-products-grid article.ae-product-card .ae-qb-context-category .ae-qb-select {
  margin-bottom: 12px !important;
}
body .ae-products-grid article.ae-product-card .ae-qb-context-category .ae-qb-actions {
  padding-top: 0 !important;
}

/* v6: centrar el texto del desplegable de presentaciones */
body .ae-products-grid article.ae-product-card .ae-qb-context-category select.ae-qb-select,
body .ae-products-grid article.ae-product-card .ae-qb-context-category .ae-qb-select {
  text-align: center !important;
  text-align-last: center !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* Integración unificada: precio propio y acciones para productos simples y variables */
body .ae-products-grid article.ae-product-card.ae-qb-has-purchase .ae-product-card__body>.ae-product-card__price{display:none!important}
body .ae-products-grid article.ae-product-card .ae-qb-simple .ae-qb-price{order:-3!important;margin:0 0 9px!important;text-align:center!important}
body .ae-products-grid article.ae-product-card .ae-qb-simple .ae-qb-actions{margin-top:auto!important}
body .ae-products-grid article.ae-product-card .ae-qb-simple .ae-qb-message{order:2!important}
