/* --- SECCIÓN SERVICIOS --- */
.services-section {
  padding: 2rem 3rem 0rem 0rem;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.services-header {
  margin-bottom: 4rem;
}

.services-header .subtitle {
  color: var(--text-color);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

[data-theme="light"] .services-header .subtitle {
  color: var(--secundario); /* El subtítulo es dorado en modo claro */
}

.services-title {
  font-size: 3rem;
  line-height: 1.2;
  margin: 0 0 1.5rem 0;
  color: var(--text-color);
}

.services-title .highlight {
  color: var(--text-color);
  transition: color 0.3s ease;
}

[data-theme="light"] .services-title .highlight {
  color: var(--secundario); /* "su éxito" es dorado en modo claro */
}

.services-description {
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0.9;
  line-height: 1.6;
}

/* --- GRID DE TARJETAS --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: left;
}

.service-card {
  background-color: var(--bg-card); /* Usamos tu variable de fondo oscuro */
  border-radius: 16px;
  padding: 2.5rem;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    background-color 0.3s ease;
  border: 1px solid transparent; /* Preparado para el hover en modo claro */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Ajustes para el tema claro */
[data-theme="light"] .service-card {
  background-color: #ffffff; /* Tarjetas blancas en modo claro */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); /* Sombra suave */
}

.service-card:hover {
  transform: translateY(-5px);
}

[data-theme="light"] .service-card:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.card-icon {
  background-color: #f0f4f8; /* Fondo sutil para el ícono */
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  color: var(--bg-color); /* El ícono es del color principal oscuro */
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

[data-theme="light"] .card-icon {
  color: var(--secundario); /* Ícono dorado en modo claro */
  background-color: #fff9ed; /* Fondo doradito muy tenue */
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.expand-icon {
  color: var(--secundario);
  transition: transform 0.3s ease;
}

.card-summary {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-item {
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
  padding-bottom: 0.5rem;
}

.service-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.item-title {
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bullet {
  color: var(--secundario);
  font-size: 1.2rem;
  font-weight: bold;
}

/* --- ESTILOS DE EXPANSIÓN (ACORDEÓN) --- */
.service-detail {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 0.5rem;
  padding-left: 1.5rem;
  line-height: 1.5;
  /* Configuración para la animación de altura */
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.4s ease,
    opacity 0.4s ease;
}

/* Clases que se activan vía JavaScript */
.service-card.expanded .expand-icon {
  transform: rotate(180deg); /* Rota la flecha */
}

.service-card.expanded .service-detail {
  max-height: 150px; /* Valor arbitrario suficientemente grande para el contenido */
  opacity: 1;
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr); /* Pasa a 2 columnas en tablet */
  }
}

@media (max-width: 768px) {
  .services-section {
    padding: 4rem 1.5rem;
  }

  .services-title {
    font-size: 2.5rem;
  }

  .services-grid {
    grid-template-columns: 1fr; /* Pasa a 1 columna en móvil */
  }
}
