/* ============================================================
   AZUL HOGAR & CLEAN — Animations & Motion
   ============================================================ */

/* --- Keyframes --- */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-14px); }
}

@keyframes float-bg {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.6; }
  50% { transform: scale(1.1) rotate(180deg); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.7; }
  70% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bounce-in {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slide-down {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slide-left {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-right {
  from { transform: translateX(-40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scale-up {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes typing-cursor {
  0%, 100% { border-right-color: transparent; }
  50% { border-right-color: var(--turquesa); }
}

@keyframes wave-animation {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes particle-float {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

@keyframes counter-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes draw-line {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 180, 216, 0.3); }
  50% { box-shadow: 0 0 40px rgba(0, 180, 216, 0.6); }
}

/* --- Scroll-triggered animation base states --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.from-left {
  transform: translateX(-32px);
}

.reveal.from-right {
  transform: translateX(32px);
}

.reveal.scale {
  transform: scale(0.9);
  opacity: 0;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.33s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.40s; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* --- Particle Canvas --- */
#particles-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* --- Animated gradient text --- */
.gradient-text {
  background: linear-gradient(135deg, var(--turquesa), var(--dorado), var(--turquesa));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* --- Loading shimmer for cards --- */
.shimmer-loading {
  background: linear-gradient(90deg,
    rgba(0,180,216,0.06) 0%,
    rgba(0,180,216,0.12) 50%,
    rgba(0,180,216,0.06) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* --- Hover lift utility --- */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(26,58,107,0.15);
}

/* --- Glow on hover --- */
.hover-glow:hover {
  animation: glow-pulse 1.5s ease-in-out infinite;
}

/* --- Animated underline --- */
.animated-underline {
  position: relative;
  display: inline-block;
}

.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--turquesa);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.animated-underline:hover::after { width: 100%; }

/* --- Icon spin on hover --- */
.hover-spin:hover i {
  animation: spin-slow 1s linear infinite;
}

/* --- Particles for hero --- */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particle-float linear infinite;
}

/* --- Progress bar animation --- */
.progress-bar {
  height: 4px;
  background: rgba(0,180,216,0.15);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--turquesa), var(--dorado));
  border-radius: 4px;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Morphing blob background --- */
.blob-bg {
  position: absolute;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  background: radial-gradient(ellipse, rgba(0,180,216,0.08), transparent);
  animation: blob-morph 12s ease-in-out infinite;
  pointer-events: none;
}

@keyframes blob-morph {
  0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
  50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
  75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
}

/* --- Page transition overlay --- */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--navy);
  z-index: 9999;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.5s cubic-bezier(0.86, 0, 0.07, 1);
}

.page-transition.entering { transform: scaleY(1); }
.page-transition.leaving {
  transform-origin: top;
  transform: scaleY(0);
}

/* --- Number counter animation --- */
.counter-value {
  display: inline-block;
  transition: all 0.1s ease;
}

/* --- Smooth hover scale for images --- */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-zoom:hover img {
  transform: scale(1.08);
}

/* --- Floating action button pulse --- */
.fab-pulse {
  animation: pulse-ring 2s ease-out infinite;
}

/* --- Typing effect --- */
.typing-text {
  border-right: 3px solid var(--turquesa);
  padding-right: 4px;
  animation: typing-cursor 0.8s ease infinite;
}

/* --- Accordion --- */
.accordion-item {
  border-bottom: 1px solid rgba(26,58,107,0.1);
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
  transition: color 0.3s;
  gap: 16px;
}

.accordion-header:hover { color: var(--turquesa); }

.accordion-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(0,180,216,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--turquesa);
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.open .accordion-icon {
  background: var(--turquesa);
  color: var(--white);
  border-color: var(--turquesa);
  transform: rotate(45deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.4s;
  font-size: 0.95rem;
  color: var(--gris-pizarra);
  line-height: 1.7;
}

.accordion-item.open .accordion-body {
  max-height: 800px;
  padding-bottom: 20px;
}

/* --- Tab animations --- */
.tab-content {
  animation: fade-in 0.4s ease;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,58,107,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px;
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--gris-perla);
  color: var(--gris-pizarra);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}

.modal-close:hover { background: var(--navy); color: var(--white); }

/* --- Toast notification --- */
.toast-container {
  position: fixed;
  bottom: 100px;
  right: 32px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  animation: slide-left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 4px solid var(--turquesa);
}

.toast.success { border-left-color: #38a169; }
.toast.error { border-left-color: #e53e3e; }
.toast.warning { border-left-color: var(--dorado); }

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: #38a169; }
.toast.error .toast-icon { color: #e53e3e; }
.toast.warning .toast-icon { color: var(--dorado); }
.toast .toast-icon { color: var(--turquesa); }

.toast-message {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--navy);
}

/* --- Reduced motion support --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
