/* Alfanetworks - Paleta del logo: azul brillante, cian/teal, gris oscuro */
:root {
  --alfa-blue: #0091ff;
  --alfa-cyan: #06b6d4;
  --alfa-teal: #0d9488;
  --alfa-dark: #1e293b;
  --alfa-darker: #0f172a;
  --white: #ffffff;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --font: 'Outfit', -apple-system, sans-serif;
  --shadow: 0 4px 24px rgba(0, 145, 255, 0.12);
  --radius: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--alfa-dark);
  background: var(--white);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 42px;
  width: auto;
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  color: var(--alfa-dark);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--alfa-blue);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--alfa-dark);
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
}

/* Hero / Banner con video */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.6) 0%,
    rgba(6, 182, 212, 0.35) 50%,
    rgba(0, 145, 255, 0.4) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  max-width: 720px;
}

.hero-content h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--white);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-tagline {
  margin: 0 0 1.5rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255, 255, 255, 0.95);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--alfa-blue), var(--alfa-cyan));
  color: var(--white);
  box-shadow: 0 4px 20px rgba(0, 145, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 145, 255, 0.5);
}

/* Carrusel de clientes */
.clients-strip {
  padding: 2.5rem 0;
  background: var(--gray-100);
  overflow: hidden;
}

.clients-track {
  display: flex;
  width: max-content;
  animation: carousel 25s linear infinite;
}

.clients-slide {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 0 3rem;
  flex-shrink: 0;
}

.client-logo {
  flex-shrink: 0;
  width: 160px;
  height: 70px;
  background: var(--white);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.client-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

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

/* Bloques de contenido */
.block {
  padding: 4rem 1.5rem;
}

.block-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.block-inner.reverse {
  direction: rtl;
}

.block-inner.reverse > * {
  direction: ltr;
}

.block-content h2 {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  color: var(--alfa-dark);
  line-height: 1.3;
}

.block-content p {
  margin: 0 0 1rem;
  color: var(--alfa-dark);
  opacity: 0.9;
}

.block-content .btn {
  margin-top: 0.5rem;
}

.block-media {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.block-img {
  aspect-ratio: 16/10;
  background-size: cover;
  background-position: center;
}

.block-img-dashboard {
  background-image: url('../assets/dash.png');
}

.block-img-cameras {
  background-image: url('../assets/cam.jpeg');
}

.block-img-internet {
  background: linear-gradient(135deg, var(--alfa-cyan), var(--alfa-blue));
  background-image: url('https://images.unsplash.com/photo-1544197150-b99a580bb7a8?w=800');
}

@media (max-width: 900px) {
  .block-inner,
  .block-inner.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .block-media {
    order: -1;
  }
}

/* Cuadrícula de apps */
.apps-grid-section {
  padding: 4rem 1.5rem;
  background: linear-gradient(180deg, var(--gray-100) 0%, var(--white) 100%);
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin: 0 0 2.5rem;
  color: var(--alfa-dark);
}

.apps-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.app-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.app-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  text-decoration: none;
  border-radius: var(--radius);
}

.app-card-overlay:focus-visible {
  outline: 3px solid var(--alfa-cyan);
  outline-offset: 3px;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 145, 255, 0.18);
}

.app-card-number {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  width: 32px;
  height: 32px;
  background: var(--alfa-dark);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 1;
}

.app-card-img {
  position: relative;
  aspect-ratio: 16/10;
}

.app-card-body {
  padding: 1.25rem;
}

.app-card-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--alfa-dark);
}

.app-card-body p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--alfa-dark);
  opacity: 0.85;
}

@media (max-width: 768px) {
  .apps-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.footer {
  background: var(--alfa-darker);
  color: var(--white);
  padding: 3rem 1.5rem 1.5rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 2rem;
  align-items: start;
}

.footer-brand-name {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.footer-brand p {
  margin: 0;
  opacity: 0.85;
  font-size: 0.95rem;
}

.footer-contact h3,
.footer-social h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.footer-contact p {
  margin: 0.25rem 0;
}

.footer-contact a,
.footer-social a {
  color: var(--white);
  text-decoration: none;
  opacity: 0.9;
}

.footer-contact a:hover,
.footer-social a:hover {
  opacity: 1;
  color: var(--alfa-cyan);
}

.footer-social a {
  display: inline-block;
  width: 40px;
  height: 40px;
  margin-right: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  text-align: center;
  line-height: 40px;
  font-size: 1.2rem;
  transition: background 0.2s;
}

.footer-social a:hover {
  background: var(--alfa-cyan);
}

.footer-bottom {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.8;
}

@media (max-width: 700px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

/* WhatsApp flotante */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  background: #25d366;
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
  z-index: 98;
  transition: transform 0.2s;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  color: var(--white);
}

/* Chatbot */
.chatbot-widget {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 99;
}

.chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--alfa-blue), var(--alfa-cyan));
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0, 145, 255, 0.45);
  transition: transform 0.2s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-toggle:hover {
  transform: scale(1.05);
}

.chatbot-logo-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.chatbot-headset {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  background: var(--alfa-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.chatbot-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 2rem);
  height: 420px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chatbot-panel[hidden] {
  display: none;
}

.chatbot-header {
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--alfa-blue), var(--alfa-cyan));
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chatbot-panel-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.chatbot-header span {
  flex: 1;
  font-weight: 600;
}

.chatbot-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chatbot-msg {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

.chatbot-msg.bot {
  align-self: flex-start;
  background: var(--gray-100);
  color: var(--alfa-dark);
}

.chatbot-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--alfa-blue), var(--alfa-cyan));
  color: var(--white);
}

.chatbot-input-wrap {
  padding: 0.75rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 0.5rem;
}

.chatbot-input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 24px;
  font-family: var(--font);
  font-size: 0.9rem;
}

.chatbot-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--alfa-blue), var(--alfa-cyan));
  color: var(--white);
  cursor: pointer;
  transition: opacity 0.2s;
}

.chatbot-send:hover {
  opacity: 0.9;
}

@media (max-width: 480px) {
  .chatbot-widget {
    right: 1rem;
    bottom: 5rem;
  }
  .whatsapp-float {
    right: 1rem;
    bottom: 1rem;
  }
}
