/* ==========================================================================
   Filo 9 — Packs x1 / x3 / x6 en la ficha (inc/packs.php · assets/js/packs.js)
   Tres tarjetas compactas encima de la cantidad; la elegida con borde negro.
   Rojo solo para «Ahorra N%».
   ========================================================================== */

.filo-pack { flex: 1 1 100%; min-width: 0; margin: 0 0 2px; padding: 0; border: 0; }
.filo-pack[hidden] { display: none; }
.filo-pack__leyenda { margin: 0 0 8px; padding: 0; color: #222222; font-size: 13px; font-weight: 700; }

.filo-pack__opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }

.filo-pack__op {
	position: relative; display: grid; align-content: start; gap: 2px; min-height: 76px; margin: 0; padding: 10px 10px 9px;
	border: 1px solid #E5E5E5; border-radius: 4px; background: #FFFFFF; color: #222222; cursor: pointer;
	transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}
.filo-pack__radio { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
/* Borde de la elegida: un marco de 2px que se asienta (escala 1.03 → 1 y aparece, 200ms). */
.filo-pack__op::after {
	content: ''; position: absolute; inset: -1px; border: 2px solid #000000; border-radius: 4px; pointer-events: none;
	opacity: 0; transform: scale(1.03);
	transition: opacity 160ms ease-out, transform 200ms cubic-bezier(.23, 1, .32, 1);
}
.filo-pack__op:has(.filo-pack__radio:checked)::after, .filo-pack__op.is-elegido::after { opacity: 1; transform: none; }
.filo-pack__op:has(.filo-pack__radio:focus-visible) { outline: 2px solid #000000; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
	.filo-pack__op:not(.is-agotado):hover { border-color: #222222; }
}

.filo-pack__cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; }
.filo-pack__n { font-size: 16px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.filo-pack__dto {
	padding: 1px 5px; border-radius: 2px; background: var(--rojo, #C8102E); color: #FFFFFF;
	font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap;
}
/* Al elegir la tarjeta: 1 → 1.08 → 1 y un rojo más hondo un instante (packs.js, una vez por elección). */
.filo-pack__dto.is-pulso { animation: filo-pack-pulso 280ms cubic-bezier(.23, 1, .32, 1); }
@keyframes filo-pack-pulso {
	0% { transform: none; }
	45% { transform: scale(1.08); background-color: #9E0B22; }
	100% { transform: none; }
}

/* Total de lo que se lleva: los números corren al cambiar (packs.js). */
.filo-pack__suma {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin: 10px 0 0;
	color: #222222; font-size: 13px; font-variant-numeric: tabular-nums;
}
.filo-pack__suma-et { margin-right: auto; font-weight: 700; }
.filo-pack__suma-n { color: #767676; font-weight: 400; }
.filo-pack__suma-cu { color: #767676; font-size: 12px; }
.filo-pack__suma-total { font-size: 16px; font-weight: 800; }
.filo-pack__total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin-top: 4px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.filo-pack__antes { color: #767676; font-size: 12px; font-weight: 400; }
.filo-pack__cu { color: #767676; font-size: 12px; font-variant-numeric: tabular-nums; }
.filo-pack__op:has(.filo-pack__dto) .filo-pack__total > .woocommerce-Price-amount { color: var(--rojo, #C8102E); }

.filo-pack__op.is-agotado { cursor: not-allowed; background: #F6F6F6; }
.filo-pack__op.is-agotado .filo-pack__radio { cursor: not-allowed; }
.filo-pack__op.is-agotado .filo-pack__n, .filo-pack__op.is-agotado .filo-pack__total { color: #5E5E5E; } /* sobre #F6F6F6 */
.filo-pack__op.is-agotado .filo-pack__total > .woocommerce-Price-amount { color: #5E5E5E; }
.filo-pack__op.is-agotado .filo-pack__dto { background: #5E5E5E; }
.filo-pack__op.is-agotado .filo-pack__cu { color: #444444; }
.filo-pack__op.is-agotado .filo-pack__antes { color: #5E5E5E; }

/* .filo-pack__resumen es solo para lectores de pantalla (aria-live); lo visible es .filo-pack__suma. */

@media (max-width: 380px) {
	.filo-pack__opciones { gap: 6px; }
	.filo-pack__op { padding: 8px; }
	.filo-pack__antes { display: none; }
}
/* Sin @media prefers-reduced-motion: decisión del cliente (ver filo.css); todo dura ≤ 300ms. */
