* {
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
.gradient-text {
  font-family: "Quicksand", "Nunito", system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
}

:root { --nav-height: 80px; }
/* Offset anchored sections so fixed navbar doesn't cover content */
section[id] {
  scroll-margin-top: calc(var(--nav-height) + 12px);
}

/* Increased max-width for better width utilization */
.container-wide {
  max-width: 1400px;
}

/* Advanced animated gradient background */
.gradient-bg {
  background: linear-gradient(
    135deg,
    #1e1b4b 0%,
    #312e81 25%,
    #4338ca 50%,
    #5b4fc7 75%,
    #6366f1 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Glassmorphism effect */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 3D card hover effect */
.card-3d {
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
}

.card-3d:hover {
  transform: translateY(-20px) scale(1.05);
  box-shadow: 0 30px 60px -12px rgba(67, 56, 202, 0.5),
    0 0 40px rgba(99, 102, 241, 0.4);
}

/* Animated gradient text */
.gradient-text {
  background: linear-gradient(135deg, #4338ca 0%, #17a2b8 50%, #6366f1 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientText 3s ease infinite;
}

@keyframes gradientText {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Floating blobs animation */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: blobFloat 20s ease-in-out infinite;
}

@keyframes blobFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(50px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-50px, 50px) scale(0.9);
  }
}

/* Parallax effect */
.parallax {
  transition: transform 0.3s ease-out;
}

/* Reveal animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.scroll-reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Glow effect */
.glow {
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.5), 0 0 60px rgba(99, 102, 241, 0.3);
}

.glow-hover {
  transition: all 0.4s ease;
}

.glow-hover:hover {
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.7), 0 0 80px rgba(99, 102, 241, 0.5);
  transform: scale(1.05);
}

/* Ripple effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:hover::after {
  width: 300px;
  height: 300px;
}

/* Floating animation */
.float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.float-delay-1 {
  animation-delay: 0.5s;
}
.float-delay-2 {
  animation-delay: 1s;
}
.float-delay-3 {
  animation-delay: 1.5s;
}

/* Pulse glow animation */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.8),
      0 0 60px rgba(99, 102, 241, 0.4);
  }
}

/* Scroll progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #4338ca, #17a2b8, #6366f1);
  z-index: 9999;
  transition: width 0.2s ease;
}

/* WhatsApp chat widget styles */
.whatsapp-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  max-width: calc(100vw - 40px);
}

.whatsapp-button {
  width: 64px;
  height: 64px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: all 0.3s ease;
  animation: floatWhatsapp 3s ease-in-out infinite;
}

.whatsapp-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

@keyframes floatWhatsapp {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.whatsapp-chat {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  max-width: calc(100vw - 40px);
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: scale(0);
  transform-origin: bottom right;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.whatsapp-chat.active {
  transform: scale(1);
}

.chat-header {
  background: #075e54;
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-body {
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
  background: #ece5dd;
}

.chat-message {
  background: white;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-options {
  padding: 15px;
  background: white;
  border-top: 1px solid #e0e0e0;
}

.chat-option-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-bottom: 8px;
  background: #25d366;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.chat-option-btn:hover {
  background: #128c7e;
  transform: translateX(5px);
}

.chat-option-btn:last-child {
  margin-bottom: 0;
}

/* Number counter animation */
.counter {
  font-variant-numeric: tabular-nums;
}

/* Magnetic button effect */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Stagger animation delays */
.stagger-1 {
  transition-delay: 0.1s;
}
.stagger-2 {
  transition-delay: 0.2s;
}
.stagger-3 {
  transition-delay: 0.3s;
}
.stagger-4 {
  transition-delay: 0.4s;
}
.stagger-5 {
  transition-delay: 0.5s;
}
.stagger-6 {
  transition-delay: 0.6s;
}

/* Shine effect on hover */
.shine {
  position: relative;
  overflow: hidden;
}

.shine::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.7s;
}

.shine:hover::before {
  left: 100%;
}

/* Rotate on hover */
.rotate-hover {
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.rotate-hover:hover {
  transform: rotate(5deg) scale(1.1);
}

/* Text balance for better line breaks */
.text-balance {
  text-wrap: balance;
}

/* Diagonal section divider */
.diagonal-section {
  clip-path: polygon(0 5%, 100% 0, 100% 95%, 0 100%);
  padding-top: 100px;
  padding-bottom: 100px;
  margin-top: -50px;
  margin-bottom: -50px;
}

/* Fix: show decorative floating elements on small screens (avoid being cut by overflow-hidden) */
@media (max-width: 640px) {
  #inicio {
    overflow: visible;
  }
  /* Nudge floating icons slightly inside viewport on small screens */
  #inicio .absolute.-top-6.-right-6 {
    right: 8px;
    top: -4px;
  }
  #inicio .absolute.-bottom-6.-left-6 {
    left: 8px;
    bottom: -4px;
  }
  
  /* WhatsApp widget mobile fixes */
  .whatsapp-widget {
    bottom: 15px;
    right: 15px;
    left: auto;
    max-width: calc(100vw - 30px);
  }
  
  .whatsapp-button {
    width: 56px;
    height: 56px;
  }
  
  .whatsapp-button i {
    font-size: 24px !important;
  }
  
  .whatsapp-chat {
    width: calc(100vw - 30px);
    max-width: 320px;
    bottom: 75px;
    right: 0;
    left: auto;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
  }
  
  .chat-header {
    padding: 12px 15px !important;
    flex-shrink: 0;
    min-height: auto;
  }
  
  .chat-header .w-12 {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px;
    min-height: 36px;
  }
  
  .chat-header .w-12 i {
    font-size: 16px !important;
  }
  
  .chat-header h4 {
    font-size: 14px !important;
    margin: 0;
    line-height: 1.2;
  }
  
  .chat-header p {
    font-size: 10px !important;
    margin: 2px 0 0 0;
    line-height: 1.2;
  }
  
  .chat-header button i {
    font-size: 18px !important;
  }
  
  .chat-body {
    padding: 12px 15px !important;
    max-height: 180px;
    flex-shrink: 1;
    overflow-y: auto;
  }
  
  .chat-message {
    padding: 10px 12px !important;
    margin-bottom: 8px;
  }
  
  .chat-message p {
    font-size: 12px !important;
    margin-bottom: 6px !important;
  }
  
  .chat-options {
    padding: 10px 12px !important;
    flex-shrink: 0;
    max-height: 45vh;
    overflow-y: auto;
  }
  
  .chat-option-btn {
    padding: 8px 10px !important;
    margin-bottom: 6px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    white-space: normal;
    word-wrap: break-word;
  }
  
  .chat-option-btn i {
    font-size: 12px !important;
    margin-right: 6px !important;
  }
}
