/* Premium motion system — transform/opacity only for performance */

:root {
  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-duration: 0.65s;
  --motion-stagger: 0.08s;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--motion-duration) var(--ease-out-expo),
    transform var(--motion-duration) var(--ease-out-expo);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

.reveal--left {
  transform: translateX(-32px);
}

.reveal--right {
  transform: translateX(32px);
}

.reveal--scale {
  transform: scale(0.94);
}

.reveal--fade {
  transform: none;
}

/* Solo opacidad: sin desplazamiento ni escala (lectura segura) */
.reveal--soft {
  transform: none;
  transition: opacity 0.45s var(--ease-out-expo);
}

/* Ventajas y FAQ: texto siempre visible, sin movimiento */
.readable-section,
#ventajas,
#faq {
  overflow: visible;
}

.readable-section .reveal,
#ventajas .reveal,
#faq .reveal,
.readable-section .reveal--left,
.readable-section .reveal--right,
.readable-section .reveal--scale,
#ventajas .reveal--left,
#ventajas .reveal--right,
#ventajas .reveal--scale,
#faq .reveal--left,
#faq .reveal--right,
#faq .reveal--scale,
.page-hero .reveal,
.page-hero .reveal--left,
.page-hero .reveal--right,
.page-hero .reveal--scale {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  will-change: auto;
}

.readable-section .card:hover,
#ventajas .card:hover,
#faq details:hover {
  transform: translateY(-2px);
}

.readable-section .card .icon:hover,
#ventajas .card:hover .icon {
  transform: none;
}

#faq details,
.readable-section details {
  opacity: 1;
  transform: none;
  overflow: visible;
}

#faq .split,
.readable-section .split {
  overflow: visible;
}

#faq .split > *,
.readable-section .split > * {
  opacity: 1;
  transform: none;
}

.readable-section .section-head,
.readable-section .card,
.readable-section h1,
.readable-section h2,
.readable-section h3,
.readable-section p,
.readable-section summary,
#ventajas .section-head,
#ventajas .card,
#faq .section-head,
#faq summary,
#faq p {
  opacity: 1;
  transform: none;
  visibility: visible;
}

/* ── Hero entrance (load, not scroll) ── */
.hero-enter > * {
  opacity: 0;
  animation: heroReveal 0.85s var(--ease-out-expo) forwards, reveal-fallback-show 0s 1.3s forwards;
}

.hero-enter > *:nth-child(1) { animation-delay: 0.05s; }
.hero-enter > *:nth-child(2) { animation-delay: 0.15s; }
.hero-enter > *:nth-child(3) { animation-delay: 0.25s; }
.hero-enter > *:nth-child(4) { animation-delay: 0.35s; }
.hero-enter > *:nth-child(5) { animation-delay: 0.45s; }

.hero-card.reveal-hero-card {
  opacity: 0;
  animation: heroCardIn 1s var(--ease-out-expo) 0.2s forwards;
}

@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroCardIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Light parallax hero bg ── */
.hero-bg img {
  transition: transform 0.1s linear;
  will-change: transform;
}

/* ── Floating elements ── */
.float-gentle {
  animation: floatGentle 5s ease-in-out infinite;
}

@keyframes floatGentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ── Enhanced hovers ── */
.btn {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.22s var(--ease-out-soft),
    box-shadow 0.22s var(--ease-out-soft),
    background 0.22s var(--ease-out-soft),
    border-color 0.22s var(--ease-out-soft);
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.55s var(--ease-out-soft);
  pointer-events: none;
}

.btn:hover::before {
  transform: translateX(120%);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-orange.cta-pulse {
  animation: ctaPulse 3.5s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 14px 35px rgba(11, 98, 196, 0.28); }
  50% { box-shadow: 0 18px 48px rgba(11, 98, 196, 0.42), 0 0 0 6px rgba(11, 98, 196, 0.08); }
}

.card .icon,
.value .icon,
.contact-card .icon {
  transition: transform 0.28s var(--ease-out-expo), background 0.28s ease;
}

.card:hover .icon,
.value:hover .icon,
.contact-card:hover .icon {
  transform: scale(1.1) rotate(-3deg);
}

.card,
.storage,
.value,
.contact-card,
.geo-card {
  transition:
    transform 0.28s var(--ease-out-expo),
    box-shadow 0.28s var(--ease-out-expo),
    border-color 0.28s ease;
}

.storage img {
  transition: transform 0.45s var(--ease-out-expo);
}

.storage:hover img {
  transform: scale(1.04);
}

.menu a::after {
  transition: transform 0.28s var(--ease-out-expo);
}

.internal-links a,
.geo-card {
  transition:
    transform 0.22s var(--ease-out-soft),
    box-shadow 0.22s var(--ease-out-soft),
    border-color 0.22s ease,
    background 0.22s ease;
}

.internal-links a:hover {
  transform: translateY(-2px);
}

.geo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* ── Counters ── */
.price.is-counting,
.result-size.is-counting,
.stat-value.is-counting {
  display: inline-block;
  transition: transform 0.3s var(--ease-out-expo);
}

.result-size.result-pop {
  animation: resultPop 0.45s var(--ease-out-expo);
}

@keyframes resultPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ── Form microinteractions ── */
input,
select,
textarea {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  transform: translateY(-1px);
}

#contact-form button[type="submit"].is-sending {
  opacity: 0.85;
  pointer-events: none;
}

/* ── FAQ accordion ── */
details {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

details[open] {
  box-shadow: 0 12px 32px rgba(7, 24, 47, 0.08);
}

summary {
  transition: color 0.2s ease;
}

/* ── Mobile menu stagger ── */
.mobile-menu-scroll a,
.mobile-menu-actions .btn {
  opacity: 0;
  transform: translateX(12px);
  transition:
    opacity 0.32s var(--ease-out-expo),
    transform 0.32s var(--ease-out-expo),
    background 0.2s ease;
}

body.mobile-menu-open .mobile-menu-scroll a.is-menu-visible,
body.mobile-menu-open .mobile-menu-actions .btn.is-menu-visible {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu-inner {
  transition: transform 0.38s var(--ease-out-expo);
}

.mobile-menu-backdrop {
  transition: background 0.38s var(--ease-out-expo), opacity 0.38s ease;
}

/* ── WhatsApp float ── */
.wa-float {
  animation: waFloat 4s ease-in-out infinite;
}

@keyframes waFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.wa-float:hover {
  animation: none;
  transform: translateY(-4px) scale(1.05);
}

/* ── Range slider feedback ── */
input[type="range"]::-webkit-slider-thumb {
  transition: transform 0.15s ease;
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

/* Fallback: si JavaScript tarda o falla, el contenido se muestra igual */
.reveal:not(.is-visible) {
  animation: reveal-fallback-show 0s 1.4s forwards;
}

@keyframes reveal-fallback-show {
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-card.reveal-hero-card {
  animation: heroCardIn 1s var(--ease-out-expo) 0.2s forwards, reveal-fallback-show 0s 2s forwards;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal--left,
  .reveal--right,
  .reveal--scale,
  .reveal--fade {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-enter > *,
  .hero-card.reveal-hero-card,
  .btn-orange.cta-pulse,
  .wa-float,
  .float-gentle {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .btn::before {
    display: none;
  }

  .mobile-menu-scroll a,
  .mobile-menu-actions .btn {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
