/*
 * Vivaflags — estilos que theme.json no puede expresar (pseudo-elementos,
 * costura punteada, animación del hero) y estilado del output de brand-core
 * en la ficha (tramos, add-ons, CTA). Todo vía tokens --wp--preset--*, de modo
 * que la variación de tema oscuro (styles/dark.json) lo reestiliza sin tocar
 * este archivo. SPEC-14 RF-06/RF-08/RF-09.
 */

/* ---------- Logo de marca (imagen del cliente) ---------- */
.vf-logo-img {
  margin: 0;
}
.vf-logo-img a {
  display: inline-block;
  line-height: 0;
}
.vf-logo-img img {
  height: 42px;
  width: auto;
  display: block;
}
.vf-logo-img--footer img {
  height: 46px;
}

/* ---------- Costura punteada: divisor de marca ---------- */
.vf-stitch,
.wp-block-separator.vf-stitch {
  border: 0;
  border-top: 2px dashed color-mix(in srgb, var(--wp--preset--color--maroon) 45%, transparent);
  opacity: 1;
  height: 0;
  margin-block: 0;
  max-width: none;
}

/* ---------- Cabecera ---------- */
.vf-header {
  border-bottom: 1px solid var(--wp--preset--color--line);
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--wp--preset--color--paper) 90%, transparent);
  backdrop-filter: blur(10px);
}
.vf-cutoff {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--wp--preset--color--success);
  background: color-mix(in srgb, var(--wp--preset--color--success) 14%, var(--wp--preset--color--surface));
  border: 1px solid color-mix(in srgb, var(--wp--preset--color--success) 30%, transparent);
  padding: 0.35em 0.8em;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Hero: bandera ondeante ---------- */
.vf-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--wp--preset--color--red);
}
.vf-hero h1 em {
  font-style: normal;
  color: var(--wp--preset--color--red);
}
.vf-flag {
  width: 100%;
  height: auto;
  filter: drop-shadow(26px 40px -28px rgba(107, 25, 16, 0.45));
}
.vf-flag .waver {
  transform-origin: 12% 50%;
  animation: vf-sway 6s ease-in-out infinite;
}
@keyframes vf-sway {
  0%, 100% { transform: rotate(-1.2deg); }
  50% { transform: rotate(1.2deg); }
}

/* ---------- Cards de familias / guías ---------- */
.vf-fam.wp-block-group,
.vf-fam.wp-block-column {
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 16px;
  padding: 1.4rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.vf-fam__media {
  margin: -0.4rem 0 0.9rem;
  border-radius: 12px;
  overflow: hidden;
  background: var(--wp--preset--color--surface-2);
}
.vf-fam__media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.vf-fam:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--wp--preset--color--red) 40%, var(--wp--preset--color--line));
  box-shadow: 0 20px 30px -24px var(--wp--preset--color--maroon);
}
.vf-fam::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--wp--preset--color--red);
}

/* ---------- Tira de confianza ---------- */
.vf-trust .vf-trust-num {
  color: var(--wp--preset--color--red);
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Ficha de producto: output de brand-core ---------- */
/* Precio dinámico según cantidad */
.vf-dynamic-price {
  color: var(--wp--preset--color--red);
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Tabla de tramos escalados (SPEC-11) */
.vf-quantity-tiers {
  margin-block: 1.4rem;
}
.vf-tiers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.vf-tiers-table th,
.vf-tiers-table td {
  text-align: left;
  padding: 0.5em 0.6em;
  border-bottom: 1px solid var(--wp--preset--color--line);
  font-variant-numeric: tabular-nums;
}
.vf-tiers-table th {
  color: var(--wp--preset--color--grey);
  font-weight: 600;
}
.vf-tiers-table td:last-child,
.vf-tiers-table th:last-child {
  text-align: right;
}
.vf-tiers-table tr.is-active td,
.vf-tiers-table tr.vf-tier-active td {
  background: color-mix(in srgb, var(--wp--preset--color--red) 10%, transparent);
  font-weight: 700;
}

/* Add-ons por línea (SPEC-13) */
.vf-addons {
  display: grid;
  gap: 0.7rem;
  margin-block: 1.4rem;
}
.vf-addon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 12px;
  padding: 0.7em 0.9em;
  font-size: 0.92rem;
}
.vf-addon label { font-weight: 700; }

/* CTA doble (subir PDF / diseñar) + aviso de diseño gratis */
.vf-design-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-block: 1.2rem;
}
.vf-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  padding: 0.85em 1.5em;
  border-radius: 12px;
  border: 2px solid transparent;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.vf-cta--upload {
  background: var(--wp--preset--color--red);
  color: #fff;
  box-shadow: 0 12px 22px -12px var(--wp--preset--color--red);
}
.vf-cta--upload:hover { transform: translateY(-2px); }
.vf-cta--generate {
  background: transparent;
  color: var(--wp--preset--color--ink);
  border-color: var(--wp--preset--color--line);
}
.vf-cta--generate:hover {
  border-color: var(--wp--preset--color--red);
  color: var(--wp--preset--color--red);
}
.vf-cta__hint {
  color: var(--wp--preset--color--grey);
  font-size: 0.85rem;
}
.vf-cutoff-notice {
  color: var(--wp--preset--color--success);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Columna "Ahorras" (3ª) y precio (2ª) a la derecha; ahorro en verde */
.vf-tiers-table td:nth-child(2),
.vf-tiers-table th:nth-child(2),
.vf-tiers-table td:nth-child(3),
.vf-tiers-table th:nth-child(3) {
  text-align: right;
}
.vf-tiers-table td:nth-child(3) {
  color: var(--wp--preset--color--success);
  font-weight: 700;
}

/* Nudge al siguiente tramo ("añade N uds y baja a X€/ud") */
.vf-tier-nudge {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--wp--preset--color--red);
}

/* ---------- Barra de valor persistente (cabecera) ---------- */
.vf-valuebar p {
  margin: 0;
  letter-spacing: 0.01em;
}
.vf-valuebar a {
  color: #fff;
}

/* ---------- Pie ---------- */
.vf-footer {
  background: var(--wp--preset--color--maroon);
  color: #f4d9d3;
}
.vf-footer a { color: #f0ccc5; }
.vf-footer a:hover { color: #fff; }
.vf-footer h2, .vf-footer h3, .vf-footer h4 { color: #fff; }

/* ---------- Accesibilidad / movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  .vf-flag .waver { animation: none; }
  .vf-fam { transition: none; }
}
:where(a, button, .vf-cta):focus-visible {
  outline: 3px solid var(--wp--preset--color--red);
  outline-offset: 2px;
}
