/* =================================================
   POGALUA · TARJETAS DE PRODUCTO
   Archivo: /css/pogalua-cards.css
   Contexto: tienda / loop de productos
   Objetivo: conservar la lógica validada y depurar estructura
================================================= */

/* =================================================
   1. Limpieza de elementos nativos del loop
================================================= */

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button,
.woocommerce ul.products li.product a.button,
.woocommerce ul.products li.product .added_to_cart {
  display: none !important;
}

/* =================================================
   2. Grid general
================================================= */

.woocommerce ul.products {
  gap: 18px;
}

/* =================================================
   3. Tarjeta base
================================================= */

.woocommerce ul.products li.product {
  position: relative;
  display: flex !important;
  flex-direction: column;
  min-height: 0 !important;
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    border-color .18s ease;
}

.woocommerce ul.products li.product:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(255, 255, 255, 0.78);
  z-index: 5;
}

/* =================================================
   4. Neutralización de wrappers de Kadence / WooCommerce
================================================= */

.woocommerce ul.products li.product .product-details,
.woocommerce ul.products li.product .kadence-product-content,
.woocommerce ul.products li.product .content-wrap {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  justify-content: flex-start !important;
  align-content: flex-start !important;
}

.woocommerce ul.products li.product > * + * {
  margin-top: 0 !important;
}

/* =================================================
   5. Imagen principal
================================================= */

.woocommerce ul.products li.product .woocommerce-loop-product__link {
  display: block;
  position: relative;
  aspect-ratio: 8 / 7;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 16px 16px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.35);
  flex: 0 0 auto;
}

.woocommerce ul.products li.product .woocommerce-loop-product__link img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  object-fit: cover;
  transition: transform .25s ease;
}

.woocommerce ul.products li.product:hover .woocommerce-loop-product__link img {
  transform: scale(1.05);
}

/* =================================================
   6. Hover media
================================================= */

.woocommerce ul.products li.product .poga-hover-media {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: cover;
  pointer-events: none;
  transition: opacity .22s ease;
}

.woocommerce ul.products li.product.poga-has-hover-media:hover .poga-hover-media {
  opacity: 1;
}

/* =================================================
   7. Cuerpo de tarjeta
================================================= */

.woocommerce ul.products li.product .poga-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 !important;
  padding: 12px 10px 10px;
}

/* =================================================
   8. Fila superior: título + badges
================================================= */

.woocommerce ul.products li.product .poga-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
  margin: 0 0 10px 0;
  padding: 0;
}

/* -------------------------------------------------
   8.1. Título
-------------------------------------------------- */

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  margin: 7px 0 0 0 !important;
  padding: 0 !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.01em;
  max-height: none;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title a {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* -------------------------------------------------
   8.2. Contenedor de badges
-------------------------------------------------- */

.woocommerce ul.products li.product .poga-badges {
  display: inline-flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-self: flex-start;
  gap: 5px;
  margin: 6px 0 0 0 !important;
  padding: 0 !important;
}

/* -------------------------------------------------
   8.3. Badge base en tienda
   Nota:
   - Se mantiene aquí por seguridad para no alterar
     nada validado del loop.
   - Cuando se cierre la unificación total con checkout,
     este bloque podrá vivir en pogalua-ui.css.
-------------------------------------------------- */

.woocommerce ul.products li.product .poga-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(123, 78, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  color: rgba(123, 78, 255, 0.70);
  font-size: 0;
  line-height: 1;
  cursor: help;
}

.woocommerce ul.products li.product .poga-badge::before {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.woocommerce ul.products li.product .poga-badge-unico::before { content: "U"; }
.woocommerce ul.products li.product .poga-badge-artesano::before { content: "A"; }
.woocommerce ul.products li.product .poga-badge-sostenible::before { content: "S"; }
.woocommerce ul.products li.product .poga-badge-limitada::before { content: "L"; }

/* =================================================
   9. Fila inferior: precio + carrito
================================================= */

.woocommerce ul.products li.product .poga-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  margin: auto 0 0;
  padding: 0;
}

/* -------------------------------------------------
   9.1. Precio
-------------------------------------------------- */

.woocommerce ul.products li.product .price {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0.75em !important;
  font-weight: 500;
  line-height: 1.2 !important;
  opacity: 1;
}

/* -------------------------------------------------
   9.2. Precio oculto
-------------------------------------------------- */

.woocommerce ul.products li.product .poga-price-hidden {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 2em;
  color: transparent;
  line-height: 1;
}

.woocommerce ul.products li.product .poga-price-hidden::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(230, 230, 230, 0.92) 50%,
    rgba(255, 255, 255, 0.82) 100%
  );
}

.woocommerce ul.products li.product .poga-price-hidden::after {
  content: "?";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9505e3;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

.woocommerce ul.products li.product:hover .poga-price-hidden,
.woocommerce ul.products li.product.poga-price-revealed .poga-price-hidden {
  width: auto;
  height: auto;
  color: inherit;
}

.woocommerce ul.products li.product:hover .poga-price-hidden::before,
.woocommerce ul.products li.product.poga-price-revealed .poga-price-hidden::before,
.woocommerce ul.products li.product:hover .poga-price-hidden::after,
.woocommerce ul.products li.product.poga-price-revealed .poga-price-hidden::after {
  display: none;
}

/* =================================================
   10. Meta técnica oculta
================================================= */

.woocommerce ul.products li.product .poga-card-meta-row {
  display: none !important;
}

/* =================================================
   11. Botón de carrito
================================================= */

.woocommerce ul.products li.product .poga-card-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(123, 78, 255, 0.15);
  border-radius: 999px;
  background: rgba(123, 78, 255, 0.08);
  color: #6b3df0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  appearance: none;
  -webkit-appearance: none;
  transition:
    transform .15s ease,
    background .15s ease,
    border-color .15s ease,
    color .15s ease;
}

.woocommerce ul.products li.product .poga-card-cart:hover {
  transform: scale(1.03);
  border-color: rgba(123, 78, 255, 0.24);
  background: rgba(123, 78, 255, 0.12);
  color: #5a2fe0;
}

.woocommerce ul.products li.product .poga-card-cart .poga-cart-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.woocommerce ul.products li.product .poga-card-cart .poga-cart-icon svg {
  display: block;
}

.woocommerce ul.products li.product .poga-card-cart .poga-cart-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition: transform .15s ease, opacity .15s ease;
}

/* =========================================================
   12. Estado agotado
========================================================= */

.woocommerce ul.products li.product.poga-is-outstock .woocommerce-loop-product__link {
  position: relative;
}

/* Texto diagonal */
.woocommerce ul.products li.product.poga-is-outstock .woocommerce-loop-product__link::after {
  content: "Agotado";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-24deg);
  z-index: 5;
  color: rgba(20, 20, 20, 0.8);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(255,255,255,0.72);
  pointer-events: none;
}

/* Botón bloqueado */
.woocommerce ul.products li.product.poga-is-outstock .poga-card-cart {
  opacity: 0.5;
  pointer-events: none;
}

/* Ocultar precio sin romper estructura */
.woocommerce ul.products li.product.poga-is-outstock .price {
  visibility: hidden;
}