/* ==========================================================================
   MÁQUINAS ERGISA PERÚ EIRL — DESIGN SYSTEM: "CLINICAL LUXURY & PRECISION"
   Inspiración de $10,000 USD: Apple Pro, Siemens Healthineers, Stryker & Miele Pro
   Arquitectura de Información Impecable, Whitespace Equilibrado, Cero Desorden
   ========================================================================== */

:root {
  /* Fondos Prístinos */
  --bg-pure: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-surface: #f1f5f9;
  --bg-card: #ffffff;
  --bg-dark-hero: #080e1a;
  --bg-dark-card: #0f172a;
  --bg-glass: rgba(255, 255, 255, 0.94);
  --bg-glass-dark: rgba(15, 23, 42, 0.78);

  /* Acentos Sanitarios & Ingeniería */
  --clinical-teal: #0d9488;        /* Menta / Quirúrgico Maison de Santé */
  --clinical-teal-hover: #0f766e;
  --clinical-teal-light: #f0fdfa;
  --clinical-teal-border: #99f6e4;
  --clinical-teal-glow: rgba(13, 148, 136, 0.35);

  --steam-blue: #0284c7;          /* Azul Zafiro Técnico */
  --steam-blue-hover: #0369a1;
  --steam-blue-light: #f0f9ff;
  --steam-blue-border: #bae6fd;
  --steam-blue-glow: rgba(2, 132, 199, 0.35);

  --accent-amber: #d97706;        /* Ámbar térmico suave */
  --accent-amber-light: #fef3c7;
  --accent-emerald: #10b981;

  --primary: #0284c7;             /* Variable estándar para componentes y filtros */
  --primary-hover: #0369a1;

  /* Acero Inoxidable Pulido */
  --steel-border: #e2e8f0;
  --steel-border-light: #f1f5f9;
  --steel-border-interactive: #94a3b8; /* Ratio 3.03:1 para límites UI */
  --steel-sheen: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);

  /* WCAG 2.1 AA — Acentos de Alto Contraste (>= 4.5:1) */
  --clinical-teal-text: #0f766e;     /* Ratio 4.54:1 sobre #ffffff */
  --clinical-teal-deep: #115e59;     /* Ratio 6.78:1 sobre #ffffff */
  --steam-blue-text: #0369a1;        /* Ratio 5.76:1 sobre #ffffff */
  --accent-amber-text: #92400e;      /* Ratio 6.22:1 sobre #ffffff */
  --accent-green-text: #15803d;      /* Ratio 4.52:1 sobre #ffffff */
  --whatsapp-btn-text: #052e16;      /* Ratio 9.20:1 sobre #25d366 (Máxima legibilidad AAA) */

  /* Tipografía Esculpida */
  --text-primary: #0f172a;        /* Slate oscuro profundo, máxima legibilidad */
  --text-secondary: #334155;      /* Slate corporativo */
  --text-muted: #64748b;          /* Gris técnico equilibrado */
  --text-dim: #94a3b8;
  --text-white: #ffffff;

  /* Sombras y Luces Suaves */
  --shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 10px 30px -4px rgba(10, 25, 47, 0.06);
  --shadow-elevated: 0 20px 45px -8px rgba(10, 25, 47, 0.1);
  --shadow-hover: 0 25px 60px -10px rgba(2, 132, 199, 0.15);
  --shadow-glow-teal: 0 0 30px rgba(13, 148, 136, 0.3);

  /* Bordes & Geometría */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 9999px;
  --max-width: 1220px;

  /* Animaciones */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.18s var(--ease-spring);
  --transition-normal: 0.3s var(--ease-spring);
}

/* Reset Universal */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-pure);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-pure);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ==========================================================================
   WCAG 2.4.1 — ENLACE DE SALTO AL CONTENIDO PRINCIPAL (SKIP LINK)
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  background: #0f172a;
  color: #ffffff;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-xs);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
}

/* ==========================================================================
   WCAG 2.4.7 & 2.4.11 — ESTADOS DE FOCO VISIBLE (:focus-visible)
   ========================================================================== */
:focus-visible {
  outline: 3px solid var(--steam-blue);
  outline-offset: 3px;
}

.hero-cinematic :focus-visible,
.hero-industrial-v2 :focus-visible,
.video-feature-card :focus-visible,
.cta-master-card :focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 3px;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2.4rem, 4.8vw, 3.9rem); }
h2 { font-size: clamp(1.85rem, 3.2vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.65rem); }
h4 { font-size: 1.1rem; font-weight: 700; }

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.65;
}

a {
  color: var(--steam-blue);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--clinical-teal);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Topbar Superior Limpia */
.topbar-clean {
  background: #ffffff;
  border-bottom: 1px solid var(--steel-border);
  font-size: 0.8125rem;
  padding: 0.45rem 0;
  color: var(--text-muted);
}

.topbar-clean .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pulse-teal {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--clinical-teal);
  box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.7);
  animation: pulseTeal 2.2s infinite;
}

@keyframes pulseTeal {
  0% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(13, 148, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0); }
}

/* Navbar Ultra Elegante (Solución Definitiva al Desorden de Líneas) */
.navbar-clean {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--steel-border);
  height: 72px;
  display: flex;
  align-items: center;
}

.navbar-clean .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand-clean {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 42px;
  width: auto;
  display: block;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-heading {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-transform: uppercase;
}

.brand-subheading {
  font-size: 0.65rem;
  color: var(--clinical-teal);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Enlaces del Menú en una Sola Línea (No Wraps) */
.nav-links-clean {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link-item {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.4rem 0.2rem;
  position: relative;
  transition: var(--transition-fast);
}

.nav-link-item:hover {
  color: var(--steam-blue);
}

.nav-link-item::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--clinical-teal);
  border-radius: 2px;
  transition: var(--transition-normal);
}

.nav-link-item:hover::after {
  width: 100%;
}

/* ==========================================================================
   DRAWER MÓVIL Y ACCIONES DE NAVEGACIÓN
   ========================================================================== */
.nav-actions-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-menu-trigger {
  display: none;
  background: transparent;
  border: 1.5px solid var(--steel-border);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  transition: background var(--transition-fast);
}

.mobile-menu-trigger:hover {
  background: var(--bg-surface);
}

.hamburger-bar {
  width: 22px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-menu-trigger[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.mobile-menu-trigger[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
}
.mobile-menu-trigger[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Drawer Lateral / Overlay para Móvil */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 26, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: #ffffff;
  z-index: 1600;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  transition: right 0.35s var(--ease-spring);
  overflow-y: auto;
}

.mobile-nav-drawer.active {
  right: 0;
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--steel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-brand {
  display: flex;
  flex-direction: column;
}

.drawer-brand span {
  font-size: 0.7rem;
  color: var(--clinical-teal);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drawer-close-btn {
  background: var(--bg-surface);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
}

.drawer-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.drawer-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.drawer-link:hover, .drawer-link.active {
  background: var(--clinical-teal-light);
  color: var(--clinical-teal-deep);
}

.drawer-chip-badge {
  background: var(--steam-blue);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-weight: 800;
}

.drawer-footer-card {
  background: var(--bg-dark-card);
  color: #fff;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-top: 2rem;
}

.drawer-support-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.drawer-phone {
  font-size: 1.15rem;
  font-weight: 900;
  color: #2dd4bf;
  margin: 0.35rem 0;
}

.drawer-meta {
  font-size: 0.75rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.btn-drawer-whatsapp {
  display: block;
  text-align: center;
  background: #25d366;
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

/* Botones Prístinos de Lujo */
.btn-clean {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-clean svg {
  flex-shrink: 0;
}

.btn-primary-clean {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

.btn-primary-clean:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
  color: #ffffff;
}

.btn-whatsapp-clean {
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

.btn-whatsapp-clean:hover {
  background: #1eb956;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  color: #ffffff;
}

.btn-whatsapp-glow {
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 0 25px rgba(37, 211, 102, 0.45), 0 4px 14px rgba(0, 0, 0, 0.2);
  font-size: 0.95rem;
  padding: 0.85rem 1.8rem;
}

.btn-whatsapp-glow:hover {
  background: #1eb956;
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(37, 211, 102, 0.65), 0 6px 20px rgba(0, 0, 0, 0.3);
  color: #ffffff;
}

.btn-glass-hero {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
}

.btn-glass-hero:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-secondary-clean {
  background: #ffffff;
  color: var(--text-primary);
  border: 1.5px solid var(--steel-border);
}

.btn-secondary-clean:hover {
  border-color: var(--steam-blue);
  color: var(--steam-blue);
  background: var(--bg-subtle);
}

/* Badges Delicados */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pill-teal {
  background: var(--clinical-teal-light);
  color: var(--clinical-teal);
  border: 1px solid var(--clinical-teal-border);
}

.pill-blue {
  background: var(--steam-blue-light);
  color: var(--steam-blue);
  border: 1px solid var(--steam-blue-border);
}

.pill-amber {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  border: 1px solid #fde68a;
}

.pill-glow-teal {
  background: rgba(13, 148, 136, 0.18);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.45);
  box-shadow: 0 0 20px rgba(13, 148, 136, 0.25);
}

/* Secciones y Espaciado Generoso */
.section-clean {
  padding: 5.5rem 0;
  position: relative;
}

.section-clean-alt {
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--steel-border);
  border-bottom: 1px solid var(--steel-border);
}

.section-header-clean {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 3.5rem auto;
}

.section-tag-clean {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--clinical-teal);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.65rem;
}

.section-header-clean h2 {
  margin-bottom: 1rem;
}

.section-header-clean p {
  font-size: 1.15rem;
  color: var(--text-muted);
}

/* Footer Minimalista */
.footer-clean {
  background: #ffffff;
  border-top: 1px solid var(--steel-border);
  padding: 4.5rem 0 2rem 0;
  color: var(--text-muted);
}

.footer-clean-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-clean-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--steel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}

/* Floating WhatsApp */
.floating-whatsapp-clean {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  right: 1.5rem;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #25d366;
  color: #ffffff;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition-normal);
}

.floating-whatsapp-clean:hover {
  background: #1eb956;
  transform: translateY(-3px) scale(1.02);
  color: #ffffff;
}

.floating-whatsapp-clean svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* ==========================================================================
   WCAG 2.2.2 & 2.3.3 — SOPORTE PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .pulse-teal,
  .status-pulse-dot {
    animation: none !important;
  }

  .hero-video-player,
  .hero-bg-video {
    display: none !important;
  }
}
