/* ---------- Tokens ---------- */
:root {
  --bg: #EDEEF0;
  --bg-panel: #E2E4E8;
  --ink: #12161C;
  --ink-soft: #4A5361;
  --steel: #3D4B5C;
  --steel-dark: #1B2430;
  --accent: #FF5A1F;
  --accent-dark: #D6480F;
  --line: #C7CBD1;
  --line-dark: #2C3746;
  --white: #FFFFFF;

  --font-display: "Archivo Expanded", "Archivo", sans-serif;
  --font-head: "Archivo", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 700; margin: 0; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.btn-primary { background: var(--steel-dark); color: var(--white); }
.btn-primary:hover { background: var(--ink); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--steel-dark); border-color: var(--line-dark); }
.btn-ghost:hover { border-color: var(--steel-dark); }
.btn-white { background: var(--white); color: var(--steel-dark); }
.btn-white:hover { background: #E2E4E8; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--steel-dark);
}
.main-nav {
  display: flex;
  gap: 32px;
  margin-left: auto;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
}
.main-nav a { padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { border-bottom-color: var(--accent); }
.header-cta { margin-left: 24px; white-space: nowrap; }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(100deg, var(--steel-dark) 0%, var(--steel-dark) 42%, #0E141C 100%);
}
.hero-bg-art {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg-art svg { width: 100%; height: 100%; display: block; }
.hero-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, var(--steel-dark) 0%, var(--steel-dark) 28%, rgba(27,36,48,0.72) 48%, rgba(27,36,48,0) 72%);
}
.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
  padding: 96px 0 80px;
}
.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 15ch;
  color: var(--white);
}
.hero-lead {
  margin-top: 22px;
  max-width: 46ch;
  font-size: 1.08rem;
  color: #C6CCD6;
}
.hero-actions {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-stat {
  background: rgba(18,22,28,0.6);
  color: var(--white);
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-left: 6px solid var(--accent);
  backdrop-filter: blur(2px);
}
.stat-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  line-height: 1;
  color: var(--white);
}
.stat-plus { color: var(--accent); }
.stat-label {
  font-size: 0.98rem;
  color: #C6CCD6;
  max-width: 28ch;
}

/* ---------- Stats bar ---------- */
.stats-bar {
  background: var(--bg-panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 40px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat-item { display: flex; flex-direction: column; gap: 6px; }
.stat-item-number {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.9rem;
  color: var(--steel-dark);
}
.stat-item-label {
  font-size: 0.9rem;
  color: var(--ink-soft);
  max-width: 22ch;
}

/* ---------- Section head ---------- */
.section-head { max-width: 56ch; margin-bottom: 40px; }
.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.01em;
}
.section-head p {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

/* ---------- Categorías ---------- */
.categorias { padding: 84px 0; }
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.cat-card {
  background: var(--bg);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 130px;
  justify-content: flex-start;
  transition: background-color 150ms ease;
}
.cat-card:hover { background: var(--white); }
.cat-icon {
  width: 40px;
  height: 40px;
  color: var(--steel);
  transition: color 150ms ease;
}
.cat-icon svg { width: 100%; height: 100%; }
/* Si más adelante cambias el <svg> por una <img class="cat-icon">,
   esta regla la muestra bien recortada dentro del mismo espacio */
img.cat-icon { object-fit: contain; }
.cat-card:hover .cat-icon { color: var(--accent-dark); }
.cat-code {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--accent-dark);
  letter-spacing: 0.03em;
}
.cat-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}

/* ---------- Nosotros ---------- */
.nosotros { padding: 84px 0; background: var(--bg-panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.nosotros-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
}
.nosotros-copy h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  max-width: 18ch;
}
.nosotros-copy p {
  margin-top: 18px;
  color: var(--ink-soft);
  max-width: 52ch;
}
.value-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}
.value-list li {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.value-title { font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--steel-dark); }
.value-desc { font-size: 0.94rem; color: var(--ink-soft); }

/* ---------- Sedes ---------- */
.sedes { padding: 84px 0; }
.sedes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.sede-card {
  border-top: 3px solid var(--accent);
  background: var(--bg-panel);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sede-city { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }
.sede-address { font-size: 0.92rem; color: var(--ink-soft); }
.sede-hours { font-size: 0.82rem; color: var(--steel); }

/* ---------- Contacto ---------- */
.contacto {
  padding: 84px 0;
  background: var(--steel-dark);
  color: var(--white);
}
.contacto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.contacto-copy h2 {
  color: var(--white);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  max-width: 20ch;
}
.contacto-copy p {
  margin-top: 18px;
  color: #C6CCD6;
  max-width: 44ch;
}
.contacto-copy .btn { margin-top: 28px; }

.contacto-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.contacto-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  font-family: var(--font-head);
  font-weight: 600;
  color: #C6CCD6;
}
.contacto-form input,
.contacto-form textarea {
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 12px 14px;
  background: #24303F;
  border: 1px solid #3D4B5C;
  color: var(--white);
  resize: vertical;
}
.contacto-form input::placeholder,
.contacto-form textarea::placeholder { color: #7C8899; }
.contacto-form input:focus,
.contacto-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-submit { margin-top: 6px; align-self: flex-start; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #A8AEB6; padding: 56px 0 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 44px;
  border-bottom: 1px solid #2A2F37;
}
.footer-brand { display: flex; flex-direction: column; gap: 14px; }
.logo-footer { color: var(--white); }
.footer-brand p { max-width: 34ch; font-size: 0.9rem; }
.footer-col { display: flex; flex-direction: column; gap: 10px; font-size: 0.92rem; }
.footer-heading { font-family: var(--font-head); font-weight: 700; color: var(--white); margin-bottom: 4px; }
.footer-bottom {
  padding: 22px 0;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
}

/* ---------- WhatsApp flotante ---------- */
.whatsapp-float {
  position: fixed;
  display: flex;
  align-items: center;
  gap: 12px;
  right: 24px;
  bottom: 24px;
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  background: #25D366;
  padding: 10px 22px 10px 10px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.32);
  animation: wa-pulse 2.4s ease-out infinite, wa-bounce 4.5s ease-in-out infinite;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.whatsapp-float:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 30px rgba(0,0,0,0.38);
}
.whatsapp-float-icon {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.whatsapp-float-icon svg { width: 100%; height: 100%; display: block; }
.whatsapp-float-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
}
.whatsapp-float-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  color: var(--white);
  font-family: var(--font-head);
  font-size: 0.86rem;
  white-space: nowrap;
}
.whatsapp-float-text strong { font-weight: 700; font-size: 0.9rem; }
.whatsapp-float-text-short { display: none; font-weight: 700; font-size: 0.84rem; }

@keyframes wa-pulse {
  0%   { box-shadow: 0 10px 24px rgba(0,0,0,0.32), 0 0 0 0 rgba(37,211,102,0.5); }
  70%  { box-shadow: 0 10px 24px rgba(0,0,0,0.32), 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 10px 24px rgba(0,0,0,0.32), 0 0 0 0 rgba(37,211,102,0); }
}
@keyframes wa-bounce {
  0%, 85%, 100% { transform: translateY(0); }
  90% { transform: translateY(-6px); }
  95% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-float { animation: none; }
}

@media (max-width: 640px) {
  .whatsapp-float {
    padding: 9px 18px 9px 9px;
    gap: 9px;
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .whatsapp-float-text-full { display: none; }
  .whatsapp-float-text-short { display: block; }
  .whatsapp-float-icon { width: 36px; height: 36px; }
}

/* ---------- Nav toggle (mobile) ---------- */
.nav-toggle {
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--steel-dark);
}

/* ---------- Responsive ---------- */

/* Tablets grandes / pantallas medianas: apilar hero y ajustar grids a 2 columnas */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stat { max-width: 480px; }
  .nosotros-grid { grid-template-columns: 1fr; gap: 40px; }
  .contacto-grid { grid-template-columns: 1fr; gap: 40px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .sedes-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: span 2; }

  /* con el hero apilado, la ilustración pasa a ser un fondo sutil
     detrás de todo el bloque, no solo de la mitad derecha */
  .hero-bg-art { opacity: 0.45; }
  .hero-fade { background: linear-gradient(180deg, rgba(19,24,31,0.78) 0%, var(--steel-dark) 60%); }
}

/* Tablets / pantallas pequeñas: menú hamburguesa (antes de que la nav se apriete) */
@media (max-width: 900px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 28px 20px;
    box-shadow: 0 12px 20px -12px rgba(0,0,0,0.2);
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .header-cta { display: none; }
  .nav-toggle { display: flex; }
}

/* Móviles: una sola columna en todas las cuadrículas */
@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .categorias, .nosotros, .sedes, .contacto { padding: 56px 0; }
  .hero-grid { padding: 64px 0 48px; gap: 32px; }
  .section-head { margin-bottom: 28px; }

  .cat-grid { grid-template-columns: 1fr; }
  .sedes-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
  .footer-bottom { flex-direction: column; gap: 6px; }

  .hero-stat { padding: 30px 24px; max-width: 100%; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .contacto-copy .btn { width: 100%; }
}

/* Móviles pequeños */
@media (max-width: 400px) {
  .wrap { padding: 0 16px; }
  .logo { font-size: 1.1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
  .stat-number { font-size: clamp(2.2rem, 12vw, 2.8rem); }
  .cat-card { padding: 24px 18px; }
  .sede-card { padding: 20px 18px; }
}

