/* ========================================
   FOOTER STYLES
======================================== */

.footer {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #0f172a 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
  margin-top: auto;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="footer-grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.02)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23footer-grid)"/></svg>');
  pointer-events: none;
}

/* Contenido principal del footer */
.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
  gap: var(--space-12);
  padding: var(--space-20) 0 var(--space-16);
  position: relative;
  z-index: 1;
}

/* ========================================
   SECCIÓN DE MARCA
======================================== */

.footer-brand {
  max-width: 350px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.footer-logo-img {
  width: 40px;
  height: 40px;
}

.footer-logo-text {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.05em;
}

.footer-tagline {
  font-size: var(--text-base);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-8);
  font-weight: 300;
}

/* Redes sociales */
.footer-social {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.social-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-decoration: none;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.social-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.social-icon.whatsapp:hover {
  background: #25d366;
  border-color: #25d366;
  color: var(--white);
}

.social-icon i {
  font-size: var(--text-lg);
}

/* ========================================
   SECCIONES DE ENLACES
======================================== */

.footer-links {
  display: flex;
  flex-direction: column;
}

.footer-links-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--white);
  margin-bottom: var(--space-6);
  position: relative;
}

.footer-links-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 1px;
}

/* Listas de navegación */
.footer-nav-list,
.footer-services-list,
.footer-legal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-nav-link,
.footer-service-link,
.footer-legal-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: all var(--transition-base);
  position: relative;
  padding-left: var(--space-4);
}

.footer-nav-link::before,
.footer-service-link::before,
.footer-legal-link::before {
  content: '→';
  position: absolute;
  left: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition-base);
  color: var(--primary-blue-light);
}

.footer-nav-link:hover,
.footer-service-link:hover,
.footer-legal-link:hover {
  color: var(--white);
  padding-left: var(--space-6);
}

.footer-nav-link:hover::before,
.footer-service-link:hover::before,
.footer-legal-link:hover::before {
  opacity: 1;
  transform: translateX(0);
}

/* ========================================
   SECCIÓN DE CONTACTO
======================================== */

.footer-contact {
  display: flex;
  flex-direction: column;
}

.footer-contact-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--white);
  margin-bottom: var(--space-6);
  position: relative;
}

.footer-contact-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 1px;
}

.footer-contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.footer-contact-item i {
  width: 20px;
  color: var(--primary-blue-light);
  font-size: var(--text-base);
  flex-shrink: 0;
}

.footer-contact-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color var(--transition-base);
}

.footer-contact-link:hover {
  color: var(--white);
}

.footer-contact-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--text-sm);
}

/* Newsletter */
.footer-newsletter {
  background: rgba(255, 255, 255, 0.05);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.newsletter-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--white);
  margin-bottom: var(--space-2);
}

.newsletter-description {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.newsletter-input-group {
  display: flex;
  gap: var(--space-2);
}

.newsletter-input {
  flex: 1;
  padding: var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: var(--text-sm);
  transition: all var(--transition-base);
  backdrop-filter: blur(5px);
}

.newsletter-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--primary-blue-light);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.newsletter-btn {
  padding: var(--space-3);
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: var(--white);
  cursor: pointer;
  transition: all var(--transition-base);
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.newsletter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ========================================
   SEPARADOR Y FOOTER BOTTOM
======================================== */

.footer-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  margin: var(--space-8) 0;
  position: relative;
  z-index: 1;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-8) 0;
  position: relative;
  z-index: 1;
}

.footer-copyright p {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.footer-copyright p:last-child {
  margin-bottom: 0;
}

.footer-subtitle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-subtitle i {
  color: #ef4444;
  animation: pulse 2s infinite;
}

/* Certificaciones */
.footer-certifications {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition-base);
}

.cert-item:hover {
  color: var(--white);
}

.cert-item i {
  color: var(--accent-cyan-light);
  font-size: var(--text-sm);
}

/* ========================================
   BOTÓN BACK TO TOP
======================================== */

.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  z-index: 1000;
  box-shadow: var(--shadow-xl);
  transition: all var(--transition-base);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2xl);
}

.back-to-top i {
  font-size: var(--text-lg);
}

/* ========================================
   BANNER DE COOKIES
======================================== */

.cookies-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--space-4) 0;
  z-index: 9999;
  animation: slideInUp 0.5s ease-out;
}

.cookies-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.cookies-text {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
}

.cookies-text i {
  color: #f59e0b;
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.cookies-text p {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--text-sm);
  line-height: 1.5;
  margin: 0;
}

.cookies-link {
  color: var(--primary-blue-light);
  text-decoration: underline;
  transition: color var(--transition-base);
}

.cookies-link:hover {
  color: var(--white);
}

.cookies-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

.cookies-btn {
  padding: var(--space-2) var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
}

.cookies-accept {
  background: var(--primary-blue);
  color: var(--white);
  border-color: var(--primary-blue);
}

.cookies-accept:hover {
  background: var(--primary-blue-dark);
  transform: translateY(-1px);
}

.cookies-decline {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
}

.cookies-decline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.cookies-settings {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border-color: transparent;
  padding: var(--space-2);
  min-width: 36px;
}

.cookies-settings:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   ANIMACIONES ESPECÍFICAS
======================================== */

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

/* Animación de entrada para las secciones del footer */
.footer-brand,
.footer-links,
.footer-contact {
  animation: fadeInUp 0.6s ease-out backwards;
}

.footer-brand { animation-delay: 0.1s; }
.footer-links:nth-of-type(2) { animation-delay: 0.2s; }
.footer-links:nth-of-type(3) { animation-delay: 0.3s; }
.footer-links:nth-of-type(4) { animation-delay: 0.4s; }
.footer-contact { animation-delay: 0.5s; }

/* Efectos hover para mejorar UX */
.footer-newsletter:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Micro-animaciones para los iconos sociales */
.social-icon {
  position: relative;
  overflow: hidden;
}

.social-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.6s ease;
}

.social-icon:hover::before {
  width: 100%;
  height: 100%;
}

/* -----------------------------
   AJUSTES FINOS PARA MÓVIL PEQUEÑO
   ----------------------------- */
@media (max-width: 575.98px) {

  /* Layout a 1 columna y centrar items de la grid */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding: var(--space-12) 0 var(--space-8);
    justify-items: center;   /* centra los elementos de la grid */
    text-align: center;      /* por defecto, centra texto */
  }

  /* Forzar anchuras y centrar bloques internos */
  .footer-brand,
  .footer-links,
  .footer-contact,
  .footer-newsletter {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    align-items: center;
  }

  .footer-logo { justify-content: center; }
  .footer-tagline { margin-left: 0; margin-right: 0; }

  /* Social icons centrados */
  .footer-social { justify-content: center; }

  /* Listas y enlaces centrados */
  .footer-links { align-items: center; }
  .footer-nav-list,
  .footer-services-list,
  .footer-legal-list {
    align-items: center;
    padding: 0;
  }
  .footer-nav-link,
  .footer-service-link,
  .footer-legal-link {
    padding-left: 0; /* quita el offset para que no aparezcan desplazados */
    margin-left: 0;
  }

  /* Contact y newsletter centrados */
  .footer-contact-info { align-items: center; }
  .footer-newsletter { margin: 0 auto; }

  .newsletter-input-group {
    justify-content: center;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }

  /* Footer bottom: apilar y centrar */
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
    text-align: center;
    padding-top: var(--space-4);
  }

  .footer-certifications {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-top: var(--space-4);
  }

  .cert-item { justify-content: center; }

  .footer-separator { margin: var(--space-6) 0; width: 100%; }

  /* IMPORTANT: Centrar los pseudo-elementos ::after (la línea degradada) */
  .footer-links-title::after,
  .footer-contact-title::after,
  .newsletter-title::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .footer-content {
    padding: var(--space-8) var(--space-4);
    gap: var(--space-6);
  }

  .footer-logo-img { width: 36px; height: 36px; }
  .footer-logo-text { font-size: var(--text-xl); }

  /* Newsletter: apilar inputs y botones */
  .newsletter-input-group {
    flex-direction: column;
    gap: var(--space-3);
    align-items: stretch;
  }
  .newsletter-input { width: 100%; }
  .newsletter-btn { width: 100%; max-width: 160px; margin: 0 auto; }

  /* Separación de títulos */
  .footer-links-title,
  .footer-contact-title,
  .newsletter-title {
    margin-bottom: var(--space-3);
  }

  /* Ajuste de la línea ::after en móvil para que quede un pelín más cercana */
  .footer-links-title::after,
  .footer-contact-title::after,
  .newsletter-title::after {
    bottom: -6px;
  }
}
/* ========================================
   DARK MODE SUPPORT
======================================== */
@media (prefers-color-scheme: dark) {
  .footer {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
  }

  .footer::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="footer-grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23footer-grid)"/></svg>');
  }

  .footer-logo-text {
    color: #f8fafc;
  }

  .footer-tagline {
    color: rgba(248, 250, 252, 0.8);
  }

  .social-icon {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .social-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
  }

  .footer-links-title,
  .footer-contact-title {
    color: #f8fafc;
  }

  .footer-nav-link,
  .footer-service-link,
  .footer-legal-link {
    color: rgba(226, 232, 240, 0.8);
  }

  .footer-nav-link:hover,
  .footer-service-link:hover,
  .footer-legal-link:hover {
    color: #f8fafc;
  }

  .footer-contact-link {
    color: rgba(226, 232, 240, 0.8);
  }

  .footer-contact-link:hover {
    color: #f8fafc;
  }

  .footer-contact-text {
    color: rgba(226, 232, 240, 0.8);
  }

  .footer-newsletter {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .footer-newsletter:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
  }

  .newsletter-title {
    color: #f8fafc;
  }

  .newsletter-description {
    color: rgba(226, 232, 240, 0.7);
  }

  .newsletter-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
  }

  .newsletter-input::placeholder {
    color: rgba(226, 232, 240, 0.5);
  }

  .newsletter-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
  }

  .footer-separator {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
  }

  .footer-copyright p {
    color: rgba(226, 232, 240, 0.6);
  }

  .cert-item {
    color: rgba(226, 232, 240, 0.6);
  }

  .cert-item:hover {
    color: #f8fafc;
  }

  .cookies-banner {
    background: rgba(2, 6, 23, 0.98);
    border-top-color: rgba(255, 255, 255, 0.08);
  }

  .cookies-text p {
    color: rgba(226, 232, 240, 0.9);
  }

  .cookies-link {
    color: #60a5fa;
  }

  .cookies-link:hover {
    color: #f8fafc;
  }

  .cookies-btn {
    border-color: rgba(255, 255, 255, 0.1);
  }

  .cookies-accept {
    background: #3b82f6;
    border-color: #3b82f6;
  }

  .cookies-accept:hover {
    background: #1d4ed8;
  }

  .cookies-decline {
    color: rgba(226, 232, 240, 0.8);
  }

  .cookies-decline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
  }

  .cookies-settings {
    color: rgba(226, 232, 240, 0.6);
  }

  .cookies-settings:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
  }

  .social-icon::before {
    background: rgba(255, 255, 255, 0.1);
  }
}