/* ==========================================================================
   EIA-german — Hoja de estilos base
   Enfoque: mobile-first (pensado para Samsung Fold5: 344px plegado / 717px
   desplegado en adelante) escalando hasta escritorio.
   ========================================================================== */

/* -------------------- Variables globales -------------------- */
:root {
  /* Color */
  --color-bg: #f4f4f5;
  --color-card: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #5a5a5e;
  --color-accent: #cf070f;
  --color-accent-dark: #a30509;
  --color-border: rgba(0, 0, 0, 0.07);

  /* Tipografía */
  --font-base: "Poppins", "Segoe UI", sans-serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;

  /* Radios */
  --radius-card: 28px;
  --radius-img: 24px;
  --radius-pill: 999px;

  /* Layout */
  --container-width: 1160px;
  --header-height: 76px;
  --gap: 24px;

  /* Sombra sutil (solo donde aporta profundidad real) */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* -------------------- Reset básico -------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  font-weight: var(--fw-light);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

h1, h2, h3 {
  font-weight: var(--fw-medium);
  line-height: 1.25;
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------- Utilidades de layout -------------------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 20px;
}

.section {
  padding-block: clamp(40px, 6vw, 88px);
}

/* Rejilla de tarjetas: 1 col en móvil plegado, 2 al desplegar el Fold5 / tablet,
   3 en escritorio. */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* -------------------- Componente: tarjeta -------------------- */
.card {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 3vw, 32px);
}

.card img {
  border-radius: var(--radius-img);
  overflow: hidden;
  margin-bottom: 16px;
}

/* -------------------- Componente: botón / CTA -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: var(--fw-medium);
  font-size: 0.95rem;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--color-accent-dark);
}

.btn-primary:active {
  transform: scale(0.97);
}

/* Foco visible para navegación por teclado */
.btn:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Botón de llamada flotante — solo visible en móvil plegado */
.btn-call-floating {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  box-shadow: 0 4px 14px rgba(207, 7, 15, 0.35);
}

@media (min-width: 700px) {
  .btn-call-floating {
    display: none;
  }
}

/* ==========================================================================
   CABECERA
   Por debajo de 700px (Fold5 plegado y móviles normales): logo + hamburguesa.
   A partir de 700px (Fold5 desplegado y en adelante): menú horizontal completo.
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
}

.logo img {
  height: 48px;
  width: auto;
}

/* Navegación principal: oculta en móvil, visible en escritorio */
.main-nav {
  display: none;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Refuerzo del espaciado (además de gap) por si el navegador es muy antiguo */
.main-nav li:not(:last-child) {
  margin-right: 32px;
}

@supports (gap: 1px) {
  .main-nav li:not(:last-child) {
    margin-right: 0;
  }
}

.main-nav a {
  font-weight: var(--fw-medium);
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--color-accent);
}

/* Botón hamburguesa: visible solo en móvil.
   Las 3 líneas se posicionan de forma absoluta dentro del botón en vez de
   con flexbox anidado: es la técnica más compatible entre navegadores. */
.nav-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.nav-toggle span {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: var(--radius-pill);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 19px; }
.nav-toggle span:nth-child(3) { top: 24px; }

/* Estado abierto del menú móvil (clase añadida por JS) */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 19px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 19px;
  transform: rotate(-45deg);
}

/* Panel de navegación móvil (desplegable) */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding-block: 12px 20px;
  border-top: 1px solid var(--color-border);
}

.mobile-nav.is-open {
  display: flex;
}

.mobile-nav a {
  padding: 12px 4px;
  font-weight: var(--fw-medium);
  border-radius: 12px;
}

.mobile-nav a:hover {
  background-color: var(--color-card);
}

/* -------------------- Breakpoint: Fold5 desplegado / tablet+ -------------------- */
@media (min-width: 700px) {
  .main-nav {
    display: block;
  }

  .nav-toggle,
  .mobile-nav {
    display: none !important;
  }

  .logo img {
    height: 56px;
  }
}

/* -------------------- Breakpoint: escritorio -------------------- */
@media (min-width: 1024px) {
  :root {
    --header-height: 88px;
  }

  .logo img {
    height: 64px;
  }
}
