/* ============================================================
   SOFTREK — COMPONENTES COMUNES
   ============================================================
   Componentes que aparecen en varias páginas y antes vivían
   duplicados en el <style> inline de cada HTML.
   ============================================================ */


/* ============================================================
   FINAL CTA — sección oscura "¿Listos?" al cierre de página
   ============================================================
   Aparece en 9 páginas: productos, servicios, nosotros,
   los 5 servicio-* y proyecto-hycmex.
   Markup base:
     <section class="final-cta" data-cursor-mode="dark">
       <div class="final-cta-inner" data-animate-stagger>
         <h2><span class="strong">…</span> …</h2>
         <p>…</p>
         <button class="btn-cta-white">…</button>
       </div>
     </section>
   ============================================================ */

.final-cta {
  background: var(--footer-bg, #06061a);
  color: #fff;
  padding: 120px var(--side-padding);
  text-align: center;
}
.final-cta-inner {
  max-width: 900px;
  margin: 0 auto;
}
.final-cta h2 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -1.5px;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 18px;
  color: #fff;
}
.final-cta h2 .strong {
  font-weight: 400;
  font-style: normal;
}
.final-cta p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Wrapper para varios botones lado a lado */
.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Botón blanco sólido — acción primaria sobre fondo oscuro */
.btn-cta-white {
  background: #fff;
  color: var(--footer-bg, #06061a);
  border: none;
  padding: 16px 32px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  display: inline-block;
}
.btn-cta-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.15);
}

/* ============================================================
   BOTTOM CTA — variante clara del cierre de página
   ============================================================
   Usa el fondo crema del sitio (no es sección oscura), max-width
   centrado y un separador hairline arriba. Pensado para páginas
   donde el final-cta oscuro sería visualmente pesado.
   Markup base:
     <section class="bottom-cta" data-animate-stagger>
       <h2>… <span class="italic">…</span></h2>
       <p>…</p>  (opcional)
       <a href="contacto.html" class="btn-primary">…</a>
     </section>
   ============================================================ */

.bottom-cta {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 120px var(--side-padding);
  text-align: center;
  border-top: 1px solid var(--hairline);
}
.bottom-cta h2 {
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.1;
  letter-spacing: -1.5px;
  font-weight: 400;
  margin-bottom: 24px;
}
.bottom-cta h2 .strong { font-weight: 400; }
.bottom-cta h2 .italic { font-style: italic; font-weight: 600; }
.bottom-cta p {
  font-size: 16px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

/* Tamaño más generoso del btn-primary cuando vive dentro de bottom-cta */
.bottom-cta .btn-primary {
  padding: 18px 36px;
}
.bottom-cta .btn-primary:hover {
  box-shadow: 0 10px 30px rgba(10, 10, 26, 0.2);
}


/* Botón outline — acción secundaria sobre fondo oscuro */
.btn-cta-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 16px 28px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  display: inline-block;
}
.btn-cta-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.45);
}


/* ============================================================
   STATS SECTION — bloque grande con eyebrow + count-up
   ============================================================
   Usado en index.html. Layout 4 columnas con números enormes
   (clamp 48–96px) en italic 600, suffix opcional (+, M, %) en
   menor tamaño al lado del número.
   Markup:
     <section class="stats-section">
       <div class="stats-section-inner">
         <div class="stats-section-label" data-animate>Eyebrow</div>
         <div class="stats-grid" data-animate-stagger>
           <div class="stat-block">
             <div class="stat-number">
               <span data-count-to="240">0</span><span class="stat-number-suffix">+</span>
             </div>
             <div class="stat-label">Descripción…</div>
           </div>
           …
         </div>
       </div>
     </section>
   ============================================================ */

.stats-section {
  background: var(--bg);
  padding: 140px var(--side-padding) 100px;
  position: relative;
  z-index: 2;
}
.stats-section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.stats-section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(10, 10, 26, 0.55);
  margin-bottom: 56px;
  position: relative;
  padding-top: 12px;
}
.stats-section-label::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40px;
  height: 2px;
  background: var(--violet);
  box-shadow: 0 0 12px rgba(99, 0, 255, 0.3);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(32px, 4vw, 80px);
}
.stat-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stat-number {
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -3px;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.stat-number-suffix {
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--ink);
  font-style: normal;
}
.stats-section .stat-label {
  font-size: 14px;
  color: rgba(10, 10, 26, 0.55);
  line-height: 1.4;
  max-width: 200px;
}

@media (max-width: 900px) {
  .stats-section { padding: 100px var(--side-padding) 70px; }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
}
@media (max-width: 500px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}


/* ============================================================
   STATS RAIL — rail horizontal sobrio (sin eyebrow)
   ============================================================
   Usado en nosotros.html. Números medianos (clamp 40–64px)
   en weight 200, con <span class="accent"> italic 700 para
   destacar dígitos. Border-bottom separa de la sección siguiente.
   Markup:
     <section class="stats-rail">
       <div class="stat" data-animate>
         <div class="stat-num">
           <span class="accent" data-count-to="200" data-count-prefix="+">+0</span>
         </div>
         <div class="stat-label">Descripción…</div>
       </div>
       …
     </section>
   ============================================================ */

.stats-rail {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px var(--side-padding);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  border-bottom: 1px solid var(--hairline);
}
.stats-rail .stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.stats-rail .stat-num {
  font-size: clamp(40px, 4vw, 64px);
  line-height: 1;
  letter-spacing: -2px;
  font-weight: 200;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}
.stats-rail .stat-num .accent {
  font-weight: 700;
  font-style: italic;
}
.stats-rail .stat-label {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  max-width: 200px;
}

@media (max-width: 900px) {
  .stats-rail {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}
@media (max-width: 560px) {
  .stats-rail { grid-template-columns: 1fr; }
}


/* ============================================================
   FAQ ACCORDION — preguntas frecuentes colapsables
   ============================================================
   Markup:
     <div class="faq-header">
       <h2>… <span class="italic">…</span></h2>
     </div>
     <div class="faq-list">
       <div class="faq-item">
         <div class="faq-question">
           <span>Pregunta…</span>
           <span class="faq-icon"><svg>+</svg></span>
         </div>
         <div class="faq-answer"><p>Respuesta…</p></div>
       </div>
       …
     </div>
   JS: en click sobre .faq-item, toggle de la clase .is-open.
   Selectores scopeados a .faq-list para no chocar con grids
   tipo .quick-faq (estilo contacto) que también usan .faq-item.
   ============================================================ */

.faq-header {
  text-align: center;
  margin-bottom: 60px;
}
.faq-header h2 {
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.0;
  letter-spacing: -2px;
  font-weight: 400;
}
.faq-header h2 .strong { font-weight: 400; }
.faq-header h2 .italic { font-style: italic; font-weight: 600; }

.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.faq-list .faq-item {
  border-top: 1px solid var(--hairline);
  padding: 24px 0;
  cursor: pointer;
}
.faq-list .faq-item:last-child {
  border-bottom: 1px solid var(--hairline);
}

.faq-list .faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.3px;
}
.faq-list .faq-question .italic {
  font-style: italic;
  font-weight: 600;
}

.faq-list .faq-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99, 0, 255, 0.08);
  color: var(--violet);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.3s ease,
    color 0.3s ease;
}
.faq-list .faq-icon svg { width: 14px; height: 14px; }
.faq-list .faq-item.is-open .faq-icon {
  transform: rotate(45deg);
  background: var(--violet);
  color: #fff;
}

.faq-list .faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), padding 0.3s ease;
}
.faq-list .faq-item.is-open .faq-answer {
  max-height: 200px;
  padding-top: 14px;
}
.faq-list .faq-answer p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 620px;
}


/* ============================================================
   FOOTER — bloque oscuro común a todas las páginas
   ============================================================
   Layout: 3 columnas (nav+social | brand | contact+legales).
   En mobile (<900px) colapsa a 1 columna centrada.
   ============================================================ */

.footer {
  background: var(--footer-bg, #06061a);
  color: rgba(255, 255, 255, 0.75);
  padding: 60px var(--side-padding);
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 60px;
}

/* --- Columna izquierda: navegación + redes sociales --- */
.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: opacity 0.2s ease;
  width: fit-content;
}
.footer-nav a:hover { opacity: 0.6; }

.footer-social {
  display: flex;
  gap: 18px;
  margin-top: 36px;
}
.footer-social a {
  color: #fff;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: inline-flex;
}
.footer-social a:hover {
  opacity: 1;
  transform: translateY(-2px);
}
.footer-social svg { width: 18px; height: 18px; }

/* --- Columna central: brand + powered by --- */
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.footer-logo {
  margin-bottom: 16px;
  line-height: 0;
}
.footer-logo img {
  height: 36px;
  width: auto;
  display: block;
  /* SVG ya es blanco; el fondo del footer es oscuro */
}
.footer-tagline {
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  line-height: 1.5;
  max-width: 320px;
  margin-bottom: auto;
}
.footer-powered {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  margin-top: 40px;
}

/* --- Columna derecha: contacto + legales --- */
.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}
.footer-contact-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}

.btn-contact {
  background: #fff;
  color: var(--footer-bg, #06061a);
  border: none;
  padding: 13px 28px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 48px;
  text-decoration: none;
  display: inline-block;
}
.btn-contact:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 255, 255, 0.12);
}

.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}
.footer-legal a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 13px;
  transition: opacity 0.2s ease;
}
.footer-legal a:hover { opacity: 0.6; }

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }
  .footer-nav { align-items: center; }
  .footer-contact { align-items: center; text-align: center; }
  .footer-legal { align-items: center; }
  .footer-social { justify-content: center; }
}


/* ==========================================================
   SERVICES GRID — Cards de servicios del home (4 cards en grid)
   Reemplaza el slider previo de service-card.
   ========================================================== */

.services-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--side-padding) 100px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.services-grid .card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: #ffffff;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  min-height: 320px;
  box-shadow: none;
  transition:
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    border-color 0.3s ease,
    background-color 0.3s ease,
    color 0.3s ease;
  overflow: hidden;
}
.services-grid .card:hover {
  transform: translateY(-6px);
  background: var(--violet);
  border-color: var(--violet);
  color: #ffffff;
  /* Glow morado centrado (sin offset = no es drop shadow) */
  box-shadow:
    0 0 24px rgba(99, 0, 255, 0.45),
    0 0 60px rgba(99, 0, 255, 0.20);
}

/* Inversión de elementos internos cuando la card está en hover */
.services-grid .card-num,
.services-grid .card-tag,
.services-grid .card-title,
.services-grid .card-desc {
  transition: color 0.3s ease, border-color 0.3s ease;
}
.services-grid .card:hover .card-num    { color: #ffffff; }
.services-grid .card:hover .card-tag    {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}
.services-grid .card:hover .card-title  { color: #ffffff; }
.services-grid .card:hover .card-desc   { color: rgba(255, 255, 255, 0.75); }

.services-grid .card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.services-grid .card-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.services-grid .card-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
}

.services-grid .card-title {
  font-size: clamp(22px, 1.8vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.8px;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 14px 0;
}
.services-grid .card-title em {
  font-style: italic;
  font-weight: 600;
}

.services-grid .card-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

.services-grid .card-footer {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.services-grid .card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(99, 0, 255, 0.06);
  color: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease, color 0.4s ease, transform 0.4s ease;
}
.services-grid .card-icon svg {
  width: 28px;
  height: 28px;
}
.services-grid .card:hover .card-icon {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: scale(1.06);
}

.services-grid .card-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(10, 10, 26, 0.04);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease, color 0.4s ease, transform 0.4s ease;
}
.services-grid .card-arrow svg { width: 16px; height: 16px; }
.services-grid .card:hover .card-arrow {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateX(4px);
}

/* ============ Animaciones de los íconos ============ */

/* icon-monitor: cursor parpadea como en un editor de código */
.services-grid .cursor-blink {
  animation: card-cursor-blink 1.2s steps(2, end) infinite;
}
@keyframes card-cursor-blink {
  50% { opacity: 0; }
}

/* icon-bot: antena se mueve, ojos parpadean */
.services-grid .bot-antenna {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: card-bot-wiggle 2.6s ease-in-out infinite;
}
@keyframes card-bot-wiggle {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(8deg); }
}
.services-grid .bot-eyes {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: card-bot-blink 3.4s ease-in-out infinite;
}
@keyframes card-bot-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%           { transform: scaleY(0.1); }
}

/* icon-server: LEDs pulsan en cascada */
.services-grid .server-led-1,
.services-grid .server-led-2,
.services-grid .server-led-3 {
  animation: card-led-pulse 1.6s ease-in-out infinite;
}
.services-grid .server-led-2 { animation-delay: 0.25s; }
.services-grid .server-led-3 { animation-delay: 0.50s; }
@keyframes card-led-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

/* icon-data: nodos pulsan en cascada, líneas fluyen */
.services-grid .data-node {
  transform-box: fill-box;
  transform-origin: center;
  animation: card-node-pulse 2.2s ease-in-out infinite;
}
.services-grid .data-node-2 { animation-delay: 0.4s; }
.services-grid .data-node-3 { animation-delay: 0.8s; }
@keyframes card-node-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50%      { transform: scale(1.25); opacity: 1; }
}
.services-grid .data-line,
.services-grid .data-line-2 {
  stroke-dasharray: 14;
  animation: card-line-flow 1.8s linear infinite;
}
.services-grid .data-line-2 { animation-delay: 0.4s; }
@keyframes card-line-flow {
  to { stroke-dashoffset: -14; }
}

/* Responsive */
@media (max-width: 1100px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .services-grid {
    grid-template-columns: 1fr;
    padding-bottom: 60px;
  }
  .services-grid .card { min-height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .services-grid .cursor-blink,
  .services-grid .bot-antenna,
  .services-grid .bot-eyes,
  .services-grid .server-led-1,
  .services-grid .server-led-2,
  .services-grid .server-led-3,
  .services-grid .data-node,
  .services-grid .data-line,
  .services-grid .data-line-2 {
    animation: none;
  }
}


/* ==========================================================
   CONTACT SECTION — CTA grande estilo "¿Listos para operar?"
   Eyebrow + título italic enorme + subtitle + 2 botones.
   Originalmente vivía inline en index.html; ahora compartido.
   ========================================================== */

.contact-section {
  background: var(--bg);
  padding: 140px var(--side-padding) 160px;
  position: relative;
}

.contact-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 36px;
  font-style: italic;
}

.contact-title {
  font-size: clamp(48px, 8vw, 104px);
  line-height: 1.05;
  letter-spacing: -3px;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 32px;
  max-width: 1000px;
}
.contact-title .strong {
  font-weight: 400;
  font-style: italic;
}
.contact-title .italic {
  font-style: italic;
  font-weight: 600;
}

.contact-subtitle {
  font-size: 15px;
  color: rgba(0, 0, 0, 0.5);
  margin-bottom: 40px;
}

.contact-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-primary-dark {
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 16px 32px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary-dark:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.btn-secondary-light {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(10, 10, 26, 0.25);
  padding: 16px 28px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.btn-secondary-light:hover {
  background: rgba(10, 10, 26, 0.05);
  border-color: rgba(10, 10, 26, 0.4);
}

@media (max-width: 768px) {
  .contact-section { padding: 80px var(--side-padding) 100px; }
  .contact-title { font-size: 44px; letter-spacing: -1.5px; }
}
