/* ============================================================
   CAIMED S.A. — Rediseño premium medical-tech
   Paleta: rojo de marca como acento, grises + blanco.
   ============================================================ */

/* ---------- Tipografía (Google Fonts) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sora:wght@500;600;700;800&display=swap');

/* ---------- Variables ---------- */
:root {
  --rojo: #e60000;
  --rojo-osc: #c40000;
  --rojo-suave: #fdecec;

  --tinta: #1a1d21;      /* texto fuerte / títulos */
  --gris-txt: #5a6068;   /* texto secundario */
  --linea: #e8eaed;      /* bordes finos */
  --fondo: #f6f7f9;      /* secciones alternadas */
  --blanco: #ffffff;

  --display: 'Sora', sans-serif;
  --body: 'Inter', sans-serif;

  --sombra-sm: 0 1px 3px rgba(26,29,33,0.06), 0 1px 2px rgba(26,29,33,0.04);
  --sombra-md: 0 8px 24px rgba(26,29,33,0.08);
  --sombra-lg: 0 18px 50px rgba(26,29,33,0.12);

  --radio: 16px;
  --radio-sm: 10px;
  --max: 1180px;
  --nav-h: 72px;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 10px); }

body {
  font-family: var(--body);
  background-color: var(--blanco);
  color: var(--tinta);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--display); line-height: 1.15; letter-spacing: -0.02em; }

/* Marcador rojo fino: detalle de marca para encabezados */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rojo);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--rojo);
}

/* ============================================================
   NAVEGACIÓN
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-h);
  background-color: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 48px);
  transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.nav.scrolled {
  border-bottom-color: var(--linea);
  box-shadow: var(--sombra-sm);
}

.nav .logo {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--tinta);
  text-decoration: none;
}
.nav .logo span { color: var(--rojo); }

.nav ul { display: flex; list-style: none; align-items: center; gap: 8px; }

.nav ul li a {
  position: relative;
  text-decoration: none;
  color: var(--gris-txt);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.25s, background-color 0.25s;
}
.nav ul li a:hover { color: var(--tinta); background-color: var(--fondo); }

/* Botón "Contacto" destacado en el nav */
.nav ul li a.nav-cta {
  background: var(--rojo);
  color: #fff;
  padding: 9px 18px;
}
.nav ul li a.nav-cta:hover { background: var(--rojo-osc); color: #fff; }

.menu-toggle {
  display: none;
  font-size: 26px;
  color: var(--tinta);
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  margin-top: var(--nav-h);
  padding: clamp(60px, 9vw, 110px) clamp(20px, 5vw, 48px) clamp(60px, 8vw, 90px);
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(230,0,0,0.06), transparent 55%),
    linear-gradient(180deg, #fbfbfc 0%, var(--blanco) 100%);
  position: relative;
  overflow: hidden;
}
/* Grilla técnica de fondo, muy sutil */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--linea) 1px, transparent 1px),
    linear-gradient(90deg, var(--linea) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.4;
  -webkit-mask-image: radial-gradient(80% 70% at 70% 30%, #000, transparent 80%);
  mask-image: radial-gradient(80% 70% at 70% 30%, #000, transparent 80%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.hero-logo { width: 64px; margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  color: var(--tinta);
  margin-bottom: 20px;
}
.hero h1 .acento { color: var(--rojo); }
.hero p.lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--gris-txt);
  max-width: 540px;
  margin-bottom: 32px;
}
.hero-acciones { display: flex; flex-wrap: wrap; gap: 14px; }

/* Tarjeta visual del hero */
.hero-visual {
  position: relative;
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra-lg);
  aspect-ratio: 4 / 3.4;
  background: var(--fondo);
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual .placa {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--linea);
  border-radius: var(--radio-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--sombra-sm);
}
.hero-visual .placa .punto {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rojo);
  box-shadow: 0 0 0 4px var(--rojo-suave);
  flex-shrink: 0;
}
.hero-visual .placa b { font-family: var(--display); font-size: 0.95rem; }
.hero-visual .placa small { color: var(--gris-txt); font-size: 0.82rem; display: block; }

/* Franja de métricas / confianza bajo el hero */
.metrica-franja {
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--linea);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  overflow: hidden;
  margin-top: clamp(40px, 6vw, 64px);
}
.metrica {
  background: var(--blanco);
  padding: 26px 22px;
  text-align: center;
}
.metrica .num {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--tinta);
}
.metrica .num span { color: var(--rojo); }
.metrica .etq { font-size: 0.85rem; color: var(--gris-txt); margin-top: 4px; }

/* ============================================================
   SECCIONES GENÉRICAS
   ============================================================ */
.seccion {
  padding: clamp(56px, 8vw, 96px) clamp(20px, 5vw, 48px);
}
.seccion.alt { background: var(--fondo); }
.seccion-inner { max-width: var(--max); margin: 0 auto; }

.seccion-cabecera { max-width: 680px; margin-bottom: clamp(36px, 5vw, 54px); }
.seccion-cabecera h2 {
  font-size: clamp(1.9rem, 3.3vw, 2.6rem);
  font-weight: 700;
  color: var(--tinta);
  margin-bottom: 16px;
}
.seccion-cabecera p { color: var(--gris-txt); font-size: 1.08rem; }

/* Bloque "¿Quiénes somos?" en dos columnas */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.split-texto p { color: var(--gris-txt); font-size: 1.05rem; margin-bottom: 18px; }
.split-img {
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra-md);
  border: 1px solid var(--linea);
}
.split-img img { width: 100%; height: 100%; object-fit: cover; }

/* Lista de coberturas / chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.chip {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--tinta);
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 999px;
  padding: 7px 14px;
}
.seccion.alt .chip { background: var(--blanco); }

/* ============================================================
   BOTONES
   ============================================================ */
.boton-rojo,
.boton-fantasma {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.97rem;
  padding: 13px 24px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s, background-color 0.25s, box-shadow 0.25s, color 0.25s;
}
.boton-rojo { background-color: var(--rojo); color: #fff; box-shadow: 0 6px 18px rgba(230,0,0,0.22); }
.boton-rojo:hover { background-color: var(--rojo-osc); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(230,0,0,0.3); }

.boton-fantasma { background: transparent; color: var(--tinta); border-color: var(--linea); }
.boton-fantasma:hover { border-color: var(--tinta); transform: translateY(-2px); }

.boton-rojo .flecha { transition: transform 0.25s; }
.boton-rojo:hover .flecha { transform: translateX(4px); }

/* ============================================================
   GALERÍA DE ESPECIALIDADES
   ============================================================ */
.especialidades-galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 26px;
  margin: 0 auto;
}
.especialidad-card {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sombra-sm);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.especialidad-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--sombra-lg);
  border-color: transparent;
}
.especialidad-card .img-wrap { overflow: hidden; aspect-ratio: 16 / 10; background: var(--fondo); }
.especialidad-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.especialidad-card:hover img { transform: scale(1.06); }
.especialidad-card .card-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.especialidad-card h3 { font-size: 1.25rem; font-weight: 700; color: var(--tinta); }
.especialidad-card p { font-size: 0.92rem; color: var(--gris-txt); flex: 1; }
.especialidad-card .ver {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--rojo); font-weight: 600; font-size: 0.95rem; text-decoration: none;
  margin-top: auto;
}
.especialidad-card .ver .flecha { transition: transform 0.25s; }
.especialidad-card:hover .ver .flecha { transform: translateX(4px); }

/* ============================================================
   GALERÍA DE PRODUCTOS (dentro de cada especialidad)
   ============================================================ */
.productos-galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin: 0 auto;
}
.producto {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--sombra-sm);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}
.producto::after {
  content: "";
  position: absolute;
  left: 0; top: 0;
  height: 3px; width: 0;
  background: var(--rojo);
  transition: width 0.35s ease;
}
.producto:hover { transform: translateY(-5px); box-shadow: var(--sombra-lg); border-color: transparent; }
.producto:hover::after { width: 100%; }
.producto .icono {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--rojo-suave);
  display: flex; align-items: center; justify-content: center;
  color: var(--rojo);
}
.producto .icono svg { width: 24px; height: 24px; }
.producto h3 { font-size: 1.18rem; font-weight: 700; color: var(--tinta); }
.producto h3.largo { font-size: 1.1rem; line-height: 1.25; }
.producto .ver {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--rojo); font-weight: 600; font-size: 0.93rem; text-decoration: none;
}
.producto .ver .flecha { transition: transform 0.25s; }
.producto:hover .ver .flecha { transform: translateX(4px); }

.volver-contenedor { text-align: center; margin-top: clamp(40px, 6vw, 60px); }

/* ============================================================
   FICHA DE PRODUCTO (detalle)
   ============================================================ */
.ficha-producto {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(32px, 5vw, 60px);
  align-items: start;
}
.imagen-producto {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  border-radius: var(--radio);
  overflow: hidden;
  border: 1px solid var(--linea);
  background: var(--fondo);
  box-shadow: var(--sombra-md);
}
.imagen-producto img { width: 100%; height: auto; object-fit: contain; transition: transform 0.5s ease; }
.imagen-producto:hover img { transform: scale(1.04); }

.info-producto h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--tinta);
  margin: 28px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--linea);
}
.info-producto h2:first-child { margin-top: 0; }
.info-producto p { color: var(--gris-txt); font-size: 1.04rem; margin-bottom: 8px; }
.info-producto strong { color: var(--tinta); font-weight: 600; }

.info-producto ul { list-style: none; display: grid; gap: 10px; margin-bottom: 8px; }
.info-producto ul li {
  position: relative;
  padding-left: 28px;
  color: var(--gris-txt);
}
.info-producto ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 14px; height: 14px;
  border-radius: 4px;
  background: var(--rojo-suave);
  border: 1.5px solid var(--rojo);
}
.info-producto ul li::after {
  content: "";
  position: absolute;
  left: 5px; top: 12px;
  width: 4px; height: 7px;
  border-right: 2px solid var(--rojo);
  border-bottom: 2px solid var(--rojo);
  transform: rotate(45deg);
}
.info-producto .boton-fantasma { margin-top: 26px; }

/* Encabezado de página interna (especialidades / detalle) */
.page-head {
  margin-top: var(--nav-h);
  padding: clamp(44px, 6vw, 72px) clamp(20px, 5vw, 48px) clamp(36px, 5vw, 52px);
  background:
    radial-gradient(110% 120% at 90% 0%, rgba(230,0,0,0.05), transparent 55%),
    var(--fondo);
  border-bottom: 1px solid var(--linea);
}
.page-head-inner { max-width: var(--max); margin: 0 auto; }
.page-head .ruta { font-size: 0.85rem; color: var(--gris-txt); margin-bottom: 14px; }
.page-head .ruta a { color: var(--gris-txt); text-decoration: none; }
.page-head .ruta a:hover { color: var(--rojo); }
.page-head h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; color: var(--tinta); }
.page-head p { color: var(--gris-txt); font-size: 1.08rem; margin-top: 12px; max-width: 620px; }

/* ============================================================
   CONTACTO
   ============================================================ */
.contacto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.contacto-item {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 28px 24px;
  box-shadow: var(--sombra-sm);
  transition: transform 0.3s, box-shadow 0.3s;
}
.contacto-item:hover { transform: translateY(-4px); box-shadow: var(--sombra-md); }
.contacto-item .icono {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--rojo-suave); color: var(--rojo);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.contacto-item .icono svg { width: 24px; height: 24px; }
.contacto-item h4 { font-family: var(--display); font-size: 0.95rem; color: var(--gris-txt); font-weight: 600; margin-bottom: 4px; }
.contacto-item a, .contacto-item span { color: var(--tinta); text-decoration: none; font-weight: 500; }
.contacto-item a:hover { color: var(--rojo); }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--tinta);
  color: rgba(255,255,255,0.7);
  margin-top: auto;
  padding: clamp(40px, 5vw, 56px) clamp(20px, 5vw, 48px) 28px;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.footer-inner .marca { font-family: var(--display); font-size: 1.3rem; font-weight: 800; color: #fff; }
.footer-inner .marca span { color: var(--rojo); }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-base {
  max-width: var(--max);
  margin: 28px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.85rem;
  text-align: center;
}

/* ============================================================
   ANIMACIONES — scroll reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
/* retardos escalonados para grillas */
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

/* Aparición del hero al cargar */
@keyframes subirSuave {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-texto > * { animation: subirSuave 0.8s ease both; }
.hero-texto > *:nth-child(1) { animation-delay: 0.05s; }
.hero-texto > *:nth-child(2) { animation-delay: 0.15s; }
.hero-texto > *:nth-child(3) { animation-delay: 0.25s; }
.hero-texto > *:nth-child(4) { animation-delay: 0.35s; }
.hero-visual { animation: subirSuave 0.9s ease 0.3s both; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { max-width: 520px; }
  .split { grid-template-columns: 1fr; }
  .ficha-producto { grid-template-columns: 1fr; }
  .imagen-producto { position: static; max-width: 460px; margin: 0 auto; }
  .contacto-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .nav ul {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--blanco);
    border-bottom: 1px solid var(--linea);
    padding: 12px 20px 18px;
    box-shadow: var(--sombra-md);
    display: none;
  }
  .nav ul.active { display: flex; animation: subirSuave 0.3s ease both; }
  .nav ul li a { padding: 12px 14px; }
  .nav ul li a.nav-cta { text-align: center; justify-content: center; }

  .metrica-franja { grid-template-columns: repeat(2, 1fr); }

  .info-producto p, .info-producto ul li { text-align: left; }
}

@media (max-width: 420px) {
  .metrica-franja { grid-template-columns: 1fr 1fr; }
}

/* Accesibilidad: respetar reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* Foco visible para teclado */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--rojo);
  outline-offset: 3px;
  border-radius: 4px;
}