/* ===================================================================
   CUOTASPAY NEGOCIOS - STYLES & GSAP PARALLAX ANIMATIONS
   Diseño de Precisión, Alineación Perfecta y Micro-Interacciones
   =================================================================== */

:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* Evitar desbordamiento horizontal y desalineaciones de scroll */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #090d16;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Ocultar barra de scroll en contenedores horizontales */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Parallax Ambient Orbs Background */
#parallaxBg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  max-width: 100vw;
}
#parallaxGrid {
  position: absolute;
  inset: -10% 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.parallax-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.28;
  will-change: transform;
  pointer-events: none;
}
.parallax-icon {
  position: absolute;
  color: rgba(148, 163, 184, 0.06);
  will-change: transform;
  pointer-events: none;
}

/* Barra de progreso de scroll superior */
#scrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, #3b82f6, #06b6d4, #10b981);
}

/* Header Sticky y Compactación Suave */
#mainHeader {
  transition: background-color 0.25s ease, backdrop-filter 0.25s ease, box-shadow 0.25s ease;
}
#mainHeader.header-scrolled {
  background-color: rgba(15, 23, 42, 0.88) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Tarjetas KPI y Paneles */
.kpi-card {
  transform-style: preserve-3d;
  will-change: transform;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.6), 0 0 15px -3px rgba(14, 165, 233, 0.15);
}

/* Botones con física táctil Emil Kowalski */
button, .btn-bounce {
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), background-color 0.15s ease, box-shadow 0.15s ease;
}
button:active, .btn-bounce:active {
  transform: scale(0.96) !important;
}

/* Pestañas de Navegación */
.tab-btn {
  position: relative;
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.tab-btn.active {
  color: #38bdf8 !important;
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 9999px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

/* Barra inferior móvil (Dock de navegación táctil) */
.mobile-bottom-bar {
  padding-bottom: calc(var(--sab) + 6px);
}
.mobile-nav-item.active {
  color: #38bdf8;
}

/* Modales Responsivos */
@media (max-width: 767px) {
  .modal-dialog-responsive {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 !important;
    max-height: 90vh;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 1.5rem !important;
    border-top-right-radius: 1.5rem !important;
    animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
}

@keyframes slideUpModal {
  from {
    transform: translateY(100%);
    opacity: 0.8;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Impresión */
@media print {
  #parallaxBg, #scrollProgress, #heroSection, .mobile-bottom-bar, #mainHeader {
    display: none !important;
  }
  body * {
    visibility: hidden;
  }
  #modalQrStep, #modalQrStep * {
    visibility: visible;
  }
  #modalQrStep {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white !important;
    color: black !important;
    padding: 20px;
  }
}
