/* ==========================================================================
   JABALAB — estilos compartidos por todas las páginas
   Fuente, iconos, tokens de color (tema claro/oscuro), base, barra de scroll,
   accesibilidad, navbar y footer. Cada página agrega su propia hoja:
   home.css (inicio), blog.css (blog y artículo), aviso.css (Aviso de Privacidad).
   Al modificar este archivo, sube su versión (?v=) en las 4 páginas.
   ========================================================================== */

/* ===== FUENTE (Inter variable, subconjunto latino: incluye á é í ó ú ñ ü ¿ ¡) ===== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Iconos SVG (.svg-icon) del sprite assets/img/icons.svg?v=2 (Font Awesome Free, CC BY 4.0) */
.svg-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
  flex-shrink: 0;
}

/* ===== VARIABLES ===== */
/* Verde de referencia de la marca (logo): #12ba38.
   Se usa en botones, iconos, bordes, contador y acentos grandes.
   --primary-text es un tono más oscuro del mismo verde solo para texto pequeño
   en modo claro (#097a26 = 5.2:1 sobre el fondo; #12ba38 daría 2.4:1). */
:root {
  --primary: #12ba38;
  --primary-dark: #0d8f2a;
  --primary-light: #12ba38;
  --primary-text: #097a26;
  --accent: #808080;
  --bg-body: #f5f8fe;
  --text-primary: #0b1a30;
  --text-secondary: #1f3a66;
  --text-muted: #3a5580;
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(11, 26, 48, 0.09);
  --glass-shadow: 0 20px 60px rgba(11, 26, 48, 0.06);
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(11, 26, 48, 0.08);
  --card-shadow: 0 12px 40px rgba(11, 26, 48, 0.06);
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-border: rgba(11, 26, 48, 0.22);
  --footer-bg: #0b1a30;
  --footer-text: #b6cce5;
  --navbar-bg: rgba(255, 255, 255, 0.75);
  --navbar-border: rgba(11, 26, 48, 0.08);
  --hero-overlay-1: rgba(18, 186, 56, 0.06);
  --hero-overlay-2: rgba(128, 128, 128, 0.03);
  --stat-bg: rgba(255, 255, 255, 0.7);
  --stat-border: rgba(11, 26, 48, 0.08);
  --form-card-bg: rgba(255, 255, 255, 0.7);
  --form-card-border: rgba(11, 26, 48, 0.08);
  --contact-card-bg: rgba(255, 255, 255, 0.7);
  --contact-card-border: rgba(11, 26, 48, 0.08);
  --support-bg: rgba(255, 255, 255, 0.6);
  --support-border: rgba(11, 26, 48, 0.08);
  --section-bg: rgba(255, 255, 255, 0.45);
  --modal-overlay: rgba(11, 26, 48, 0.45);
  --accordion-bg: rgba(255, 255, 255, 0.65);
  --accordion-border: rgba(11, 26, 48, 0.09);
  --navbar-menu-bg: rgba(245, 248, 254, 0.97);

  /* Superficies del blog y el aviso */
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --border: rgba(11, 26, 48, 0.09);
  --shadow: 0 12px 40px rgba(11, 26, 48, 0.06);
  --shadow-hover: 0 22px 50px rgba(11, 26, 48, 0.12);
  --tint: rgba(18, 186, 56, 0.08);
  --tint-border: rgba(18, 186, 56, 0.25);
  --skeleton: rgba(11, 26, 48, 0.07);
  --skeleton-shine: rgba(255, 255, 255, 0.65);
  --radius: 20px;
  --content-w: 1180px;

  /* Layout */
  --nav-h: 68px;
  --gutter: clamp(1rem, 3vw, 2rem);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  --primary-light: #4ade80;
  --primary-text: #4ade80;
  --input-border: rgba(255, 255, 255, 0.1);
  --bg-body: #090c14;
  --text-primary: #e6edf3;
  --text-secondary: #b0c4d9;
  --text-muted: #8b9eb5;
  --glass-bg: rgba(20, 30, 45, 0.4);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --card-bg: rgba(20, 30, 45, 0.3);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  --input-bg: rgba(30, 45, 60, 0.4);
  --footer-bg: rgba(6, 10, 18, 0.95);
  --footer-text: #8b9eb5;
  --navbar-bg: rgba(9, 12, 20, 0.5);
  --navbar-border: rgba(255, 255, 255, 0.04);
  --hero-overlay-1: rgba(18, 186, 56, 0.1);
  --hero-overlay-2: rgba(128, 128, 128, 0.06);
  --stat-bg: rgba(20, 30, 45, 0.25);
  --stat-border: rgba(255, 255, 255, 0.05);
  --form-card-bg: rgba(20, 30, 45, 0.3);
  --form-card-border: rgba(255, 255, 255, 0.05);
  --contact-card-bg: rgba(20, 30, 45, 0.25);
  --contact-card-border: rgba(255, 255, 255, 0.05);
  --support-bg: rgba(20, 30, 45, 0.2);
  --support-border: rgba(255, 255, 255, 0.05);
  --section-bg: rgba(20, 30, 45, 0.15);
  --modal-overlay: rgba(0, 0, 0, 0.6);
  --accordion-bg: rgba(255, 255, 255, 0.04);
  --accordion-border: rgba(255, 255, 255, 0.06);
  --navbar-menu-bg: rgba(9, 12, 20, 0.97);
  --surface: rgba(20, 30, 45, 0.72);
  --surface-strong: #121a28;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 22px 50px rgba(0, 0, 0, 0.5);
  --tint: rgba(18, 186, 56, 0.1);
  --tint-border: rgba(74, 222, 128, 0.25);
  --skeleton: rgba(255, 255, 255, 0.06);
  --skeleton-shine: rgba(255, 255, 255, 0.08);
}

/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  transition: background 0.5s ease, color 0.5s ease;
  min-height: 100vh;
  position: relative;
}

/* Barra de scroll de marca */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }
/* Firefox no soporta ::-webkit-scrollbar; en Chrome, scrollbar-color anularía el estilo de arriba */
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-color: var(--primary) var(--bg-body); scrollbar-width: thin; }
}

/* ===== ACCESIBILIDAD ===== */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  background: var(--text-primary);
  color: var(--bg-body);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus { transform: none; }
main:focus { outline: none; }
/* Los teléfonos no se parten en dos renglones */
a[href^="tel:"] { white-space: nowrap; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--navbar-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--navbar-border);
  min-height: var(--nav-h);
  padding: 0.6rem calc(clamp(1rem, 3vw, 3rem) + var(--safe-right)) 0.6rem calc(clamp(1rem, 3vw, 3rem) + var(--safe-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.4s ease;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}
.navbar.scrolled {
  background: var(--navbar-bg);
  backdrop-filter: blur(24px) saturate(200%);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.logo-img {
  display: block;
  height: 40px;
  width: auto;
  transition: transform 0.3s, filter 0.3s;
}
.logo:hover .logo-img {
  filter: drop-shadow(0 0 12px rgba(18, 186, 56, 0.35));
}
@media (max-width: 480px) {
  .logo-img { height: 34px; }
}

.nav-links {
  display: flex;
  gap: 2.2rem;
  list-style: none;
  align-items: center;
}
/* Escritorio angosto (justo antes de que el menú se pliegue): menos aire para que quepan los 8 enlaces */
@media (min-width: 1025px) and (max-width: 1240px) {
  .nav-links { gap: 1.1rem; }
  .nav-actions .nav-cta { padding: 0.55rem 1.1rem; }
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  position: relative;
  transition: color 0.3s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 0.3s ease;
}
.nav-links a:hover {
  color: var(--text-primary);
}
.nav-links a:hover::after {
  width: 100%;
}
[data-theme="dark"] .nav-links a:hover {
  color: #fff;
}

.nav-cta {
  padding: 0.55rem 1.6rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 50px;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(18, 186, 56, 0.3);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(18, 186, 56, 0.5);
  color: #fff !important;
}
.nav-cta::after {
  display: none !important;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}
.nav-links .nav-links-cta {
  display: none;
}

.theme-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--primary);
  transform: rotate(25deg);
  border-color: var(--primary);
}

/* Selector de idioma (ES/EN): mismo tamaño táctil que el botón de tema */
.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.lang-switch:hover {
  color: var(--primary-text);
  border-color: var(--primary);
}
.lang-switch:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Sugerencia de idioma (primera visita con el navegador en el otro idioma) */
.lang-hint {
  position: fixed;
  left: calc(1rem + var(--safe-left, 0px));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 1100;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  max-width: min(440px, calc(100vw - 2rem));
  padding: 0.75rem 0.75rem 0.75rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  color: var(--text-primary);
  font-size: 0.9rem;
  animation: lang-hint-in 0.35s ease both;
}
.lang-hint p { margin: 0; flex: 1 1 180px; }
.lang-hint-go {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.lang-hint-go:focus-visible,
.lang-hint-close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.lang-hint-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
}
.lang-hint-close:hover { color: var(--text-primary); }
@keyframes lang-hint-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lang-hint { animation: none; }
}
/* En celulares deja libre la esquina del botón flotante de contacto */
@media (max-width: 480px) {
  .lang-hint { max-width: calc(100vw - 2rem - 72px); }
}

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 12px;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-secondary);
}
.hamburger:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Menú colapsado: tablets y celulares.
   .navbar tiene backdrop-filter, así que es el bloque contenedor del menú:
   se ancla con position:absolute justo debajo de la barra. */
@media (max-width: 1024px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    background: var(--navbar-menu-bg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem calc(1.5rem + var(--safe-right)) 1.5rem calc(1.5rem + var(--safe-left));
    border-bottom: 1px solid var(--navbar-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav-links li a {
    display: block;
    padding: 0.85rem 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.12);
  }
  .nav-links a::after {
    display: none;
  }
  .hamburger {
    display: inline-flex;
  }
}
@media (max-width: 480px) {
  .nav-actions .nav-cta {
    display: none;
  }
  .nav-links .nav-links-cta {
    display: block;
    margin-top: 1rem;
  }
  .nav-links .nav-links-cta a {
    display: flex;
    justify-content: center;
    padding: 0.85rem 1.6rem;
    font-size: 0.95rem;
    border-bottom: none;
  }
  .nav-actions {
    gap: 0.4rem;
  }
}

/* ===== FOOTER ===== */
.footer {
  /* El footer es oscuro en ambos temas: usa los verdes del modo oscuro */
  --primary-light: #4ade80;
  --primary-text: #4ade80;
  background: var(--footer-bg);
  backdrop-filter: blur(20px);
  color: var(--footer-text);
  padding: 3rem calc(var(--gutter) + var(--safe-right)) calc(1.5rem + var(--safe-bottom)) calc(var(--gutter) + var(--safe-left));
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.4s;
}
.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}
.footer-logo img {
  display: block;
  height: 52px;
  width: auto;
}
.footer-tagline {
  font-size: 0.9rem;
  color: var(--footer-text);
  max-width: 500px;
}
.footer-socials {
  display: flex;
  gap: 1rem;
  margin: 0.5rem 0;
}
/* El footer es oscuro en ambos temas: los iconos no usan los tokens de "vidrio" del tema
   (en modo claro son casi blancos y el icono claro desaparecía sobre ellos) */
.social-link {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e6edf3;
  text-decoration: none;
  font-size: 1.2rem;
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s;
}
.social-link:hover,
.social-link:focus-visible {
  border-color: #12ba38;
  background: #12ba38;
  color: #fff;
  transform: translateY(-3px);
}
.social-link:focus-visible {
  outline: 2px solid #4ade80;
  outline-offset: 2px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem clamp(1rem, 3vw, 2rem);
  margin: 1.5rem 0;
  list-style: none;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--footer-text);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s;
}
.footer-links a:hover {
  color: #fff;
}
.footer p {
  font-size: 0.85rem;
  color: var(--footer-text);
  text-align: center;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* El enlace de la página actual (por ejemplo, Blog) queda marcado en el menú */
.nav-links a[aria-current="page"] { color: var(--text-primary); }
.nav-links a[aria-current="page"]::after { width: 100%; }
@media (max-width: 1024px) {
  .nav-links a[aria-current="page"] { color: var(--primary-text); font-weight: 600; }
}
