/* ================= VARIABLES ================= */
:root {
  --fk-page-gradient: linear-gradient(
    165deg,
    #0a1020 0%,
    #111d33 38%,
    #0f172a 65%,
    #0c1428 100%
  );
  --fk-bg: #f1f5f9;
  --fk-surface: #ffffff;
  --fk-text: #0f172a;
  --fk-muted: #64748b;
  --fk-page-text: #e8eef4;
  --fk-page-muted: #94a3b8;
  --fk-accent: #2dd4bf;
  --fk-accent-deep: #0d9488;
  --fk-accent-hover: #14b8a6;
  --fk-strip: #020617;
  --fk-focus: #5eead4;
  --fk-focus-ring: rgba(94, 234, 212, 0.38);
  --fk-radius-lg: 1rem;
  --fk-radius-xl: 1.25rem;
  --fk-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  --fk-shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.28);
  --bs-success: var(--fk-accent-deep);
  --bs-success-rgb: 13, 148, 136;
}

/* ================= BASE ================= */
html {
  scroll-behavior: smooth;
  background-color: #0f172a;
  background-image: var(--fk-page-gradient);
  background-attachment: fixed;
  min-height: 100%;
}

body {
  margin: 0;
  padding: 0;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: transparent;
  color: var(--fk-page-text);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Contenido por encima de partículas (fix WebKit / Android) */
.site-header,
main,
footer.site-footer {
  position: relative;
  z-index: 1;
}

/* ================= PARTICLES ================= */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  z-index: 0;
  pointer-events: none;
}

/* ================= HEADER / LOGO ================= */
.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100vw;
  margin: 0 auto;
  padding: 1.25rem max(1rem, env(safe-area-inset-right)) 0.5rem
    max(1rem, env(safe-area-inset-left));
  box-sizing: border-box;
}

.logo-hitbox {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: min(100%, 340px);
  margin: 0 auto;
  cursor: pointer;
  border-radius: 12px;
  transition: transform 0.2s ease;
}

.logo-hitbox:focus-visible {
  outline: 2px solid var(--fk-focus);
  outline-offset: 4px;
}

.logo,
.logo--interactive {
  display: block;
  width: auto;
  max-width: min(88vw, 300px);
  height: auto;
  margin-left: auto;
  margin-right: auto;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.45));
  transition: filter 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
  .logo,
  .logo--interactive {
    max-width: 300px;
  }
}

/* ================= HERO ================= */
.hero-form {
  position: relative;
  z-index: 1;
  --spot-x: 50%;
  --spot-y: 42%;
  padding: 2rem 1rem 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-eyebrow {
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--fk-accent);
  font-size: 0.7rem;
}

.hero-title {
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: -0.02em;
  color: var(--fk-page-text);
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--fk-page-muted);
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
}

/* Lectura / progreso de scroll */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 10001;
  background: linear-gradient(90deg, var(--fk-accent), #6366f1, #22d3ee);
  pointer-events: none;
  transition: width 0.12s ease-out;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

/* Mancha de luz que sigue al cursor en el hero */
.hero-form::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    520px circle at var(--spot-x) var(--spot-y),
    rgba(45, 212, 191, 0.14) 0%,
    transparent 56%
  );
  pointer-events: none;
  z-index: 0;
}

.hero-form > * {
  position: relative;
  z-index: 1;
}

/* Entrada escalonada */
.hero-reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: heroRevealIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-reveal--1 {
  animation-delay: 0.05s;
}

.hero-reveal--2 {
  animation-delay: 0.14s;
}

.hero-reveal--3 {
  animation-delay: 0.24s;
}

.hero-reveal--4 {
  animation-delay: 0.34s;
}

@keyframes heroRevealIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Título con brillo que se desplaza */
.hero-title--shine {
  background: linear-gradient(
    100deg,
    #f8fafc 0%,
    #f8fafc 30%,
    #5eead4 50%,
    #f8fafc 70%,
    #f8fafc 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: titleShine 7s ease-in-out infinite;
}

@keyframes titleShine {
  0%,
  100% {
    background-position: 100% 50%;
  }
  50% {
    background-position: 0% 50%;
  }
}

.logo--pop {
  animation: logoPop 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes logoPop {
  0% {
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.45));
  }
  40% {
    transform: scale(1.07) rotate(-3deg);
    filter: drop-shadow(0 0 28px rgba(94, 234, 212, 0.65));
  }
  100% {
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.45));
  }
}

/* Borde con gradiente animado alrededor del formulario */
.form-glow-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 446px;
  margin: 0 auto;
  padding: 2px;
  border-radius: calc(var(--fk-radius-xl) + 3px);
  background: linear-gradient(
    125deg,
    #0d9488,
    #6366f1,
    #22d3ee,
    #14b8a6,
    #0d9488
  );
  background-size: 400% 400%;
  animation: formGlowMove 10s ease infinite;
  box-shadow: 0 16px 48px rgba(45, 212, 191, 0.18);
}

@keyframes formGlowMove {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.form-glow-wrap .form-container {
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: var(--fk-radius-xl);
}

/* ================= GLASS FORM ================= */
.form-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;

  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  border-radius: var(--fk-radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--fk-shadow);

  padding: 2rem 1.5rem;
  animation: fadeZoomIn 0.75s ease-out forwards;
  overflow: hidden;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.form-container:hover {
  box-shadow: var(--fk-shadow-hover);
  transform: translateY(-2px);
}

.form-container .form-label {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--fk-text);
  margin-bottom: 0.35rem;
}

.form-container .form-control,
.form-container .form-select {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 0.65rem;
  color: var(--fk-text);
  padding: 0.6rem 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-container .form-control:focus-visible,
.form-container .form-select:focus-visible {
  border-color: var(--fk-accent-deep);
  box-shadow: 0 0 0 1px var(--fk-focus), 0 0 0 4px var(--fk-focus-ring);
  outline: none;
}

.form-container .btn-success {
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-radius: 0.65rem;
  border: none;
  transition: background 0.2s, transform 0.15s;
}

.form-container .btn-success:hover {
  background: var(--fk-accent-hover);
}

.form-container .btn-success:active {
  transform: scale(0.99);
}

#mensajeEstado {
  font-size: 0.9rem;
  min-height: 1.5rem;
  color: var(--fk-muted);
}

.form-container .btn-success:focus-visible {
  outline: 2px solid var(--fk-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px var(--fk-focus-ring);
}

#formAuto {
  scroll-margin-top: 1.5rem;
}

#precios {
  scroll-margin-top: 1rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(
    165deg,
    var(--fk-bg) 0%,
    #e8eef5 42%,
    #eef2f7 58%,
    var(--fk-bg) 100%
  );
}

/* Fondo en movimiento: vídeo abstracto + velo + aurora (orbes) */
.precios-bg-motion {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.precios-bg-video {
  position: absolute;
  inset: -5%;
  width: 110%;
  height: 110%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.38;
  /* Bokeh cálido → tonos más fríos para armonizar con teal / slate */
  filter: saturate(0.72) hue-rotate(200deg) contrast(1.06) brightness(1.03);
  mix-blend-mode: soft-light;
}

.precios-bg-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    165deg,
    rgba(241, 245, 249, 0.9) 0%,
    rgba(232, 238, 245, 0.78) 42%,
    rgba(238, 242, 247, 0.82) 58%,
    rgba(241, 245, 249, 0.92) 100%
  );
  pointer-events: none;
}

.precios-orb {
  position: absolute;
  z-index: 2;
  border-radius: 50%;
  filter: blur(68px);
  will-change: transform;
  opacity: 0.62;
}

.precios-orb--1 {
  width: min(90vw, 400px);
  height: min(90vw, 400px);
  background: radial-gradient(
    circle,
    rgba(13, 148, 136, 0.42) 0%,
    rgba(13, 148, 136, 0.08) 55%,
    transparent 70%
  );
  top: -12%;
  left: -18%;
  animation: preciosOrb1 22s ease-in-out infinite;
}

.precios-orb--2 {
  width: min(85vw, 360px);
  height: min(85vw, 360px);
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.22) 0%,
    rgba(59, 130, 246, 0.06) 50%,
    transparent 72%
  );
  top: 28%;
  right: -22%;
  animation: preciosOrb2 19s ease-in-out infinite;
  animation-delay: -6s;
}

.precios-orb--3 {
  width: min(75vw, 300px);
  height: min(75vw, 300px);
  background: radial-gradient(
    circle,
    rgba(148, 163, 184, 0.38) 0%,
    rgba(148, 163, 184, 0.1) 55%,
    transparent 74%
  );
  bottom: -24%;
  left: 18%;
  animation: preciosOrb3 25s ease-in-out infinite;
  animation-delay: -12s;
}

@keyframes preciosOrb1 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  45% {
    transform: translate(14%, 16%) scale(1.1);
  }
  70% {
    transform: translate(4%, -6%) scale(0.96);
  }
}

@keyframes preciosOrb2 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  40% {
    transform: translate(-12%, 14%) scale(1.08);
  }
  75% {
    transform: translate(-18%, -8%) scale(1.02);
  }
}

@keyframes preciosOrb3 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  35% {
    transform: translate(10%, -14%) scale(1.06);
  }
  60% {
    transform: translate(-8%, 12%) scale(0.94);
  }
}

@media (prefers-reduced-motion: reduce) {
  .precios-bg-video {
    display: none;
  }

  .precios-orb {
    animation: none !important;
    opacity: 0.28;
  }
}

#precios > .container {
  position: relative;
  z-index: 1;
}

#precios .section-heading {
  color: var(--fk-text);
}

#precios .section-lead.text-secondary {
  color: var(--fk-muted) !important;
}

/* Fondo animado suave detrás del formulario */
.form-bg-animation {
  position: absolute;
  inset: -40%;
  background: radial-gradient(
    ellipse at 30% 20%,
    rgba(13, 148, 136, 0.12) 0%,
    transparent 55%
  ),
  radial-gradient(
    ellipse at 70% 80%,
    rgba(59, 130, 246, 0.08) 0%,
    transparent 50%
  );
  z-index: -1;
  pointer-events: none;
}

/* ================= FRANJA INFERIOR HEADER ================= */
.site-strip {
  background: var(--fk-strip);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

.site-strip .bi {
  opacity: 0.9;
  margin-right: 0.35rem;
}

/* ================= SECCIONES MAIN ================= */
.section-muted {
  background: linear-gradient(180deg, var(--fk-bg) 0%, #e2e8f0 100%);
}

.section-heading {
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  letter-spacing: -0.02em;
  color: var(--fk-text);
}

.section-lead {
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.info-card {
  border-radius: var(--fk-radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--fk-surface);
  box-shadow: var(--fk-shadow);
}

.info-card .card-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.info-card .card-text {
  color: var(--fk-muted);
  margin-bottom: 0;
}

.info-card-narrow {
  max-width: 640px;
}

.info-card-icon {
  color: var(--fk-accent);
}

/* ================= PRODUCTOS ================= */
.category-section {
  background: var(--fk-surface) !important;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--fk-text);
}

.category-section .section-heading {
  color: var(--fk-text);
}

.category-section .section-lead.text-secondary {
  color: var(--fk-muted) !important;
}

.card {
  background: var(--fk-surface);
  color: var(--fk-text);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--fk-radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:not(.product-tilt-card):hover {
  transform: translateY(-4px);
  box-shadow: var(--fk-shadow-hover);
}

#productos-container .product-tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.12s ease-out, box-shadow 0.3s ease;
}

#productos-container .product-tilt-card:hover {
  box-shadow: var(--fk-shadow-hover);
}

.card-img-top {
  height: 220px;
  object-fit: cover;
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.5rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fk-text);
  line-height: 1.35;
}

.card-text {
  font-size: 0.875rem;
  color: var(--fk-muted);
  white-space: normal;
  overflow: visible;
  word-wrap: break-word;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fk-accent);
  letter-spacing: -0.02em;
}

.card .btn-success {
  margin-top: auto;
  font-weight: 600;
  border-radius: 0.65rem;
  padding: 0.55rem 1rem;
}

/* ================= FOOTER ================= */
.site-footer {
  background: var(--fk-strip);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer a:focus-visible {
  outline: 2px solid var(--fk-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ================= MAPA ================= */
.map-responsive {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.map-responsive iframe {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ================= ANIMACIÓN ================= */
@keyframes fadeZoomIn {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(16px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ================= UTILIDADES ================= */
html,
body {
  width: 100%;
  max-width: 100%;
}

* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1080px;
}

/* Focus visible accesible (enlace genérico / botones fuera del formulario) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--fk-focus);
  outline-offset: 3px;
}

header a:focus-visible,
.category-section a:focus-visible {
  outline-color: var(--fk-accent-deep);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress {
    transition: none;
  }

  .hero-form::after {
    display: none;
  }

  .form-glow-wrap {
    animation: none;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    background-size: 100% 100%;
    box-shadow: var(--fk-shadow);
  }

  .hero-reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-title--shine {
    animation: none !important;
    background: none !important;
    color: var(--fk-page-text) !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
  }
}
