.contenedor-productos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 12px;
  align-items: stretch;
}

/* Rediseño 2026-06 "Showroom": foto sobre blanco puro, cuerpo gris ultra claro,
   flag de stock recortado sobre la foto, badges (apps/características) apilados
   bajo el flag, sticker oferta abajo-derecha de la foto, delivery centrado,
   tallas como chips, CTA naranja al hover. */
.cardProducto {
  --bk-naranja: #ff6b1a;
  --bk-tinta: #16181d;
  --bk-gris-1: #5c6470;
  --bk-gris-2: #98a0ab;
  --bk-linea: #e8eaee;
  --bk-verde: #11a84f;
  --bk-verde-suave: #e7f6ee;
  --bk-verde-apagado: #66796e;
  --bk-rojo: #d6433b;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 430px;
  border: 1px solid var(--bk-linea);
  border-radius: 14px;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cardProducto:hover {
  transform: translateY(-4px);
  border-color: #f0c9b0;
  box-shadow: 0 14px 32px rgba(22, 24, 29, 0.13);
  z-index: 60;
}

.cardProducto__media-wrap {
  position: relative;
  background: #fff;
  padding: 30px 12px 8px;
  border-radius: 13px 13px 0 0;
}

.cardProducto__media {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 205px;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
  background-color: #fff;
  transition: transform 0.25s ease;
}

.cardProducto:hover .cardProducto__media {
  transform: scale(1.05);
}

.cardProducto__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 11px 14px 13px;
  box-sizing: border-box;
  background: #fafbfc;
  border-top: 1px solid var(--bk-linea);
}

/* ===== tallas como chips ===== */
.cardProducto_tallas {
  min-height: 22px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.cardProducto_tallas::-webkit-scrollbar { display: none; }

.cardProducto_tallas .resultados__variante {
  border: none;
  margin: 0;
  padding: 2px 6px;
  border-radius: 5px;
  background-color: var(--bk-verde-suave);
  color: var(--bk-verde);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  flex: 0 0 auto;
}
.cardProducto_tallas .resultados__variante:hover {
  background-color: var(--bk-verde-suave);
}
.cardProducto_tallas .resultados__variante--off {
  background-color: #e7eaee;
  color: var(--bk-gris-2);
  text-decoration: line-through;
}
.cardProducto_tallas .resultados__variante--off:hover {
  background-color: #e7eaee;
}

.cardProducto__title {
  margin: 2px 0 0;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  color: #2a2e36;
  min-height: calc(1.3em * 2.6);
  line-clamp: 3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.cardProducto__title::first-letter {
  text-transform: uppercase;
}

.cardProducto__pvp-ref {
  margin-top: 2px;
  width: 100%;
}

.cardProducto__price {
  font-weight: 800;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #111;
  margin-top: 0.6rem;
}

/* ===== disponibilidad abajo, centrada ===== */
.cardProducto__delivery {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.25;
  border-top: 1px dashed var(--bk-linea);
  padding-top: 9px;
}

.cardProducto__delivery > div:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cardProducto__delivery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: currentColor;
}

.cardProducto__delivery-legend {
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.25;
  opacity: 0.9;
  color: var(--bk-gris-1);
}

.cardProducto__stock--express,
.cardProducto__stock--available {
  color: var(--bk-verde);
}

.cardProducto__stock--express .cardProducto__delivery-dot {
  animation: bkPulso 1.8s infinite;
}

.cardProducto__stock--none {
  color: var(--bk-rojo);
}

@keyframes bkPulso {
  0% { box-shadow: 0 0 0 0 rgba(17, 168, 79, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(17, 168, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(17, 168, 79, 0); }
}

.logo__express_pequeno {
  width: 28px;
  margin-left: 2px;
  vertical-align: middle;
}

/* ===== flag de disponibilidad sobre la foto ===== */
.cardProducto__flag {
  position: absolute;
  top: 10px;
  right: 0;
  z-index: 8;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #fff;
  padding: 4px 10px 4px 14px;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%);
}
.cardProducto__flag--express { background: var(--bk-verde); }
.cardProducto__flag--ok { background: var(--bk-verde-apagado); }
.cardProducto__flag--no { background: var(--bk-rojo); }

/* ===== logo marca: panel blanco SIEMPRE encima de la foto ===== */
.logo_marca {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 8;
  background: #fff;
  border: 1px solid var(--bk-linea);
  border-radius: 8px;
  padding: 4px 7px;
  box-shadow: 0 2px 8px rgba(22, 24, 29, 0.08);
}

.cardProducto__marca-image {
  display: block;
  width: 44px;
  height: 20px;
  object-fit: contain;
}

/* ===== sticker oferta: abajo a la derecha de la foto ===== */
.cardProducto__offer-image {
  position: absolute;
  right: 10px;
  bottom: 6px;
  z-index: 7;
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(22, 24, 29, 0.18));
}

/* ===== badges (apps + características) apilados bajo el flag ===== */
.cardProducto__badges {
  position: absolute;
  top: 38px;
  right: 10px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cardProducto__apps-indicator,
.cardProducto__features-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d9d9d9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(22, 24, 29, 0.12);
  flex: 0 0 auto;
  position: relative;
  cursor: help;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cardProducto__apps-indicator:hover,
.cardProducto__features-indicator:hover {
  border-color: var(--bk-tinta);
  box-shadow: 0 4px 12px rgba(22, 24, 29, 0.2);
}

.cardProducto__apps-icon {
  font-size: 0.8rem;
  line-height: 1;
}

.cardProducto__features-icon {
  font-size: 0.78rem;
  line-height: 1;
}

.cardProducto__apps-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  min-width: 300px;
  max-width: 680px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1f2937;
  color: #f8fafc;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.cardProducto__features-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  min-width: 205px; /* encaja en la caja de producto (media 205px); pendiente ajustar si el texto interno es más largo */
  max-width: 680px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1f2937;
  color: #f8fafc;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.cardProducto__apps-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #1f2937;
  transform: rotate(45deg);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.cardProducto__features-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #1f2937;
  transform: rotate(45deg);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.cardProducto__apps-tooltip-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
  color: #e5e7eb;
}

.cardProducto__features-tooltip-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
  color: #e5e7eb;
}

.cardProducto__apps-tooltip-list {
  margin: 0;
  padding: 0 0 0 14px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.cardProducto__features-tooltip-list {
  margin: 0;
  padding: 0 0 0 14px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.cardProducto__apps-tooltip-item {
  margin-bottom: 4px;
  font-size: 0.74rem;
  line-height: 1.3;
  color: #f3f4f6;
  white-space: nowrap;
}

.cardProducto__features-tooltip-item {
  margin-bottom: 4px;
  font-size: 0.74rem;
  line-height: 1.3;
  color: #f3f4f6;
  white-space: nowrap;
}

.cardProducto__apps-tooltip-item:last-child {
  margin-bottom: 0;
}

.cardProducto__features-tooltip-item:last-child {
  margin-bottom: 0;
}

.cardProducto__features-tooltip-key {
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cardProducto__apps-indicator:hover .cardProducto__apps-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 120;
}

.cardProducto__features-indicator:hover .cardProducto__features-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 120;
}

/* ===== El tooltip de los badges (características / aplicaciones) debe salir de
   la tarjeta y quedar por encima de las tarjetas vecinas. La tarjeta lleva
   overflow:hidden para recortar las esquinas; solo lo liberamos mientras el
   cursor está sobre un indicador, que es cuando se lee el tooltip. Así las
   esquinas se siguen recortando en el resto de estados. ===== */
.cardProducto:has(.cardProducto__apps-indicator:hover),
.cardProducto:has(.cardProducto__features-indicator:hover) {
  overflow: visible;
}

/* ===== CTA al hover ===== */
.cardProducto__cta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  background: var(--bk-naranja);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
  padding: 10px;
  border-radius: 0 0 13px 13px;
  transform: translateY(100%);
  transition: transform 0.22s ease;
  pointer-events: none;
}

.cardProducto:hover .cardProducto__cta {
  transform: translateY(0);
}

@media (max-width: 1200px) {
  .contenedor-productos {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .cardProducto {
    min-height: 410px;
  }

  .cardProducto__media {
    height: 190px;
  }
}

@media (max-width: 768px) {
  .contenedor-productos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .cardProducto {
    min-height: 360px;
    border-radius: 10px;
  }

  .cardProducto__media-wrap {
    padding: 26px 10px 6px;
  }

  .cardProducto__media {
    height: 160px;
  }

  .cardProducto__content {
    padding: 9px 10px 11px;
    gap: 4px;
  }

  .cardProducto__title {
    font-size: 0.78rem;
    line-height: 1.25;
    min-height: calc(1.25em * 2.5);
  }

  .cardProducto__price {
    font-size: 1.3rem;
  }

  .cardProducto__delivery {
    font-size: 0.78rem;
  }

  .cardProducto__delivery-legend {
    font-size: 0.68rem;
  }

  .cardProducto__flag {
    font-size: 0.64rem;
    padding: 3px 8px 3px 12px;
  }

  .logo_marca {
    padding: 3px 5px;
  }

  .cardProducto__marca-image {
    width: 36px;
    height: 18px;
  }

  .cardProducto__offer-image {
    width: 46px;
    height: 46px;
  }

  .cardProducto__cta {
    display: none;
  }

  .cardProducto__apps-indicator,
  .cardProducto__features-indicator {
    display: none;
  }
}

@media (max-width: 420px) {
  .contenedor-productos {
    gap: 8px;
  }

  .cardProducto {
    min-height: 340px;
  }

  .cardProducto__media {
    height: 148px;
  }

  .cardProducto__price {
    font-size: 1.2rem;
  }

  .logo__express_pequeno {
    width: 24px;
  }
}

@media (max-width: 360px) {
  .contenedor-productos {
    grid-template-columns: 1fr;
  }

  .cardProducto {
    min-height: 330px;
  }
}





/* 2026-05-29 SSR layout fix — body.bk-results-active aplicada por JS post-LCP, mientras tanto
   theme deja #js-product-list grid 4 cols 225px y .contenedor-productos queda confinado 1 col 225px.
   Fix server-side: cuando exista contenedor-productos dentro de #js-product-list, anula grid parent. */
#js-product-list:has(.contenedor-productos),
#js-product-list:has(> div > .contenedor-productos) {
  display: block !important;
  grid-template-columns: none !important;
}
#js-product-list .contenedor-productos {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: 100% !important;
}
@media (max-width: 991px) {
  #js-product-list .contenedor-productos { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 575px) {
  #js-product-list .contenedor-productos { grid-template-columns: repeat(2, 1fr) !important; }
}
