/*
 * TOKENS DE DISEÑO CIB · wp-content/cib-home/cib-tokens.css
 * ----------------------------------------------------------------
 * ÚNICA FUENTE de colores, radios y fuentes de Academia CIB.
 * Se carga en WordPress con mu-plugins/cib-tokens.php y con <link> en
 * cib-home.html y en las apps estáticas (/diagnostico-campo/, /simulador-clinico/,
 * /webinar-clinica/). Los componentes (.cib-btn, .cib-card, escala tipográfica)
 * se agregan en este mismo archivo en los bloques B y C.
 *
 * Los 5 colores fijos son la fuente de verdad. No agregar colores fuera de
 * esta lista sin aprobación: usar var(--cib-…).
 */
:root {
  /* Marca (fijos) */
  --cib-verde: #3d8b2f;
  --cib-dorado: #c8961a;
  --cib-navy: #021126;
  --cib-azul: #003b73;
  --cib-verde-osc: #007a3d;

  /* Derivados justificados */
  --cib-verde-claro: #78d466;   /* texto/íconos sobre navy (el verde de marca no alcanza contraste) */
  --cib-dorado-claro: #e8b334;  /* anillo de foco y resaltes sobre fondos oscuros */
  --cib-dorado-texto: #8a6410;  /* dorado como texto sobre blanco (5.4:1) */
  --cib-accion: var(--cib-verde-osc); /* botón primario (propuesta 1, contraste 5.45:1 con texto blanco) */

  /* Neutros */
  --cib-texto: #0f1f0a;
  --cib-texto-suave: #4a5a40;
  --cib-fondo: #f6f7f2;
  --cib-fondo-2: #eef0eb;
  --cib-borde: #dde2da;
  --cib-blanco: #ffffff;

  /* Estados y marcas externas */
  --cib-error: #d63c3c;
  --cib-whatsapp: #25d366;

  /* Radios */
  --cib-radio-btn: 30px;
  --cib-radio-card: 18px;

  /* Fuentes (opción A: Poppins texto / Space Grotesk títulos) */
  --cib-font-texto: "Poppins", system-ui, sans-serif;
  --cib-font-titulo: "Space Grotesk", system-ui, sans-serif;
}

/* ================================================================
   COMPONENTES (H-19) · botones y tarjetas
   Propuesta 1: acción = --cib-accion (#007a3d, 5.45:1 con texto blanco).
   .cib-btn se usa en HTML propio; los selectores nativos de Kadence,
   WooCommerce y LearnDash reciben el MISMO estilo sin plantillas nuevas.
   ================================================================ */
:root {
  --cib-accion-hover: #00643a;
  --cib-sombra-card: 0 10px 30px rgba(2, 17, 38, 0.08);
}

.cib-btn,
body .woocommerce a.button,
body .woocommerce button.button,
body .woocommerce input.button,
body .woocommerce #respond input#submit,
body .single_add_to_cart_button,
body a.add_to_cart_button,
body .wp-block-button__link,
body .wp-element-button,
body #place_order,
body .wc-block-components-button:not(.is-link),
body:not(.ld-in-focus-mode) .learndash-wrapper .ld-button:not(.ld-button-transparent) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  font-family: var(--cib-font-texto);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  color: var(--cib-blanco);
  background: var(--cib-accion);
  border: 2px solid var(--cib-accion);
  border-radius: var(--cib-radio-btn);
  box-shadow: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.cib-btn:hover,
.cib-btn.is-hover,
body .woocommerce a.button:hover,
body .woocommerce button.button:hover,
body .woocommerce input.button:hover,
body .woocommerce #respond input#submit:hover,
body .single_add_to_cart_button:hover,
body a.add_to_cart_button:hover,
body .wp-block-button__link:hover,
body .wp-element-button:hover,
body #place_order:hover,
body .wc-block-components-button:not(.is-link):hover,
body:not(.ld-in-focus-mode) .learndash-wrapper .ld-button:not(.ld-button-transparent):hover {
  color: var(--cib-blanco);
  background: var(--cib-accion-hover);
  border-color: var(--cib-accion-hover);
  transform: translateY(-1px);
}

.cib-btn:focus-visible,
.cib-btn.is-focus,
body .woocommerce a.button:focus-visible,
body .woocommerce button.button:focus-visible,
body .woocommerce input.button:focus-visible,
body .woocommerce #respond input#submit:focus-visible,
body .single_add_to_cart_button:focus-visible,
body a.add_to_cart_button:focus-visible,
body .wp-block-button__link:focus-visible,
body .wp-element-button:focus-visible,
body #place_order:focus-visible,
body .wc-block-components-button:not(.is-link):focus-visible,
body:not(.ld-in-focus-mode) .learndash-wrapper .ld-button:not(.ld-button-transparent):focus-visible {
  outline: 3px solid var(--cib-dorado-claro);
  outline-offset: 3px;
}

.cib-btn[disabled],
.cib-btn[aria-disabled="true"],
.cib-btn.is-disabled,
body .woocommerce button.button:disabled,
body .woocommerce button.button.disabled,
body #place_order:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

/* Secundario: contorno navy */
.cib-btn--sec {
  color: var(--cib-navy);
  background: transparent;
  border-color: var(--cib-navy);
}

.cib-btn--sec:hover,
.cib-btn--sec.is-hover {
  color: var(--cib-blanco);
  background: var(--cib-navy);
  border-color: var(--cib-navy);
}

/* Ghost: solo texto con subrayado dorado */
.cib-btn--ghost {
  min-height: 44px;
  padding: 0 14px;
  color: var(--cib-navy);
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-decoration-color: var(--cib-dorado);
  text-underline-offset: 4px;
}

.cib-btn--ghost:hover,
.cib-btn--ghost.is-hover {
  color: var(--cib-navy);
  background: rgba(2, 17, 38, 0.06);
  border-color: transparent;
  transform: none;
}

/* Sobre fondo navy: secundario y ghost se invierten a blanco */
.cib-on-dark .cib-btn--sec {
  color: var(--cib-blanco);
  border-color: var(--cib-blanco);
}

.cib-on-dark .cib-btn--sec:hover {
  color: var(--cib-navy);
  background: var(--cib-blanco);
  border-color: var(--cib-blanco);
}

.cib-on-dark .cib-btn--ghost {
  color: var(--cib-blanco);
}

/* Tarjeta */
.cib-card {
  padding: 24px;
  background: var(--cib-blanco);
  border: 1px solid var(--cib-borde);
  border-radius: var(--cib-radio-card);
  box-shadow: var(--cib-sombra-card);
}

@media (prefers-reduced-motion: reduce) {
  .cib-btn,
  .cib-btn:hover {
    transition: none;
    transform: none;
  }
}

/* ================================================================
   ESCALA TIPOGRÁFICA (H-20) · un solo peso y familia por nivel
   Títulos: Space Grotesk 700 · Texto: Poppins · clamp() para móvil.
   H1 32→56 px · H2 24→32 px · H3 20→24 px · H4 18 px · texto 16 px
   El hero del home queda fuera de la escala (decisión de diseño).
   ================================================================ */
:root {
  --cib-h1: clamp(2rem, 1.25rem + 3.2vw, 3.5rem);
  --cib-h2: clamp(1.5rem, 1.1rem + 1.6vw, 2rem);
  --cib-h3: clamp(1.25rem, 1.05rem + 0.8vw, 1.5rem);
  --cib-h4: 1.125rem;
  --cib-peso-titulo: 700;
  --cib-lh-titulo: 1.15;
}

.cib-h1, .cib-h2, .cib-h3, .cib-h4 {
  font-family: var(--cib-font-titulo);
  font-weight: var(--cib-peso-titulo);
  line-height: var(--cib-lh-titulo);
  color: var(--cib-navy);
  margin: 0 0 0.5em;
}
.cib-h1 { font-size: var(--cib-h1); line-height: 1.1; }
.cib-h2 { font-size: var(--cib-h2); line-height: 1.2; }
.cib-h3 { font-size: var(--cib-h3); line-height: 1.3; }
.cib-h4 { font-size: var(--cib-h4); line-height: 1.4; }

/* Catálogo/archivo de productos: botón con texto centrado (display flex gana a Kadence) */
body.woocommerce ul.products li.product a.button,
body.woocommerce ul.products li.product a.button.add_to_cart_button,
body.woocommerce ul.products li.product .button.product_type_simple {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-align: center;
}
