/* =========================================================================
   VARIABLES & DESIGN TOKENS
   ========================================================================= */
:root {
  /* Colors */
  --bg-color: #0f1115;
  /* Dark background */
  --bg-secondary: #181b21;
  --primary: #ca0013;
  /* Original Flowia Red */
  --primary-hover: #a3000f;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(24, 27, 33, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing & Layout */
  --max-width: 1400px;
  --section-padding: 100px 40px;
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 8px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================================
   RESET & BASE STYLES
   ========================================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

html::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari and Opera */
}

/* Lenis smooth scroll integration */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}


body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Background Texture/Gradient */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 15% 50%, rgba(202, 0, 19, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(202, 0, 19, 0.05) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #ffffff;
}

p {
  color: var(--text-muted);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

section {
  position: relative;
  overflow: hidden;
  padding: var(--section-padding);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* =========================================================================
   UTILITIES & COMPONENTS
   ========================================================================= */
.text-gradient {
  background: linear-gradient(135deg, #ff4d4d 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(202, 0, 19, 0.1);
  color: #ff4d4d;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 24px;
  border: 1px solid rgba(202, 0, 19, 0.2);
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.glass:hover {
  border-color: rgba(202, 0, 19, 0.15);
  box-shadow: 0 8px 40px rgba(202, 0, 19, 0.08), 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn:not(.btn-secondary) {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(202, 0, 19, 0.3);
}

.btn:not(.btn-secondary):hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(202, 0, 19, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* =========================================================================
   NAVBAR
   ========================================================================= */
.navbar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 1200px;
  height: 64px;
  z-index: 1000;
  background: rgba(15, 17, 21, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              background 0.3s ease, 
              box-shadow 0.3s ease;
  animation: navEntrance 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.navbar--hidden {
  transform: translateX(-50%) translateY(-120%);
}

@keyframes navEntrance {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.nav-container {
  height: 100%;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  padding-left: 12px;
  transition: transform 0.3s ease;
  animation: fadeSlideIn 0.8s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.logo:hover {
  transform: scale(1.05);
}

.logo-img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.nav-indicator {
  position: absolute;
  top: 50%;
  left: 0;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  border-radius: 100px;
  transform: translateY(-50%);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 100px;
  transition: color 0.3s ease;
  animation: fadeSlideIn 0.8s ease forwards;
  opacity: 0;
}

.nav-links a:nth-child(2) { animation-delay: 0.3s; }
.nav-links a:nth-child(3) { animation-delay: 0.4s; }
.nav-links a:nth-child(4) { animation-delay: 0.5s; }
.nav-links a:nth-child(5) { animation-delay: 0.6s; }

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-links a:hover,
.nav-links a.active {
  color: white;
}

.nav-links .cta {
  background: white;
  color: #0f1115;
  font-weight: 700;
  margin-left: 8px;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.nav-links .cta:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}

/* Hamburger Menu (Mobile) */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
  z-index: 1001;
  /* Above nav menu */
}

.hamburger span {
  display: block;
  width: 28px;
  height: 2px;
  background: white;
  transition: all var(--transition-fast);
  border-radius: 2px;
}

/* =========================================================================
   HERO SECTION
   ========================================================================= */
.hero {
  position: relative;
  text-align: center;
  padding-top: 140px;
  /* Reduced since nav is slimmer and floating */
  overflow: hidden;
}

/* Dither WebGL canvas — fixed full-page background */
.dither-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
  opacity: 0.22;
}

/* Light rays canvas — hero overlay */
.light-rays-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 1;
}

/* Ensure hero content sits above all canvas layers */
.hero .container {
  position: relative;
  z-index: 2;
}

.hero .blob-shape {
  z-index: 2;
}

/* All page content above the fixed dither canvas */
main.wrapper,
footer {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(3rem, 6vw, 5.5rem);
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  max-width: 680px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Decorative Blobs in Hero */
.blob-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.4;
  animation: float 20s infinite ease-in-out;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: 10%;
  right: -10%;
}

.blob-2 {
  width: 300px;
  height: 300px;
  background: #ff4d4d;
  bottom: -20%;
  left: -5%;
  animation-delay: -10s;
}

.blob-3 {
  width: 450px;
  height: 450px;
  background: var(--primary);
  top: 30%;
  left: -15%;
  animation-delay: -5s;
}

.blob-4 {
  width: 350px;
  height: 350px;
  background: #ff4d4d;
  bottom: 0%;
  right: -5%;
  animation-delay: -15s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -50px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* =========================================================================
   GENERIC SECTION TYPOGRAPHY
   ========================================================================= */
section h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  text-align: center;
  margin-bottom: 16px;
}

.section-subtitle {
  text-align: center;
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 64px auto;
}

/* =========================================================================
   GRID & CARDS (SERVICES)
   ========================================================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              border-color 0.4s ease,
              box-shadow 0.5s ease;
}

/* Gradient top-border accent on hover */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ca0013, #ff4d4d, #ca0013, transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-12px) scale(1.03);
  border-color: rgba(202, 0, 19, 0.2);
  box-shadow:
    0 20px 60px rgba(202, 0, 19, 0.12),
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 24px;
  display: inline-flex;
  padding: 16px;
  background: rgba(202, 0, 19, 0.06);
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(202, 0, 19, 0.12);
  color: #ff4d4d;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover .card-icon {
  background: rgba(202, 0, 19, 0.15);
  border-color: rgba(202, 0, 19, 0.35);
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 8px 24px rgba(202, 0, 19, 0.2);
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  transition: color 0.3s ease;
}

.card:hover h3 {
  color: #ff6b6b;
}

.card p {
  transition: color 0.3s ease;
}

.card:hover p {
  color: #c9cdd4;
}

/* =========================================================================
   PROCESS TIMELINE CARDS
   ========================================================================= */
.step-card {
  position: relative;
  overflow: hidden;
}

/* Left accent border for step cards */
.step-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, #ff4d4d, #ca0013);
  border-radius: 0 4px 4px 0;
  transform: translateY(-50%);
  transition: height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.step-card:hover::after {
  height: 60%;
}

.step-card:hover {
  transform: translateY(-12px) scale(1.03);
  border-color: rgba(202, 0, 19, 0.2);
  box-shadow:
    0 20px 60px rgba(202, 0, 19, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.3);
}

.step-number {
  font-size: 6rem;
  font-weight: 800;
  position: absolute;
  top: -20px;
  right: -10px;
  color: rgba(255, 255, 255, 0.03);
  line-height: 1;
  pointer-events: none;
  transition: all 0.5s ease;
}

.step-card:hover .step-number {
  color: rgba(202, 0, 19, 0.08);
  transform: scale(1.1) translate(-5px, 5px);
}

.step-card:hover h3 {
  color: #ff6b6b;
}

.step-card:hover p {
  color: #c9cdd4;
}

/* =========================================================================
   SECTION COUNTER
   ========================================================================= */
.section-counter {
  position: fixed;
  right: 40px;
  bottom: 40px;
  z-index: 100;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-family);
  mix-blend-mode: difference;
  /* Para que sea siempre visible sobre cualquier fondo */
  pointer-events: none;
}

.section-counter .current {
  font-size: 3rem;
  font-weight: 800;
  color: white;
  line-height: 1;
}

.section-counter .total {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  .section-counter {
    right: 20px;
    bottom: 20px;
  }

  .section-counter .current {
    font-size: 2rem;
  }
}

/* =========================================================================
   CONTACT SECTION
   ========================================================================= */
.contact-section {
  text-align: center;
}

.contact-section h2 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 24px;
}

.contact-cards-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.contact-card {
  flex: 1;
  min-width: 280px;
  max-width: 400px;
  padding: 40px 32px;
  text-align: center;
}

.contact-card-icon {
  font-size: 2.5rem;
  margin-bottom: 24px;
  display: block;
}

.contact-card strong {
  font-size: 1.25rem;
  color: white;
  display: block;
  margin-bottom: 12px;
}

.contact-card p {
  font-size: 1rem;
}

.contact-cta {
  display: flex;
  justify-content: center;
}

#whatsapp-cta {
  font-size: 1.1rem;
  padding: 18px 48px;
  gap: 12px;
}

/* =========================================================================
   FLOATING ARROW INDICATOR
   ========================================================================= */
.chat-arrow-indicator {
  position: fixed;
  bottom: 85px;
  right: 85px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.chat-arrow-label {
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
  box-shadow: 0 4px 15px rgba(202, 0, 19, 0.3);
  white-space: nowrap;
  animation: floatArrow 2s infinite ease-in-out;
}

@keyframes floatArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.chat-arrow-indicator svg {
  transform: rotate(-10deg);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}


.method p {
  margin: 0;
  font-size: 0.95rem;
}

.contact-demo h2 {
  text-align: left;
  font-size: 2rem;
  margin-bottom: 8px;
}

/* =========================================================================
   CLIENTS SECTION — INFINITE MARQUEE & TESTIMONIALS
   ========================================================================= */
.clients {
  text-align: center;
  overflow: hidden;
}

/* ---- Marquee ---- */
.marquee-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto 80px;
  overflow: hidden;
}

/* Fade edges */
.marquee-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}
.marquee-fade--left {
  left: 0;
  background: linear-gradient(to right, var(--bg-color), transparent);
}
.marquee-fade--right {
  right: 0;
  background: linear-gradient(to left, var(--bg-color), transparent);
}

.marquee-track {
  overflow: hidden;
  width: 100%;
}

.marquee-inner {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  animation: marquee-scroll 24s linear infinite;
}

.marquee-inner:hover {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-100% / 3)); }
}

.marquee-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 48px;
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}

.marquee-item-inner {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.marquee-item:hover .marquee-item-inner {
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
  transform: scale(1.04);
}

.marquee-logo {
  height: 60px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.marquee-item:hover .marquee-logo {
  transform: scale(1.05);
}

/* ---- Testimonial Cards ---- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.testimonial-card {
  padding: 40px 32px 32px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    border-color 0.4s ease,
    box-shadow 0.5s ease;
}

.testimonial-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-color, #ca0013), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.testimonial-card:hover::before {
  opacity: 1;
}

.testimonial-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.testimonial-quote {
  font-size: 5rem;
  line-height: 0.8;
  color: var(--primary);
  font-family: Georgia, serif;
  opacity: 0.6;
  margin-bottom: 16px;
  display: block;
}

.testimonial-text {
  font-size: 1rem;
  line-height: 1.75;
  color: #c4c7cf;
  margin-bottom: 28px;
  flex-grow: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.testimonial-logo-badge {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.testimonial-card:hover .testimonial-logo-badge {
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.testimonial-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.testimonial-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.testimonial-info strong {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.testimonial-info span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive marquee */
@media (max-width: 768px) {
  .marquee-item {
    padding: 16px 36px;
  }
  .marquee-logo {
    height: 36px;
  }
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
  .testimonial-card {
    padding: 28px 20px 24px;
  }
}

/* =========================================================================
   FOOTER
   ========================================================================= */
footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 20px;
  background: var(--bg-secondary);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  display: flex;
  align-items: center;
}

.footer-logo .logo-img {
  height: 28px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: white;
}

/* =========================================================================
   ANIMATIONS (REVEAL)
   ========================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered card animation */
.reveal.active .card {
  opacity: 0;
  transform: translateY(30px);
  animation: cardReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal.active .card:nth-child(1) { animation-delay: 0.1s; }
.reveal.active .card:nth-child(2) { animation-delay: 0.2s; }
.reveal.active .card:nth-child(3) { animation-delay: 0.3s; }
.reveal.active .card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Badge pulse glow */
.badge {
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(202, 0, 19, 0); }
  50% { box-shadow: 0 0 20px 2px rgba(202, 0, 19, 0.15); }
}

/* =========================================================================
   N8N CHATBOT FIXES
   ========================================================================= */
#chat-container {
  position: relative;
  width: 100%;
  height: 380px;
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* Make sure n8n doesn't float when in target mode */
#chat-container .n8n-chat {
  position: relative !important;
  width: 100% !important;
  max-width: 400px;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
  overflow: hidden;
  background: #0f1115 !important;
}

/* Chat window override for embedded mode */
#chat-container .chat-window-wrapper {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  width: 100% !important;
  height: 100% !important;
}

#chat-container .chat-window-wrapper .chat-window {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  border-radius: 16px !important;
  margin-bottom: 0 !important;
}

/* Dark header styling */
#chat-container .chat-header {
  border-bottom: 1px solid rgba(202, 0, 19, 0.15) !important;
}

/* Dark scrollbar in chat */
#chat-container .chat-body::-webkit-scrollbar {
  width: 4px;
}

#chat-container .chat-body::-webkit-scrollbar-track {
  background: transparent;
}

#chat-container .chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Bot message glass style */
#chat-container .chat-message-from-bot {
  border-radius: 12px !important;
}

/* User message rounded */
#chat-container .chat-message-from-user {
  border-radius: 12px !important;
}

/* RE-ENABLE TOGGLE FOR FLOATING MODE */
.n8n-chat-toggle {
  display: flex !important;
}


/* =========================================================================
   LARGE SCREENS
   ========================================================================= */
@media (min-width: 1600px) {
  :root {
    --max-width: 1560px;
    --section-padding: 120px 80px;
  }

  .logo-img {
    height: 44px;
  }

  .hero h1 {
    font-size: clamp(4rem, 5vw, 7rem);
  }

  .nav-container {
    padding: 0 60px;
  }
}

/* =========================================================================
   RESPONSIVE DESIGN
   ========================================================================= */
@media (max-width: 992px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 90px 20px 40px;
  }

  .hero {
    padding-top: 100px;
    padding-bottom: 40px;
  }

  .hero h1 {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  section h2 {
    font-size: 1.75rem;
    margin-bottom: 10px;
  }

  .section-subtitle {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card {
    padding: 20px 16px;
  }

  .card-icon {
    margin-bottom: 12px;
    padding: 12px;
  }

  .card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100dvh;
    background: #0f1115;
    flex-direction: column;
    justify-content: center;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    gap: 32px;
  }

  .navbar {
    top: 10px;
    width: calc(100% - 20px);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    font-size: 1.5rem;
  }

  /* Hamburger animation */
  .hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .contact-info,
  .contact-demo {
    padding: 32px 24px;
  }

  /* Reducir chat para que entre en pantalla */
  #chat-container {
    height: 320px;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .logo-img {
    height: 28px;
  }
}