/* =====================================================================
   LatinShare — Sistema de UI global
   Implementa el sistema de diseño común a todas las páginas.
   Tokens + contenedor + espaciado + hero + headings + cards + botones +
   formularios + responsive. Las páginas aplican estas clases.
   ===================================================================== */

:root {
  /* Marca */
  --color-primary-orange: #F26522;
  --color-primary-blue: #00AEEF;
  --color-primary-green: #225640;
  --color-text-dark: #2A3540;
  --font-display: 'Funnel Display', sans-serif;
  --font-body: 'Nunito', sans-serif;

  /* Sistema (§2) */
  --container-max: 1180px;
  --container-pad: 24px;
  --container-pad-mobile: 20px;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: #171717; background: #fff; }
h1, h2, h3, h4, .font-display { font-family: var(--font-display); }
*, *::before, *::after { box-sizing: border-box; }

/* =====================================================================
   §2 — Contenedor general
   ===================================================================== */
.container-site {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}
@media (max-width: 767px) {
  .container-site { padding-left: var(--container-pad-mobile); padding-right: var(--container-pad-mobile); }
}

/* =====================================================================
   §3 — Espaciado vertical por tipo de sección
   ===================================================================== */
.section          { padding-top: 64px;  padding-bottom: 64px; }
.section-impact   { padding-top: 80px;  padding-bottom: 80px; }
.section-compact  { padding-top: 48px;  padding-bottom: 48px; }
@media (max-width: 767px) {
  .section         { padding-top: 40px; padding-bottom: 40px; }
  .section-impact  { padding-top: 44px; padding-bottom: 44px; }
  .section-compact { padding-top: 32px; padding-bottom: 32px; }
}
/* Separación encabezado de sección -> contenido */
.section-head { margin-bottom: 32px; }
@media (max-width: 767px) { .section-head { margin-bottom: 24px; } }

/* =====================================================================
   §6 — Encabezados de sección
   ===================================================================== */
.section-label {            /* etiqueta superior naranja */
  color: var(--color-primary-orange);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .01em;
  display: inline-block;
  margin-bottom: 10px;
}
.section-h2 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  color: #171717;
  font-size: clamp(34px, 3.4vw, 40px);
}
.section-subtitle {
  font-size: 18px;
  line-height: 1.5;
  max-width: 720px;
  color: #4b5563;
}
@media (max-width: 767px) {
  .section-h2 { font-size: clamp(26px, 7.2vw, 30px); }
  .section-subtitle { font-size: 16px; }
}

/* =====================================================================
   §5 — Hero global (páginas internas, alineado a la izquierda)
   ===================================================================== */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #fff;
  min-height: 420px;
  padding-top: 120px;
  padding-bottom: 80px;
}
.hero-content { max-width: 560px; text-align: left; }
.hero-breadcrumb { font-size: 12px; margin-bottom: 16px; }
.hero-label { font-size: clamp(16px, 1.6vw, 22px); font-weight: 700; color: var(--color-primary-orange); margin-bottom: 12px; }
.hero-title { font-size: clamp(48px, 5vw, 56px); line-height: 1.05; font-weight: 800; color: #171717; }
.hero-subtitle { font-size: 16px; line-height: 1.6; max-width: 560px; margin-top: 20px; color: #262626; }
.hero-actions { display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
/* Imagen de fondo del hero */
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero > .container-site { position: relative; z-index: 10; }
@media (max-width: 767px) {
  .hero { min-height: 520px; padding-top: 88px; padding-bottom: 48px; }
  .hero-title { font-size: clamp(30px, 8.5vw, 34px); }
  .hero-subtitle { font-size: 15px; }
  /* Reduce opacidad de la imagen del hero en móvil para legibilidad */
  .hero-bg img { opacity: .4; }
}

/* =====================================================================
   §7 — Sistema general de cards
   ===================================================================== */
.card {
  background: #fff;
  border-radius: 24px;
  border: 7px solid rgba(20, 24, 31, .045);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0, 0, 0, .12); }
@media (max-width: 767px) { .card { border-width: 5px; padding: 15px; } }
/* Card con imagen superior (§7.2): sin padding propio, imagen al borde */
.card.is-media { padding: 0; overflow: hidden; border-width: 1px; border-color: rgba(20,24,31,.08); }

.card-media { width: 100%; object-fit: cover; border-radius: 16px; margin-bottom: 16px; }
.card-icon { width: 44px; height: 44px; object-fit: contain; margin-bottom: 18px; }
.card-title { font-size: clamp(18px, 1.6vw, 20px); font-weight: 700; line-height: 1.25; color: #171717; }
.card-desc { font-size: 14px; line-height: 1.5; color: #4b5563; flex: 1 1 auto; }
.card-cta { font-size: 13px; font-weight: 700; margin-top: 18px; color: var(--color-primary-orange); }
@media (max-width: 767px) { .card-title { font-size: clamp(16px, 4.6vw, 18px); } }

/* =====================================================================
   §9 — Botones y CTAs
   ===================================================================== */
.btn-primary,
.btn-secondary,
.btn-orange {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  padding: 14px 26px;
  min-height: 48px;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
}
.btn-primary {
  color: #fff;
  border: 1px solid #30363c;
  background: linear-gradient(to bottom, #0d1115, #30363c);
  box-shadow: -1px 2px 2px 0 rgba(0,0,0,.26), -2px 5px 3px 0 rgba(0,0,0,.15), -4px 9px 4px 0 rgba(0,0,0,.04);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-secondary {
  color: #0f172a;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(42, 53, 64, .35);
  backdrop-filter: blur(4px);
  font-weight: 600;
}
.btn-secondary:hover { background: rgba(255, 255, 255, .85); }
.btn-orange { color: #fff; background: var(--color-primary-orange); border: 1px solid transparent; }
.btn-orange:hover { opacity: .9; }
@media (max-width: 767px) { .btn-primary, .btn-secondary, .btn-orange { min-height: 44px; } }

/* Botón debajo de grillas (§9.3) */
.btn-below-grid { margin-top: 40px; }
@media (max-width: 767px) { .btn-below-grid { margin-top: 32px; } }

/* =====================================================================
   §11 — CTA final de páginas
   ===================================================================== */
.cta-final { position: relative; overflow: hidden; min-height: 380px; padding-top: 96px; padding-bottom: 96px; display: flex; align-items: center; }
@media (max-width: 767px) { .cta-final { min-height: 320px; padding-top: 64px; padding-bottom: 64px; } }

/* =====================================================================
   §13 — Formularios
   ===================================================================== */
.form-input {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 0 16px;
  font-size: 14px;
  font-family: var(--font-body);
  color: #171717;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-input:focus { outline: none; border-color: var(--color-primary-orange); box-shadow: 0 0 0 3px rgba(242,101,34,.12); }
textarea.form-input { height: auto; min-height: 140px; padding: 16px; resize: vertical; }

/* =====================================================================
   Fondos de sección a ancho completo (§2.2, §10.1)
   ===================================================================== */
.bg-cover { background-size: cover; background-position: center; background-repeat: no-repeat; }

/* =====================================================================
   Animaciones / utilidades existentes
   ===================================================================== */
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-20px)} }
@keyframes fade-in { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-fade-in { animation: fade-in .5s ease-out; }

/* Enlace activo del nav (lo aplica include.js) */
.nav-link.is-active { color: var(--color-primary-orange); border-color: var(--color-primary-orange); }

/* ===== Selector de proveedor de licencias (§Licencias) ===== */
.license-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: #4b5563; background: #f3f4f6; border: 1px solid transparent;
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s; cursor: pointer;
}
.license-tab img { height: 20px; width: auto; display: block; }
.license-tab:hover { color: var(--color-primary-orange); }
.license-tab.is-active { background: #fff; color: #171717; border-color: var(--color-primary-orange); box-shadow: 0 2px 10px rgba(0,0,0,.08); }

/* ===== Filtro de categorías del catálogo de capacitaciones ===== */
/* Contenedor: en móvil se desplaza horizontal (una sola fila), en desktop centra y envuelve */
.cat-tabs {
  display: flex; gap: 8px; flex-wrap: nowrap;
  overflow-x: auto; scroll-snap-type: x proximity;
  -ms-overflow-style: none; scrollbar-width: none;
  padding-bottom: 6px;
}
.cat-tabs::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .cat-tabs { flex-wrap: wrap; justify-content: center; overflow: visible; } }
.cat-tab {
  display: inline-flex; align-items: center; gap: 8px; scroll-snap-align: start;
  padding: 9px 16px; border-radius: 999px; white-space: nowrap;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: #4b5563; background: #f3f4f6; border: 1px solid transparent;
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s, transform .15s; cursor: pointer;
}
.cat-tab img, .cat-tab svg { width: 16px; height: 16px; }
.cat-tab:hover { color: var(--color-primary-orange); transform: translateY(-1px); }
/* Activo: se pinta con el color de su categoría (--cat) */
.cat-tab.is-active {
  background: var(--cat, #171717); color: #fff; border-color: var(--cat, #171717);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--cat, #171717) 35%, transparent);
}
.cat-tab.is-active:hover { color: #fff; }
.cat-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px;
  font-size: 11px; font-weight: 700; background: rgba(0,0,0,.08); color: inherit;
}
.cat-tab.is-active .cat-tab-count { background: rgba(255,255,255,.25); }

/* Buscador de cursos */
.course-search {
  width: 100%; height: 48px; border-radius: 999px;
  border: 1px solid #e5e7eb; background: #fff;
  padding: 0 18px 0 44px; font-size: 14px; font-family: var(--font-body); color: #171717;
  transition: border-color .2s, box-shadow .2s;
}
.course-search::placeholder { color: #9ca3af; }
.course-search:focus { outline: none; border-color: var(--color-primary-orange); box-shadow: 0 0 0 3px rgba(242,101,34,.12); }

/* Tarjeta de curso: acento de color por categoría (--cat) + efecto de profundidad */
.course-card { cursor: pointer; border-top: 3px solid var(--cat, #e5e7eb); position: relative; }
.course-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 0 var(--cat, transparent); opacity: 0; transition: opacity .3s;
}
.course-card:hover::after { opacity: .12; box-shadow: inset 0 0 0 2px var(--cat, transparent); }

/* Ficha rápida (chips) del modal de curso */
.stat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: #4b5563;
  background: #f3f4f6; padding: 6px 12px; border-radius: 999px;
}
/* Temario del modal: viñeta cuadrada naranja */
.course-temario li {
  position: relative; padding-left: 20px; line-height: 1.45; margin-bottom: 8px;
}
.course-temario li::before {
  content: ""; position: absolute; left: 2px; top: 7px;
  width: 7px; height: 7px; border-radius: 2px; background: var(--color-primary-orange);
}

/* ===== Formulario de contacto (labels + chips de perfil) ===== */
.form-label {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: 13px; color: #374151; margin-bottom: 6px;
}
.req { color: var(--color-primary-orange); }
/* Chips seleccionables (radios estilizados) */
.chip-option { display: inline-flex; cursor: pointer; }
.chip-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-option span {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid #e5e7eb; background: #fff;
  font-family: var(--font-display); font-weight: 600; font-size: 13px; color: #4b5563;
  transition: color .15s, background .15s, border-color .15s, box-shadow .15s;
}
.chip-option:hover span { border-color: var(--color-primary-orange); color: var(--color-primary-orange); }
.chip-option input:checked + span {
  background: var(--color-primary-orange); border-color: var(--color-primary-orange); color: #fff;
  box-shadow: 0 4px 12px rgba(242,101,34,.28);
}
.chip-option input:focus-visible + span { box-shadow: 0 0 0 3px rgba(242,101,34,.25); }

/* ===== Cotización tipo carrito ===== */
.quote-fab {
  position: fixed; left: 20px; bottom: 20px; z-index: 200;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: 999px; border: none; cursor: pointer;
  background: #171717; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 13px;
  box-shadow: 0 10px 26px rgba(0,0,0,.22); transition: transform .15s, background .2s;
}
.quote-fab:hover { background: #000; transform: translateY(-2px); }
.quote-fab .quote-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--color-primary-orange); color: #fff; font-size: 12px; font-weight: 800;
}
.quote-panel {
  position: fixed; left: 20px; bottom: 74px; z-index: 201; width: 330px; max-width: calc(100vw - 40px);
  background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.28);
  border: 1px solid #eee; overflow: hidden;
}
.quote-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #f0f0f0; }
.quote-panel-head strong { font-family: var(--font-display); color: #171717; }
.quote-panel-head button { border: none; background: transparent; cursor: pointer; color: #6b7280; font-size: 15px; line-height: 1; }
.quote-list { list-style: none; margin: 0; padding: 8px; max-height: 264px; overflow-y: auto; }
.quote-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 10px; font-size: 13px; color: #374151; }
.quote-list li:hover { background: #f9fafb; }
.quote-list li button { border: none; background: transparent; cursor: pointer; color: #9ca3af; flex-shrink: 0; line-height: 1; }
.quote-list li button:hover { color: var(--color-primary-orange); }
.quote-empty { padding: 20px 16px; font-size: 13px; color: #6b7280; text-align: center; line-height: 1.5; }
.quote-actions { padding: 12px 16px 16px; border-top: 1px solid #f0f0f0; }
.quote-clear { display: block; width: 100%; margin-top: 8px; background: transparent; border: none; cursor: pointer; color: #9ca3af; font-size: 12px; font-weight: 600; }
.quote-clear:hover { color: var(--color-primary-orange); }
.quote-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 210;
  background: #171717; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; box-shadow: 0 10px 26px rgba(0,0,0,.25);
}
.quote-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Botón "Agregar a cotización" (outline) */
.btn-quote {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-size: 14px; font-weight: 700; border-radius: 999px;
  padding: 13px 22px; min-height: 48px; cursor: pointer; white-space: nowrap;
  color: #171717; background: #fff; border: 1.5px solid #d1d5db;
  transition: border-color .2s, color .2s, background .2s;
}
.btn-quote:hover { border-color: var(--color-primary-orange); color: var(--color-primary-orange); }
@media (max-width: 767px) { .btn-quote { min-height: 44px; } }

/* Botón compacto "Agregar a cotización" en tarjetas de catálogo */
.btn-quote-mini {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  margin-top: .625rem; font-family: var(--font-display); font-size: 13px; font-weight: 700;
  border-radius: 999px; padding: 9px 14px; cursor: pointer; white-space: nowrap;
  color: #171717; background: #fff; border: 1.5px solid #e5e7eb;
  transition: border-color .2s, color .2s, background .2s;
}
.btn-quote-mini:hover { border-color: var(--color-primary-orange); color: var(--color-primary-orange); background: #fff7f2; }

/* Estado "ya agregado" para ambos botones */
.btn-quote.is-added, .btn-quote-mini.is-added { border-color: var(--color-primary-green); color: var(--color-primary-green); background: #eef5f1; }
.btn-quote.is-added:hover, .btn-quote-mini.is-added:hover { border-color: var(--color-primary-green); color: var(--color-primary-green); }

/* Resumen de la cotización en la página de contacto */
.quote-summary {
  background: #fff; border: 1px solid #f0e6df; border-left: 4px solid var(--color-primary-orange);
  border-radius: 16px; padding: 18px 20px; margin-bottom: 20px; box-shadow: 0 6px 18px rgba(0,0,0,.05);
}
.quote-summary-head { display: flex; align-items: center; gap: 8px; color: var(--color-primary-orange); margin-bottom: 12px; }
.quote-summary-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #171717; }
.quote-summary-title span { color: #6b7280; font-weight: 600; }
.quote-summary-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.quote-summary-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f9fafb; border-radius: 10px; padding: 9px 12px; font-size: 14px; color: #374151; }
.quote-summary-list li button { border: none; background: transparent; cursor: pointer; color: #9ca3af; line-height: 1; flex-shrink: 0; }
.quote-summary-list li button:hover { color: var(--color-primary-orange); }
.quote-summary-note { font-size: 12.5px; color: #6b7280; line-height: 1.5; margin: 0; }

/* Chips de modelos/herramientas de IA (franja multi-modelo) */
.model-chip {
  display: inline-flex; align-items: center; padding: 7px 15px; border-radius: 999px;
  background: #fff; border: 1px solid #e5e7eb; font-family: var(--font-display);
  font-size: 13px; font-weight: 700; color: #374151; transition: border-color .2s, color .2s;
}
.model-chip:hover { border-color: var(--color-primary-orange); color: var(--color-primary-orange); }

/* ===== Banner de consentimiento de cookies (opt-in, Ley 21.719) ===== */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  padding: 14px 16px; background: #171717; color: #fff;
  box-shadow: 0 -6px 24px rgba(0,0,0,.28);
}
.cookie-banner.hidden { display: none; }
.cookie-banner-inner {
  max-width: 1100px; margin: 0 auto; display: flex; align-items: center;
  gap: 18px; flex-wrap: wrap; justify-content: space-between;
}
.cookie-banner-text { flex: 1 1 380px; margin: 0; font-size: 13px; line-height: 1.55; color: #e5e7eb; }
.cookie-banner-text a { color: #fff; text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  border-radius: 999px; padding: 10px 22px; cursor: pointer; border: 1.5px solid transparent;
  transition: background .2s, border-color .2s;
}
.cookie-btn-accept { background: var(--color-primary-orange); color: #fff; }
.cookie-btn-accept:hover { background: #e05a10; }
.cookie-btn-reject { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.cookie-btn-reject:hover { border-color: #fff; }
@media (max-width: 640px) {
  .cookie-banner-actions { width: 100%; }
  .cookie-btn { flex: 1; }
}

/* Consentimiento en formularios */
.form-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: #4b5563; line-height: 1.5; margin-top: 14px; }
.form-consent input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--color-primary-orange); flex-shrink: 0; }
.form-consent a { color: var(--color-primary-orange); text-decoration: underline; }
.form-finality { font-size: 12px; color: #6b7280; line-height: 1.5; margin-top: 12px; }

/* ===== Modal de detalle de evento ===== */
.ev-modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ev-modal.hidden { display: none; }
.ev-modal-backdrop { position: absolute; inset: 0; background: rgba(13,17,21,.6); }
.ev-modal-panel { position: relative; z-index: 1; width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 28px 24px 24px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.ev-modal-x { position: absolute; top: 14px; right: 14px; border: none; background: transparent; cursor: pointer; color: #9ca3af; font-size: 16px; line-height: 1; }
.ev-modal-x:hover { color: var(--color-primary-orange); }
.ev-modal-badge { display: inline-block; font-size: 12px; font-weight: 700; color: var(--color-primary-blue); background: #e0f5fd; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.ev-modal-badge.hidden { display: none; }
.ev-modal-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: #171717; line-height: 1.25; margin-bottom: 16px; }
.ev-modal-meta { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ev-modal-meta li { font-size: 14px; color: #374151; }
.ev-modal-meta li.hidden { display: none; }
