/* =========================================================
   FittingExpress · Filas de familia en las categorías
   Foto, nombre, cantidad de medidas, precio, "Ver", diámetro y "Agregar".
   ========================================================= */

.fx-shop .fx-families .wc-block-product-template { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.fx-shop .fx-families .wc-block-product-template > li { padding: 0; background: none; box-shadow: none; transform: none !important; }
.fx-shop .fx-families .wc-block-product-template > li > * { margin: 0; }

.fam {
  height: 100%; display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 12px 16px;
  padding: 14px; border-radius: var(--r-lg); background: var(--surface-lowest); box-shadow: var(--e1);
  transition: box-shadow .25s var(--ease);
}
.fam:hover { box-shadow: var(--e3); }
.fam-img { grid-row: span 2; align-self: start; display: block; width: 88px; height: 88px; border-radius: var(--r-md); background: #fff; box-shadow: inset 0 0 0 1px var(--outline-variant); overflow: hidden; }
.fam-img img { width: 100%; height: 100%; object-fit: contain; }

.fam-body { min-width: 0; display: grid; gap: 2px; }
.fam-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; font-weight: 700; color: var(--secondary-ink); }
.fam-mat { font-weight: 600; color: var(--on-surface-variant); }
.fam-mat::before { content: "·"; margin-right: 8px; color: var(--outline); }
.fam-name { margin: 0; font-family: var(--font-display); font-size: 16.5px; line-height: 1.25; letter-spacing: -.01em; }
.fam-name a { color: var(--ink); }
.fam-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.fam-price { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.fam-price small { font-size: 12px; font-weight: 600; color: var(--on-surface-variant); }
.fam-out { justify-self: start; padding: 2px 8px; border-radius: var(--r-full); background: #fdecea; color: #b3261e; font-size: 12px; font-weight: 700; }

.fam-actions { grid-column: 2; display: flex; align-items: center; gap: 8px; min-width: 0; }
.fam-size { flex: 1 1 auto; min-width: 0; margin: 0; }
.fam-size select { width: 100%; height: 40px; padding: 0 34px 0 12px; border-radius: var(--r-full); border: 1px solid var(--outline-variant); background-color: var(--surface-low); font: 600 14px/1 var(--font-body, inherit); color: var(--ink); }
.fam-actions .btn { height: 40px; padding: 0 16px; font-size: 14px; flex: 0 0 auto; }
.fam-add .ms { font-size: 19px; }
.fam-add[disabled] { opacity: .45; cursor: not-allowed; }
.fam-add.is-busy { pointer-events: none; opacity: .7; }
.fam-add.is-done { background: #2e8b57; color: #fff; }

@media (max-width: 640px) {
  .fam { grid-template-columns: 64px minmax(0, 1fr); padding: 12px; gap: 10px 12px; }
  .fam-img { grid-row: auto; width: 64px; height: 64px; }
  .fam-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .fam-size { flex-basis: 100%; }
  .fam-actions .btn { flex: 1 1 0; }
}

/* Tipo vendido a pedido (sin productos) */
.fx-cat-empty .shop-side { display: none; }
.fx-cat-empty .shop { grid-template-columns: minmax(0, 1fr) !important; }
.fam-order .btn { margin-top: 6px; }

/* Ficha de producto: más productos de la misma línea */
.fam-related { margin-top: 48px; }
.fam-related h2 { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; font-size: clamp(24px, 2.6vw, 32px); margin: 0 0 6px; }
.fam-related-intro { margin: 0 0 20px; max-width: 640px; color: var(--on-surface-variant); }
.fam-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; }

/* Celular: "Mostrando N resultados" y el orden en una sola fila, para ver antes los productos */
@media (max-width: 640px) {
  .fx-shop .toolbar { flex-wrap: nowrap !important; gap: 8px; }
  .fx-shop .toolbar .wc-block-product-results-count, .fx-shop .toolbar .woocommerce-result-count { font-size: 13.5px; margin: 0; white-space: nowrap; }
  .fx-shop .toolbar .wc-block-catalog-sorting, .fx-shop .toolbar .woocommerce-ordering { margin: 0 0 0 auto; min-width: 0; }
}
.fam-noresults-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fam-noresults-cats .btn { height: 40px; }
.fam-noresults a b { color: var(--secondary-ink); text-decoration: underline; }

/* Líneas de una sola medida (sin selector): "Ver" y "Agregar" quedan alineados a la derecha como en las demás filas */
.fam-actions > .fam-view:first-child, .fam-actions > input[type="hidden"] + .fam-view { margin-left: auto; }
