/* ============================================
   BFM Store — estilos de los widgets
   Portados de Diseño Web/.../project/styles.css (.pcard, .pgrid, etc.).
   Requiere los tokens del child theme (tokens.css: --bfm-*, --font-*).
   ============================================ */

/* Grid de productos */
.pgrid {
  display: grid;
  grid-template-columns: repeat(var(--bfm-cols, 4), 1fr);
  gap: 36px 28px;
}

/* Tarjeta de producto (es un <a>) */
.pcard {
  background: #fff;
  display: flex;
  flex-direction: column;
  text-align: left;
  position: relative;
  color: inherit;
}
/* Ningún texto subrayado, ni en hover/focus (gana al estilo de enlaces del tema/Elementor) */
.pcard,
.pcard:hover,
.pcard:focus,
.pcard:active { text-decoration: none !important; }

.pcard .pcover {
  aspect-ratio: 3 / 4;
  width: 100%;
  /* Matte de marca: la portada se contiene dentro (object-fit:contain), así
     una imagen cuadrada o 3:4 se ve completa; el espacio sobrante queda como
     passe-partout prolijo en vez de franja vacía. */
  background: var(--bfm-soft);
  border: 1px solid var(--bfm-line);
  padding: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sh-2);
  transition: transform .25s ease, box-shadow .25s ease;
}
.pcard .pcover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.pcard:hover .pcover { transform: translateY(-3px); box-shadow: var(--sh-3); }

.pcard .pbadge {
  position: absolute; top: 12px; left: 12px;
  background: #fff; color: var(--bfm-deep);
  font-family: var(--font-display); font-weight: 700;
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 5px 9px; border-radius: var(--r-xs);
}

.pcard .pmeta {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--bfm-muted);
  font-family: var(--font-display); letter-spacing: 0.1em; text-transform: uppercase;
  margin: 16px 0 8px;
}
.pcard .pmeta .pdot { width: 3px; height: 3px; background: var(--bfm-grey-blue); border-radius: 999px; }

.pcard .ptitle {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  color: var(--bfm-deep);
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}

.pcard .pfoot {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--bfm-line);
}
.pcard .pprice {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--bfm-deep);
}
.pcard .pprice del { color: var(--bfm-muted); font-weight: 400; margin-right: 6px; }
.pcard .pprice ins { text-decoration: none; }

.pcard .pbuy {
  font-size: 11px;
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bfm-deep);
  font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
}
.pcard .pbuy svg { transition: transform .15s ease; }
.pcard:hover .pbuy svg { transform: translateX(3px); }

/* Chip de sello (texto plano, sin color por sello) */
.sello-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 8px;
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--sello-soft, var(--bfm-soft));
  color: var(--sello-deep, var(--bfm-deep));
  border: 1px solid var(--sello-line, var(--bfm-line));
}
.sello-chip .sello-bar {
  width: 3px; height: 12px; background: var(--sello-color, var(--bfm-deep));
}

/* ============================================
   Carrusel de productos (scroll-snap nativo)
   ============================================ */
.bfm-carousel { position: relative; }

.bfm-carousel-track {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 2px 22px; /* aire para la sombra/hover de las cards */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.bfm-carousel-track::-webkit-scrollbar { display: none; }

.bfm-carousel-item {
  flex: 0 0 calc((100% - (var(--bfm-cols, 4) - 1) * 28px) / var(--bfm-cols, 4));
  scroll-snap-align: start;
}

/* Flechas */
.bfm-carousel-nav {
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff;
  color: var(--bfm-deep);
  border: 1px solid var(--bfm-line-strong);
  border-radius: 999px;
  box-shadow: var(--sh-2);
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}
.bfm-carousel-nav:hover { background: var(--bfm-soft); }
.bfm-carousel-nav.prev { left: 4px; }
.bfm-carousel-nav.next { right: 4px; }
.bfm-carousel-nav:disabled { opacity: 0; pointer-events: none; }

@media (max-width: 1024px) {
  .bfm-carousel-track { gap: 20px; }
  .bfm-carousel-item { flex-basis: calc((100% - 20px) / 2); }
}
@media (max-width: 560px) {
  .bfm-carousel-item { flex-basis: 80%; }
  .bfm-carousel-nav { display: none; } /* en celular, scroll táctil */
}

/* ============================================
   Producto destacado (editorial-hero)
   ============================================ */
.bfm-featured {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
}
.bfm-featured.media-left { grid-template-columns: 1fr 1.4fr; }
.bfm-featured.media-left .eh-side { order: -1; }

.bfm-featured .eh-eyebrow { margin-bottom: 14px; }
.bfm-featured .sello-chip { margin-bottom: 12px; }
.bfm-featured .eh-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: 0.005em;
  color: var(--bfm-deep);
  margin: 12px 0 14px;
}
.bfm-featured .eh-abstract {
  font-size: 16px;
  line-height: 1.6;
  color: var(--bfm-ink-2);
  max-width: 520px;
  margin: 0 0 28px;
}
.bfm-featured .eh-buy {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.bfm-featured .eh-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  color: var(--bfm-deep);
}
.bfm-featured .eh-meta {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bfm-muted);
}
.bfm-featured .eh-side { display: flex; }
.bfm-featured .ehc {
  display: block;
  aspect-ratio: 3 / 4;
  width: 100%;
  max-width: 360px;
  margin-left: auto;
  box-shadow: var(--sh-3);
  overflow: hidden;
}
.bfm-featured.media-left .ehc { margin-left: 0; margin-right: auto; }
.bfm-featured .ehc img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Botón del diseño */
.bfm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--bfm-deep);
  background: var(--bfm-deep);
  color: #fff;
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease;
}
.bfm-btn:hover { background: var(--bfm-deep-2); color: #fff; text-decoration: none; }
.bfm-btn.lg { padding: 15px 28px; font-size: 14px; }

@media (max-width: 860px) {
  .bfm-featured,
  .bfm-featured.media-left { grid-template-columns: 1fr; gap: 32px; }
  .bfm-featured.media-left .eh-side { order: 0; }
  .bfm-featured .eh-title { font-size: 36px; }
  .bfm-featured .ehc,
  .bfm-featured.media-left .ehc { margin: 0 auto; }
}

/* Aviso en el editor cuando no hay resultados */
.bfm-empty {
  padding: 24px;
  border: 1px dashed var(--bfm-line-strong);
  border-radius: var(--r-sm);
  color: var(--bfm-muted);
  font-family: var(--font-body);
  text-align: center;
}

/* Responsive (independiente de los breakpoints de Elementor) */
@media (max-width: 1024px) {
  .pgrid { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
}
@media (max-width: 560px) {
  .pgrid { grid-template-columns: 1fr; }
}
