/* ============================================
   BFM Store — estilos de plantillas WooCommerce
   (single product + archive). La tarjeta/grilla (.pcard/.pgrid)
   las aporta el plugin bfm-store (widgets.css). Aquí: layout single,
   tipografía del resumen, botón, tabs y cabecera de archive.
   ============================================ */

/* ---------- Single product: layout 2 columnas ---------- */
.bfm-store.single-product div.product {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}
/* Ningún hijo del grid puede forzar ancho mayor al de su columna */
.bfm-store.single-product div.product > * { min-width: 0; }
.bfm-store.single-product div.product .woocommerce-product-gallery,
.bfm-store.single-product div.product .summary.entry-summary {
  width: auto;
  float: none;
  margin: 0;
  min-width: 0; /* evita que el slider/imagen desborde la columna en móvil */
}
.bfm-store.single-product div.product .woocommerce-product-gallery img { max-width: 100%; height: auto; }
/* Tabs, relacionados y upsells a todo el ancho */
.bfm-store.single-product div.product > .woocommerce-tabs,
.bfm-store.single-product div.product > .related,
.bfm-store.single-product div.product > .up-sells {
  grid-column: 1 / -1;
}

.bfm-store.single-product .woocommerce-product-gallery__image img { box-shadow: var(--sh-3); }

/* ---------- Single product: resumen ---------- */
.bfm-store.single-product div.product .pd-marks {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.bfm-store.single-product div.product .pd-formato {
  font-family: var(--font-display);
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--bfm-muted);
  border: 1px solid var(--bfm-line);
  padding: 5px 9px; border-radius: var(--r-xs);
}
.bfm-store.single-product div.product .product_title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 34px; line-height: 1.15;
  color: var(--bfm-deep);
  margin: 12px 0 10px;
}
.bfm-store.single-product div.product .pd-issue {
  color: var(--bfm-muted); font-size: 14px; margin-bottom: 24px;
}
.bfm-store.single-product div.product .woocommerce-product-details__short-description {
  font-size: 15px; line-height: 1.65; color: var(--bfm-ink-2); margin-bottom: 28px; max-width: 540px;
}
.bfm-store.single-product div.product .summary .price {
  font-family: var(--font-display);
  font-weight: 700; color: var(--bfm-deep); font-size: 30px;
  margin: 0 0 18px; display: block;
}
.bfm-store.single-product div.product .summary .price del { color: var(--bfm-muted); font-weight: 400; font-size: 18px; }
.bfm-store.single-product div.product .summary .price ins { text-decoration: none; }

/* Cantidad + botón añadir al carrito */
.bfm-store.single-product div.product form.cart {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 26px;
}
.bfm-store.single-product div.product form.cart .quantity input.qty {
  width: 64px; height: 46px;
  border: 1px solid var(--bfm-line-strong); border-radius: var(--r-sm);
  text-align: center; padding: 0 6px;
}
.bfm-store.single-product div.product form.cart .single_add_to_cart_button,
.bfm-store.single-product div.product form.cart .buy-now {
  flex: 1 1 170px; text-align: center;
  font-family: var(--font-body); font-weight: 500; letter-spacing: 0.04em; font-size: 14px;
  padding: 14px 28px; border-radius: var(--r-sm); cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
/* Añadir al carrito = primario (relleno) */
.bfm-store.single-product div.product form.cart .single_add_to_cart_button {
  background: var(--bfm-deep); color: #fff; border: 1px solid var(--bfm-deep); text-transform: none;
}
.bfm-store.single-product div.product form.cart .single_add_to_cart_button:hover { background: var(--bfm-deep-2); }
/* Comprar ahora = secundario (contorno) */
.bfm-store.single-product div.product form.cart .buy-now {
  background: #fff; color: var(--bfm-deep); border: 1px solid var(--bfm-line-strong);
}
.bfm-store.single-product div.product form.cart .buy-now:hover { border-color: var(--bfm-deep); background: var(--bfm-soft); }

/* Notas de entrega digital — cards con íconos */
.bfm-store.single-product div.product .pd-included {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  margin: 28px 0 0; padding-top: 28px;
  border-top: 1px solid var(--bfm-line);
}
.bfm-store.single-product div.product .inc {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bfm-soft);
  padding: 16px;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--bfm-deep);
}
.bfm-store.single-product div.product .inc .inc-icon {
  flex: 0 0 auto; display: inline-flex; color: var(--bfm-deep);
}
.bfm-store.single-product div.product .inc .inc-body strong {
  display: block;
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--bfm-deep); margin-bottom: 4px;
}
.bfm-store.single-product div.product .inc .inc-body span {
  font-size: 12px; line-height: 1.45; color: var(--bfm-ink-2);
}

/* ---------- Tabs (nativas) con look del diseño ---------- */
.bfm-store .woocommerce-tabs { margin-top: 60px; }
.bfm-store .woocommerce-tabs ul.tabs {
  display: flex; flex-wrap: wrap; gap: 4px 32px; list-style: none;
  padding: 0; margin: 0 0 28px;
  border-bottom: 1px solid var(--bfm-line);
}
.bfm-store .woocommerce-tabs ul.tabs::before { display: none; }
.bfm-store .woocommerce-tabs ul.tabs li {
  background: none; border: 0; border-radius: 0; padding: 0; margin: 0;
}
.bfm-store .woocommerce-tabs ul.tabs li::before,
.bfm-store .woocommerce-tabs ul.tabs li::after { display: none; }
.bfm-store .woocommerce-tabs ul.tabs li a {
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700;
  color: var(--bfm-muted);
  padding: 18px 0; display: inline-block;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.bfm-store .woocommerce-tabs ul.tabs li.active a { color: var(--bfm-deep); border-bottom-color: var(--bfm-deep); }
.bfm-store .woocommerce-tabs .panel { color: var(--bfm-ink-2); font-size: 14px; line-height: 1.7; }
.bfm-store .woocommerce-tabs .panel h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--bfm-deep);
}

/* Encabezado de relacionados / upsells */
.bfm-store .related > h2,
.bfm-store .up-sells > h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--bfm-deep); margin-bottom: 24px;
}

/* ---------- Archive / tienda ---------- */
.bfm-store .woocommerce-products-header__title,
.bfm-store.woocommerce .page-title {
  font-family: var(--font-display); font-weight: 700; color: var(--bfm-deep);
}
.bfm-store.woocommerce .bfm-results-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin: 0 0 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--bfm-line);
}
.bfm-store.woocommerce .bfm-results-head .woocommerce-result-count,
.bfm-store.woocommerce .bfm-results-head .woocommerce-ordering {
  float: none; margin: 0;
}
.bfm-store.woocommerce .woocommerce-result-count {
  color: var(--bfm-muted); font-size: 12px;
  font-family: var(--font-display); letter-spacing: 0.1em; text-transform: uppercase;
}
.bfm-store.woocommerce .woocommerce-ordering select {
  border: 1px solid var(--bfm-line-strong); padding: 8px 12px; border-radius: var(--r-sm); background: #fff;
}
/* La grilla del loop despeja cualquier float previo */
.bfm-store.woocommerce .pgrid--wc { clear: both; }

/* ---------- Archive: layout 2 columnas (sidebar filtros + grilla) ---------- */
.bfm-store.woocommerce .bfm-archive {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  margin-top: 8px;
  padding-bottom: 80px; /* aire antes del footer */
}
@media (max-width: 860px) {
  .bfm-store.woocommerce .bfm-archive { padding-bottom: 56px; }
}
.bfm-store.woocommerce .bfm-archive-main { min-width: 0; }

.bfm-store .bfm-filters-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 16px;
}
.bfm-store .bfm-filters h4 {
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700;
  color: var(--bfm-deep); margin: 24px 0 10px;
}
.bfm-store .bfm-filters-head h4 { margin: 0; }
.bfm-store .bfm-filter-clear { font-size: 11px; color: var(--bfm-muted); }
.bfm-store .bfm-filter-clear:hover { color: var(--bfm-deep); }
.bfm-store .bfm-filter-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bfm-store .bfm-filter-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; font-size: 13px; color: var(--bfm-ink-2);
  border-radius: var(--r-sm); border: 1px solid transparent; text-decoration: none;
}
.bfm-store .bfm-filter-list a:hover { background: var(--bfm-soft); color: var(--bfm-deep); }
.bfm-store .bfm-filter-list a.is-active { background: var(--bfm-deep); color: #fff; }
.bfm-store .bfm-filter-count { font-size: 11px; color: var(--bfm-muted); font-variant-numeric: tabular-nums; }
.bfm-store .bfm-filter-list a.is-active .bfm-filter-count { color: rgba(255, 255, 255, 0.7); }

/* ---------- Banner de categoría (sobre el header existente) ---------- */
.bfm-store.tax-product_cat .woocommerce-products-header,
.bfm-store.tax-product_tag .woocommerce-products-header {
  background: var(--bfm-deep);
  color: #fff;
  padding: 44px var(--pad);
  border-radius: var(--r-sm);
  margin-bottom: 32px;
  text-align: left;
  overflow: hidden;
}
.bfm-store.tax-product_cat .woocommerce-products-header__title,
.bfm-store.tax-product_tag .woocommerce-products-header__title {
  color: #fff; margin: 0;
  font-size: clamp(1.9rem, 5vw, 46px); line-height: 1.1;
}
.bfm-store.tax-product_cat .woocommerce-products-header .term-description {
  color: var(--bfm-grey-blue); margin-top: 10px; max-width: 640px; font-size: 14px;
}

@media (max-width: 860px) {
  .bfm-store.woocommerce .bfm-archive { grid-template-columns: 1fr; gap: 24px; }
  .bfm-store .bfm-filters { border-bottom: 1px solid var(--bfm-line); padding-bottom: 12px; }
  .bfm-store .bfm-filters h4 { margin-top: 16px; }
}

/* ============================================
   WooCommerce Blocks — Carrito y Checkout
   Son los bloques modernos (Cart/Checkout Blocks): se personalizan por CSS,
   no por templates PHP. Apuntamos a las clases estables de los bloques.
   ============================================ */

/* Alinear los bloques al contenedor (el alignwide los desplazaba a la izquierda y cortaba la columna) */
.bfm-store .wp-block-woocommerce-cart.alignwide,
.bfm-store .wp-block-woocommerce-checkout.alignwide {
  margin-left: 0;
  margin-right: 0;
  max-width: none;
  width: 100%;
}

/* Botones primarios (Pasar al pago / Realizar el pedido) */
.bfm-store .wc-block-components-button.contained,
.bfm-store .wc-block-components-button.wp-element-button.contained {
  background: var(--bfm-deep);
  color: #fff;
  border: 1px solid var(--bfm-deep);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-weight: 500; letter-spacing: 0.04em;
  box-shadow: none; text-decoration: none;
}
.bfm-store .wc-block-components-button.contained:hover {
  background: var(--bfm-deep-2); border-color: var(--bfm-deep-2);
}
.bfm-store .wc-block-components-button.contained .wc-block-components-button__text { text-decoration: none; }

/* Títulos de sección / resumen en Orbitron */
.bfm-store .wc-block-components-title,
.bfm-store .wc-block-components-checkout-step__title,
.bfm-store .wc-block-cart__totals-title {
  font-family: var(--font-display);
  color: var(--bfm-deep);
  font-weight: 700;
}

/* Total (pie) en Orbitron deep */
.bfm-store .wc-block-components-totals-footer-item {
  font-family: var(--font-display);
  color: var(--bfm-deep);
}

/* Nombre del producto */
.bfm-store .wc-block-components-product-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--bfm-deep);
  text-decoration: none;
}
.bfm-store .wc-block-components-product-name:hover { color: var(--bfm-deep-2); }

/* Caja de totales del carrito con fondo suave (look del diseño) */
.bfm-store .wc-block-cart__sidebar .wc-block-components-sidebar,
.bfm-store .wc-block-cart__sidebar.wc-block-components-sidebar {
  background: var(--bfm-soft);
  border: 1px solid var(--bfm-line);
  border-radius: var(--r-sm);
  padding: 24px;
}

/* Inputs: radio de marca */
.bfm-store .wc-block-components-text-input input,
.bfm-store .wc-block-components-text-input textarea {
  border-radius: var(--r-sm);
}

/* Links en azul de marca */
.bfm-store .wc-block-checkout__terms a,
.bfm-store .wc-block-components-totals-coupon a { color: var(--bfm-deep); }

/* Campo "dirección 2" colapsado: ocultarlo de verdad (el bloque lo manda
   fuera de pantalla con left negativo y genera scroll horizontal en móvil) */
.bfm-store .wc-block-components-address-form__address_2-hidden { display: none !important; }

/* ---------- Responsive single ---------- */
@media (max-width: 860px) {
  .bfm-store.single-product div.product { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .bfm-store.single-product div.product .product_title { font-size: 28px; }
  /* Galería topada y centrada (si no, ocupa toda la pantalla) */
  .bfm-store.single-product div.product .woocommerce-product-gallery {
    max-width: min(360px, 100%); margin: 0 auto;
  }
  /* Botones apilados full-width en móvil */
  .bfm-store.single-product div.product form.cart .single_add_to_cart_button,
  .bfm-store.single-product div.product form.cart .buy-now { flex: 1 1 100%; }
}
