/* components.css — Ruta Verde Knowledge Hub */

/* ── Topbar / Sticky nav ─────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--rv-surface);
  border-bottom: 1px solid var(--rv-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration) var(--ease-out);
}
.topbar.scrolled { box-shadow: var(--shadow-md); }
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-xl);
}
.topbar-logo img { height: 36px; }
.topbar-nav { display: flex; gap: var(--sp-lg); align-items: center; }
.topbar-nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--rv-text-secondary);
  transition: color var(--duration);
}
.topbar-nav a:hover, .topbar-nav a.active { color: var(--rv-primary); text-decoration: none; }

/* ── Language toggle ─────────────────────────────────── */
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--rv-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
}
.lang-toggle button {
  padding: 4px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--rv-text-muted);
  transition: all 0.15s;
}
.lang-toggle button.active {
  background: var(--rv-primary);
  color: var(--rv-text-inverse);
}

/* ── Hero ──────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 80px var(--sp-xl) 100px;
  background: linear-gradient(135deg, #0C498A 0%, #69B5FA 50%, #669348 100%);
  color: var(--rv-text-inverse);
  overflow: hidden;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  height: 400px;
  background: url('../img/illustrations/planeta-transparent.png') no-repeat center;
  background-size: contain;
  opacity: 0.15;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  left: -40px;
  bottom: -20px;
  width: 250px;
  height: 250px;
  background: url('../img/illustrations/frailejon-hero.png') no-repeat center;
  background-size: contain;
  opacity: 0.12;
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.hero h1 { font-family: var(--font-display); font-size: 40px; font-weight: 800; line-height: 1.15; }
.hero .subtitle { font-size: 18px; opacity: 0.9; margin-top: var(--sp-md); max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-kpis {
  display: flex;
  justify-content: center;
  gap: var(--sp-2xl);
  margin-top: var(--sp-2xl);
  flex-wrap: wrap;
}
.hero-kpi .number { font-size: 44px; font-weight: 800; color: var(--rv-light-cyan); }
.hero-kpi .label { font-size: 12px; opacity: 0.7; margin-top: 2px; }
.hero-ctas { margin-top: var(--sp-xl); display: flex; gap: var(--sp-md); justify-content: center; flex-wrap: wrap; }

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--rv-surface);
  border: 1px solid var(--rv-border);
  border-radius: var(--radius-md);
  padding: var(--sp-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration), transform var(--duration);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card--accent { border-left: 4px solid var(--rv-primary); }
.card--green  { border-left: 4px solid var(--rv-forest-green); }
.card--cyan   { border-left: 4px solid var(--rv-sky-blue); }

/* ── Photo card (visual-heavy) ─────────────────────── */
.photo-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.photo-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}
.photo-card:hover img { transform: scale(1.06); }
.photo-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(12, 73, 138, 0.88) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--sp-lg);
  color: var(--rv-text-inverse);
}
.photo-card .card-overlay h3 { font-size: 18px; font-weight: 700; }
.photo-card .card-overlay p { font-size: 13px; opacity: 0.85; margin-top: 4px; }

/* ── Stat cards ────────────────────────────────────── */
.stat-card {
  background: var(--rv-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--rv-border);
  padding: var(--sp-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.stat-card .icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--sp-sm);
}
.stat-card .value {
  font-size: 32px;
  font-weight: 800;
  color: var(--rv-primary);
}
.stat-card .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rv-text-muted);
  margin-top: 4px;
}

/* ── Audience router cards ─────────────────────────── */
.router-card {
  display: block;
  background: var(--rv-surface);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  text-align: center;
  border: 2px solid transparent;
  transition: all var(--duration);
  cursor: pointer;
}
.router-card:hover { border-color: var(--rv-accent); box-shadow: var(--shadow-lg); text-decoration: none; }
.router-card .icon-wrap {
  width: 80px; height: 80px;
  margin: 0 auto var(--sp-md);
  border-radius: 50%;
  background: var(--rv-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}
.router-card .icon-wrap img { width: 48px; height: 48px; }
.router-card h3 { font-size: 18px; font-weight: 700; color: var(--rv-primary); margin-bottom: var(--sp-sm); }
.router-card p { font-size: 14px; color: var(--rv-text-secondary); }

/* ── Process timeline ──────────────────────────────── */
.timeline { position: relative; padding: var(--sp-xl) 0; }
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--rv-light-cyan), var(--rv-forest-green));
  transform: translateX(-50%);
}
.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-xl);
  margin-bottom: var(--sp-2xl);
  position: relative;
}
.timeline-step:nth-child(even) { flex-direction: row-reverse; }
.timeline-step .step-content {
  flex: 1;
  background: var(--rv-surface);
  border-radius: var(--radius-md);
  padding: var(--sp-lg);
  box-shadow: var(--shadow-sm);
}
.timeline-step .step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--rv-primary);
  color: var(--rv-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
  z-index: 2;
}

/* ── Institution cards ─────────────────────────────── */
.inst-card {
  background: var(--rv-surface);
  border: 1px solid var(--rv-border);
  border-radius: var(--radius-md);
  padding: var(--sp-lg);
  display: flex;
  gap: var(--sp-md);
  transition: box-shadow var(--duration), transform var(--duration);
  cursor: pointer;
}
.inst-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.inst-card .inst-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rv-border-light);
  object-fit: contain;
  flex-shrink: 0;
  padding: 4px;
}
.inst-card .inst-info { flex: 1; }
.inst-card .inst-name { font-weight: 700; font-size: 15px; color: var(--rv-primary); }
.inst-card .inst-meta { font-size: 12px; color: var(--rv-text-muted); margin-top: 2px; }
.inst-card .inst-products { font-size: 13px; margin-top: var(--sp-sm); }

/* ── Product table overrides (Grid.js) ──────────────── */
.gridjs-container { font-size: 13px; border: none !important; }
.gridjs-wrapper { border: 1px solid var(--rv-border) !important; border-radius: var(--radius-md) !important; }
.gridjs-table { border-collapse: collapse; }
.gridjs-th {
  background: var(--rv-surface-alt) !important;
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rv-primary) !important;
  border-bottom: 2px solid var(--rv-accent) !important;
}
.gridjs-td { padding: 10px 14px !important; }
.gridjs-tr:hover td { background: #f0fafe !important; }
.gridjs-pagination .gridjs-pages button {
  border-radius: var(--radius-sm) !important;
}
.gridjs-search-input {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--rv-border) !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
}

/* ── Filter bar ────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
  padding: var(--sp-md);
  background: var(--rv-surface-alt);
  border-radius: var(--radius-md);
}
.filter-bar select, .filter-bar input {
  padding: 8px 12px;
  border: 1px solid var(--rv-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--rv-surface);
}

/* ── Badges ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}
.badge--green  { background: #dcedc8; color: #558b2f; }
.badge--amber  { background: #ffe0b2; color: #e65100; }
.badge--red    { background: #ffcdd2; color: #b71c1c; }
.badge--blue   { background: #bbdefb; color: #0d47a1; }
.badge--teal   { background: #b2dfdb; color: #004d40; }
.badge--gray   { background: #f5f5f5; color: #616161; }
.badge--cyan   { background: #e0f7fa; color: #006064; }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn--primary { background: var(--rv-primary); color: #fff; }
.btn--primary:hover { background: #083b72; text-decoration: none; }
.btn--accent  { background: var(--rv-light-cyan); color: var(--rv-primary); }
.btn--accent:hover { background: #8de3f5; text-decoration: none; }
.btn--outline { background: transparent; color: var(--rv-primary); border: 2px solid var(--rv-primary); }
.btn--outline:hover { background: var(--rv-primary); color: #fff; text-decoration: none; }
.btn--ghost   { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.btn--ghost:hover { background: rgba(255,255,255,0.25); text-decoration: none; }
.btn--lg { padding: 14px 28px; font-size: 16px; }

/* ── Accordion (regulatory) ────────────────────────── */
.accordion details {
  border: 1px solid var(--rv-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-sm);
  overflow: hidden;
}
.accordion summary {
  padding: var(--sp-md) var(--sp-lg);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  background: var(--rv-surface);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accordion summary::after { content: '+'; font-size: 20px; color: var(--rv-primary); transition: transform 0.2s; }
.accordion details[open] summary::after { content: '−'; }
.accordion .acc-body { padding: var(--sp-md) var(--sp-lg) var(--sp-lg); font-size: 14px; line-height: 1.7; }

/* ── Calculator panel ──────────────────────────────── */
.calc-panel {
  background: var(--rv-surface);
  border: 1px solid var(--rv-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-md);
}
.calc-panel h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--rv-primary);
  margin-bottom: var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.calc-panel label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--rv-text-secondary);
  margin-bottom: 4px;
}
.calc-panel input[type="range"] {
  width: 100%;
  accent-color: var(--rv-primary);
}
.calc-panel .calc-output {
  margin-top: var(--sp-lg);
  padding: var(--sp-lg);
  background: var(--rv-surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--rv-accent);
}
.calc-panel .output-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--rv-primary);
}

/* ── Section illustrated overlay ──────────────────── */
.section-illustrated {
  position: relative;
  overflow: hidden;
}
.section-illustrated::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -20px;
  width: 280px;
  height: 280px;
  background: url('../img/illustrations/frailejon-transparent.svg') no-repeat center;
  background-size: contain;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
.section-illustrated > * { position: relative; z-index: 1; }

/* ── CTA Banner ────────────────────────────────────── */
.cta-banner {
  position: relative;
  padding: var(--sp-3xl) var(--sp-xl);
  background: linear-gradient(135deg, #0C498A 0%, #69B5FA 60%, #669348 100%);
  border-radius: var(--radius-lg);
  color: var(--rv-text-inverse);
  text-align: center;
  overflow: hidden;
}
.cta-banner::after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -30px;
  width: 320px;
  height: 320px;
  background: url('../img/illustrations/nave-full.png') no-repeat center;
  background-size: contain;
  opacity: 0.2;
  pointer-events: none;
}
.cta-banner h2 { font-size: 28px; font-weight: 800; position: relative; z-index: 1; }
.cta-banner p { font-size: 16px; opacity: 0.9; margin-top: var(--sp-sm); position: relative; z-index: 1; }
