/* ========================================
   SERVICES PAGE - CSS OPTIMIZADO
   Diseño profesional con mejoras visuales
======================================== */

/* ========================================
   VARIABLES ESPECÍFICAS SERVICIOS
======================================== */
:root {
  /* Colores específicos para servicios */
  --service-primary: #3b82f6;
  --service-secondary: #06b6d4;
  --service-accent: #10b981;
  --service-warning: #4f5ebb;
  
  /* Gradientes para servicios */
  --gradient-service-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  --gradient-featured: linear-gradient(135deg, var(--service-primary) 0%, var(--service-secondary) 100%);
  --gradient-badge: linear-gradient(45deg, var(--service-accent) 0%, #059669 100%);
  
  /* Iconos y efectos */
  --icon-size: 3.5rem;
  --icon-size-mobile: 2.5rem;
}

/* ========================================
   SECCIÓN SERVICIOS PRINCIPAL
======================================== */
.services.section {
  padding: var(--space-20) 0;
  background: var(--gradient-subtle);
  position: relative;
  overflow: hidden;
}

.services.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* ========================================
   HEADER DE SERVICIOS
======================================== */
.services-header {
  text-align: center;
  margin-bottom: var(--space-16);
  position: relative;
  z-index: 1;
}

.section-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: var(--space-4);
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.section-subtitle {
  font-size: var(--text-xl);
  color: var(--medium-gray);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
  font-weight: 300;
}

/* ========================================
   GRID DE SERVICIOS
======================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-16);
  position: relative;
  z-index: 1;
}

/* ========================================
   CARDS DE SERVICIOS
======================================== */
.service-card {
  background: var(--gradient-service-card);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:hover {
  transform: translateY(-12px);
  box-shadow: var(--shadow-2xl);
}

/* Servicio destacado */
.featured-service {
  position: relative;
  background: linear-gradient(145deg, #ffffff 0%, rgba(59, 130, 246, 0.02) 100%);
  border: 2px solid rgba(59, 130, 246, 0.1);
}

.featured-service::before {
  background: var(--gradient-featured);
}

.featured-service .service-badge {
  position: absolute;
  top: -1px;
  right: var(--space-6);
  background: var(--gradient-badge);
  color: white;
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

/* ========================================
   ICONOS DE SERVICIOS
======================================== */
.service-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-blue);
  position: relative;
}

.service-icon i {
  font-size: 1.75rem;
  color: white;
}

.service-icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.service-card:hover .service-icon::after {
  opacity: 0.2;
}

/* ========================================
   CONTENIDO DE SERVICIOS
======================================== */
.service-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.service-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: var(--space-4);
  line-height: 1.3;
}

.service-description {
  color: var(--medium-gray);
  line-height: 1.6;
  margin-bottom: var(--space-6);
  font-size: var(--text-base);
}

.service-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-8) 0;
  flex: 1;
}

.service-features li {
  padding: var(--space-2) 0;
  color: var(--dark-gray);
  position: relative;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.service-features li {
  display: flex;
  align-items: flex-start;   /* alinear icono y texto arriba */
  gap: 8px;                  /* espacio entre ✓ y texto */
  position: relative;        /* ya no necesitas absolute */
  padding-left: 0;           /* quita padding si lo habías puesto para el icono */
}

.service-features li::before {
  content: '✓';
  color: var(--service-accent);
  font-weight: 700;
  font-size: 1rem;
  position: static;          /* deja que fluya dentro del flex */
}

/* ========================================
   CTAs DE SERVICIOS
======================================== */
.service-cta {
  margin-top: auto;
  padding-top: var(--space-6);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.service-cta .btn {
  width: 100%;
  justify-content: center;
  gap: var(--space-2);
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.service-cta .btn-primary {
  background: var(--gradient-featured);
  box-shadow: var(--shadow-blue);
}

.service-cta .btn-secondary {
  background: white;
  color: var(--service-primary);
  border: 2px solid var(--service-primary);
}

.service-cta .btn-secondary:hover {
  background: var(--service-primary);
  color: white;
  transform: translateY(-2px);
}

/* Efecto ripple en botones */
.service-cta .btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: 0;
}

.service-cta .btn:active::before {
  width: 300px;
  height: 300px;
}

.service-cta .btn > * {
  position: relative;
  z-index: 1;
}

/* ========================================
   SERVICIOS ADICIONALES
======================================== */
.additional-services {
  text-align: center;
  margin-bottom: var(--space-16);
  padding: var(--space-12) var(--space-8);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 1;
}

.additional-services-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: var(--space-8);
  position: relative;
}

.additional-services-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--service-warning);
  border-radius: 1px;
}

.additional-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-6);
  max-width: 800px;
  margin: 0 auto;
}

.additional-service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.additional-service-item:hover {
  transform: translateY(-4px);
  background: white;
  box-shadow: var(--shadow-lg);
}

.additional-service-item i {
  font-size: 2rem;
  color: var(--gradient-featured);
  margin-bottom: var(--space-3);
}

.additional-service-item span {
  font-weight: 500;
  color: var(--dark-gray);
  text-align: center;
}

/* ========================================
   CTA FINAL DE SERVICIOS
======================================== */
.services-cta-section {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  background: var(--gradient-featured);
  color: white;
  border-radius: var(--radius-2xl);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.services-cta-section::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 1000 1000"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="1000" height="1000" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.services-cta-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

.services-cta-content h3 {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.services-cta-content p {
  font-size: var(--text-lg);
  line-height: 1.6;
  margin-bottom: var(--space-8);
  opacity: 0.9;
}

.services-cta-content .btn {
  background: white;
  color: var(--service-primary);
  font-weight: 700;
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  transition: all 0.3s ease;
  gap: var(--space-3);
}

.services-cta-content .btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2xl);
  background: rgba(255, 255, 255, 0.95);
}

/* ========================================
   RESPONSIVE DESIGN - SERVICIOS
======================================== */

/* Tablets */
@media (max-width: 991.98px) {
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
  }
  
  .service-card {
    padding: var(--space-6);
  }
  
  .additional-services {
    padding: var(--space-8) var(--space-4);
  }
}

/* Móviles */
@media (max-width: 575.98px) {
  .services.section {
    padding: var(--space-16) 0;
  }
  
  .services-header {
    margin-bottom: var(--space-12);
  }
  
  .section-title {
    font-size: var(--text-3xl);
  }
  
  .section-subtitle {
    font-size: var(--text-lg);
    padding: 0 var(--space-4);
  }
  
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .service-card {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
  }
  
  .service-icon {
    width: var(--icon-size-mobile);
    height: var(--icon-size-mobile);
    margin-bottom: var(--space-4);
  }
  
  .service-icon i {
    font-size: 1.25rem;
  }
  
  .service-title {
    font-size: var(--text-xl);
  }
  
  .service-description {
    font-size: var(--text-sm);
  }
  
  .service-features li {
    font-size: var(--text-sm);
    padding: var(--space-1) 0;
  }
  
  .additional-services {
    margin-bottom: var(--space-12);
    padding: var(--space-8) var(--space-4);
    border-radius: var(--radius-xl);
  }
  
  .additional-services-title {
    font-size: var(--text-xl);
  }
  
  .additional-services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .additional-service-item {
    padding: var(--space-4);
    border-radius: var(--radius-md);
  }
  
  .additional-service-item i {
    font-size: 1.5rem;
  }
  
  .services-cta-section {
    padding: var(--space-8) var(--space-4);
    border-radius: var(--radius-xl);
  }
  
  .services-cta-content h3 {
    font-size: var(--text-2xl);
  }
  
  .services-cta-content p {
    font-size: var(--text-base);
  }
  
  .services-cta-content .btn {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
  }
}

/* Landscape móvil */
@media (max-width: 991.98px) and (orientation: landscape) {
  .services.section {
    padding: var(--space-12) 0;
  }
  
  .services-header {
    margin-bottom: var(--space-10);
  }
  
  .services-cta-section {
    padding: var(--space-8) var(--space-4);
  }
}

/* ========================================
   ANIMACIONES DE ENTRADA
======================================== */
.service-card {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease-out forwards;
}

.service-card:nth-child(1) {
  animation-delay: 0.1s;
}

.service-card:nth-child(2) {
  animation-delay: 0.2s;
}

.service-card:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animaciones más suaves en móvil */
@media (max-width: 575.98px) {
  @keyframes fadeInUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .service-card:hover {
    transform: translateY(-4px);
  }
}

/* ========================================
   MEJORAS DE ACCESIBILIDAD
======================================== */
.service-card:focus-within {
  outline: 3px solid var(--service-primary);
  outline-offset: 2px;
}

.btn:focus {
  outline: 3px solid var(--service-primary);
  outline-offset: 2px;
}

/* Reducir animaciones para usuarios con preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .service-card,
  .btn,
  .additional-service-item {
    transition: none;
    animation: none;
  }
  
  .service-card:hover,
  .additional-service-item:hover,
  .btn:hover {
    transform: none;
  }
}

/* ========================================
   OPTIMIZACIONES DE RENDIMIENTO
======================================== */
.service-card,
.additional-service-item {
  contain: layout style;
  will-change: transform;
}

.service-icon {
  contain: layout;
}

/* ========================================
   ESTADOS DE HOVER MEJORADOS DESKTOP
======================================== */
@media (min-width: 992px) {
  .service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
    z-index: 1;
  }
  
  .service-card:hover::after {
    left: 100%;
  }
  
  .service-content {
    position: relative;
    z-index: 2;
  }
}

/* ========================================
   DARK MODE SUPPORT
======================================== */
@media (prefers-color-scheme: dark) {
  .services.section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1a202c 100%);
  }
  
  .service-card {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
  }
  
  .service-title {
    color: #f8fafc;
  }

  .additional-services-title{
    color: #f8fafc;
  }
  
  .service-description {
    color: #cbd5e1;
  }
  
  .service-features li {
    color: #e2e8f0;
  }
  
  .additional-services {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .additional-service-item {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
  }
  .additional-service-item:hover {
    transform: translateY(-4px);
    background: rgba(30, 41, 59, 0.6);
    box-shadow: var(--shadow-lg);
  }
}