:root {
  --primary: #0046a8;        /* Azul rey principal del logo */
  --primary-dark: #00337d;   /* Azul más oscuro al pasar el mouse */
  --accent: #0077b6;         /* Azul cerúleo de los puntos del isotipo */
  --navy: #1c2f4f;           /* Azul pizarra oscuro para títulos y fondos */
  --text: #1e293b;           /* Texto principal */
  --text-muted: #475569;     /* Texto secundario */
  --bg-light: #f4f7fb;       /* Fondo gris azulado clínico */
  --white: #ffffff;
  --border: #dce4f0;
  --whatsapp: #16a34a;
  --radius: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  overflow-x: clip;
}

img {
  max-width: 100%;
}

.container {
  width: 90%;
  max-width: 1180px;
  margin: 0 auto;
}

/* NAVEGACIÓN INTERACTIVA */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(28, 47, 79, 0.05);
  z-index: 1000;
  transition: box-shadow 0.25s ease, background 0.25s ease;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(28, 47, 79, 0.1);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
  transition: height 0.25s ease;
}

.navbar.scrolled .nav-container {
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.02);
}

.logo-img {
  height: 54px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: height 0.25s ease;
}

.navbar.scrolled .logo-img {
  height: 46px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links a:not(.btn) {
  position: relative;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

/* Línea inferior animada */
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 0;
  height: 2.5px;
  background: var(--primary);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-links a:not(.btn):hover,
.nav-links a:not(.btn).active {
  color: var(--primary);
  background-color: rgba(0, 70, 168, 0.07);
}

.nav-links a:not(.btn):hover::after,
.nav-links a:not(.btn).active::after {
  width: 65%;
}

/* Botón Cotizar dentro del menú */
.nav-links .btn {
  margin-left: 10px;
  box-shadow: 0 4px 12px rgba(0, 70, 168, 0.2);
}

.nav-links .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 70, 168, 0.3);
}

/* Botón hamburguesa con animación a X */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.menu-toggle span {
  width: 26px;
  height: 3px;
  background: var(--navy);
  border-radius: 2px;
  display: block;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Evita que el menú tape el título al hacer clic en un enlace */
section[id] {
  scroll-margin-top: 76px;
}

/* BOTONES */
.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: var(--white) !important;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  border-color: var(--navy);
  color: var(--navy);
  background: transparent;
}

.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.9rem;
}

.btn-full {
  width: 100%;
}

/* HERO */
.hero {
  padding: 72px 0 84px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.badge {
  display: inline-block;
  background: #e0f2fe;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 6px 14px;
  border-radius: 50px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(1.85rem, 3.6vw, 2.7rem);
  line-height: 1.15;
  color: var(--navy);
  margin-bottom: 18px;
  font-weight: 800;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 22px;
}

.spec-item strong {
  display: block;
  color: var(--navy);
  font-size: 1.02rem;
}

.spec-item span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  max-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  box-shadow: 0 20px 40px rgba(28, 47, 79, 0.16);
}

/* SECCIONES */
.section {
  padding: 80px 0;
}

.bg-light {
  background: var(--bg-light);
}

.bg-dark {
  background: var(--navy);
  color: var(--white);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}

.section-tag {
  display: inline-block;
  color: var(--primary);
  font-weight: 700;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--navy);
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-muted);
}

.section-header.light h2,
.section-header.light p {
  color: var(--white);
}

.section-header.light p {
  opacity: 0.85;
}

/* TARJETAS DE INGENIERÍA */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.feature-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}

.feature-card h3 {
  color: var(--navy);
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* FILTROS Y CATÁLOGO CENTRADO */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.filter-btn {
  padding: 9px 18px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.catalog-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

/* TARJETAS 3D FLIP */
.machine-card {
  flex: 0 1 275px;
  width: 100%;
  height: 390px;
  perspective: 1000px;
  cursor: pointer;
}

.machine-card.hidden {
  display: none;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
}

/* En computador gira al pasar el mouse */
@media (hover: hover) and (pointer: fine) {
  .machine-card:hover .card-inner {
    transform: rotateY(180deg);
  }
}

/* En celular y tablet gira y regresa al tocar */
.machine-card.flipped .card-inner {
  transform: rotateY(180deg);
}


.card-front,
.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(15, 41, 66, 0.06);
  display: flex;
  flex-direction: column;
}

.card-front {
  background: var(--white);
}

.machine-img-box {
  height: 215px;
  background: #e2e8f0;
  overflow: hidden;
  flex-shrink: 0;
}

.machine-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.front-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.machine-cat {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

.front-body h3 {
  color: var(--navy);
  font-size: 1.08rem;
  line-height: 1.3;
}

.flip-hint {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 10px;
}

/* CARA TRASERA DE LA TARJETA */
.card-back {
  background: var(--navy);
  color: var(--white);
  transform: rotateY(180deg);
  padding: 22px;
  justify-content: space-between;
  border-color: var(--navy);
}

.card-back .machine-cat {
  color: #38bdf8;
}

.card-back h3 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.card-back p {
  font-size: 0.86rem;
  color: #cbd5e1;
  margin-bottom: 14px;
  line-height: 1.45;
}

.machine-specs {
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 10px;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.machine-specs li {
  margin-bottom: 6px;
}

.machine-specs strong {
  color: #38bdf8;
}

/* POSTVENTA */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.service-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 26px;
  border-radius: var(--radius);
}

.service-box h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: #38bdf8;
}

.service-box p {
  font-size: 0.9rem;
  color: #cbd5e1;
}

/* CONTACTO */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: start;
}

.contact-info h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  color: var(--navy);
  margin-bottom: 12px;
}

.contact-info p {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-details strong {
  display: block;
  color: var(--navy);
  font-size: 0.9rem;
}

.contact-details span {
  color: var(--text-muted);
  word-break: break-word;
}

.contact-form {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* FOOTER */
.footer {
  background: #091a2c;
  color: #cbd5e1;
  padding: 26px 0;
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-right: 76px; /* Espacio reservado para el botón de WhatsApp */
}

.footer-credit a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
}

.footer-credit a:hover {
  text-decoration: underline;
}

/* BOTÓN WHATSAPP FLOTANTE */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: #25d366;
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
  z-index: 999;
  transition: transform 0.15s ease-out, background 0.15s ease-out;
}

.whatsapp-float:hover {
  background: #1ebe5d;
  transform: scale(1.06);
}

/* =========================================
   RESPONSIVE: TABLETS Y PORTÁTILES PEQUEÑOS
   ========================================= */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .machine-card {
    flex: 0 1 300px;
  }
}

/* =========================================
   RESPONSIVE: TABLETS VERTICALES Y MÓVILES
   ========================================= */
@media (max-width: 900px) {
  .nav-container {
    height: 74px;
  }

  .logo-img {
    height: 46px;
  }

  .hero {
    padding: 48px 0 60px;
  }

  .hero-grid,
  .features-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 74px;
    left: 0;
    width: 100%;
    background: var(--white);
    flex-direction: column;
    align-items: center;
    padding: 24px;
    gap: 18px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(28, 47, 79, 0.08);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links .btn {
    width: 100%;
    max-width: 280px;
  }

  .footer {
    padding-bottom: 75px;
  }

  .footer-content {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-right: 0;
  }
}

/* =========================================
   RESPONSIVE: CELULARES
   ========================================= */
@media (max-width: 600px) {
  .container {
    width: 92%;
  }

  .logo-img {
    height: 40px;
  }

  .section {
    padding: 54px 0;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-specs {
    gap: 10px;
  }

  .spec-item strong {
    font-size: 0.92rem;
  }

  .spec-item span {
    font-size: 0.78rem;
  }

  .machine-card {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .feature-card,
  .contact-form {
    padding: 22px;
  }

  .whatsapp-float {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }
}

/* =========================================
   RESPONSIVE: CELULARES MUY PEQUEÑOS
   ========================================= */
@media (max-width: 390px) {
  .hero-specs {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ANIMACIONES DE ENTRADA AL HACER SCROLL */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Movimiento suave en tarjetas de Ingeniería y Postventa */
.feature-card,
.service-box {
  transition: transform 0.25s ease-out, border-color 0.25s ease-out;
}

.feature-card:hover,
.service-box:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

/* =========================================
   PORTADA CON SLIDER Y EFECTO KEN BURNS
   ========================================= */
.hero-slider {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  padding: 36px 0 68px;
  overflow: hidden;
  background: var(--navy);
  color: var(--white);
}

.slides-wrapper {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.slide.active {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 6.5s ease-out;
}

/* Efecto de zoom suave (Ken Burns) en la imagen activa */
.slide.active img {
  transform: scale(1.1);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(8, 17, 32, 0.78) 0%,
    rgba(8, 17, 32, 0.68) 50%,
    rgba(8, 17, 32, 0.88) 100%
  );
}

.hero-slider-content {
  position: relative;
  z-index: 3;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.badge-glass {
  display: inline-block;
  background: rgba(8, 17, 32, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 7px 16px;
  border-radius: 50px;
  margin-bottom: 14px;
}

.hero-slider-content h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 16px;
  font-weight: 800;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
}

.hero-slider-content p {
  font-size: 1.06rem;
  color: #f8fafc;
  margin-bottom: 22px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.hero-slider-content .hero-actions {
  justify-content: center;
  margin-bottom: 24px;
}

.hero-slider-content .btn-primary {
  box-shadow: 0 6px 20px rgba(0, 70, 168, 0.5);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-outline-light {
  border-color: #ffffff;
  color: #ffffff;
  background: rgba(8, 17, 32, 0.45);
  backdrop-filter: blur(6px);
}

.btn-outline-light:hover {
  background: #ffffff;
  color: var(--navy);
  border-color: #ffffff;
}

.hero-specs-light {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background: rgba(8, 17, 32, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 18px 20px;
  max-width: 620px;
  margin: 0 auto;
}

.hero-specs-light .spec-item strong {
  color: #ffffff;
  font-size: 1.05rem;
}

.hero-specs-light .spec-item span {
  color: #cbd5e1;
}

/* Flechas del slider */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 31, 56, 0.45);
  backdrop-filter: blur(6px);
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.slider-arrow:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.slider-arrow.prev {
  left: 20px;
}

.slider-arrow.next {
  right: 20px;
}

/* Indicadores inferiores */
.slider-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}

.dot.active {
  width: 28px;
  background: #38bdf8;
}

/* Ajuste del slider en celulares */
@media (max-width: 768px) {
  .hero-slider {
    min-height: auto;
    padding: 28px 0 62px;
  }

  .hero-slider-content p {
    font-size: 0.96rem;
  }

  .slider-arrow {
    display: none; /* En móvil se desliza con el dedo o usando los puntos */
  }

  .hero-specs-light {
    gap: 10px;
  }
}
