/* Estilos responsivos para servicios - Ocultar imágenes en móviles */

/* Desktop: prevenir desbordamiento manteniendo estética */
@media (min-width: 992px) {
  /* Aplicar overflow hidden solo en el área de servicios */
  .cm-service-ai-area {
    overflow-x: hidden;
  }
  
  /* Neutralizar márgenes negativos del row de Bootstrap */
  .cm-service-ai-wrap > .row {
    margin-left: 0;
    margin-right: 0;
  }
  
  /* Contener las imágenes dentro de cada título box */
  .cm-service-ai-title-box {
    position: relative;
    overflow: hidden; /* Evita que las imágenes se salgan del contenedor */
  }
  
  /* Optimizar posicionamiento del thumb-box para evitar desborde */
  .cm-service-ai-thumb-box {
    left: 8% !important;
    right: 8% !important;
    width: 84% !important; /* Reducir ligeramente el ancho */
    max-width: calc(100vw - 160px); /* Tope absoluto basado en viewport */
  }
}

/* Media queries para ocultar imágenes en dispositivos móviles */

/* Tablet y dispositivos más pequeños */
@media (max-width: 991px) {
  .cm-service-ai-thumb-box {
    display: none !important;
  }
  
  /* Ajustar el padding/margin de los títulos cuando no hay imágenes */
  .cm-service-ai-title-box {
    padding: 28px 24px !important;
    margin-bottom: 25px !important;
    border-radius: 15px;
    background: #ffffff !important;
    border: 2px solid #e5e7eb;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.12);
  }
  
  .cm-service-ai-title {
    margin-top: 0 !important;
    font-size: 24px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    text-align: center !important;
  }
  
  .cm-service-ai-title a {
    color: #1f2937 !important;
    text-decoration: none !important;
    display: block !important;
    padding: 8px 0 !important;
    font-family: system-ui, -apple-system, sans-serif !important;
    letter-spacing: 0.5px !important;
  }
}

/* Móvil */
@media (max-width: 767px) {
  .cm-service-ai-thumb-box {
    display: none !important;
  }
  
  .cm-service-ai-area {
    padding-top: 60px !important;
    padding-bottom: 80px !important;
  }
  
  .cm-service-ai-title-box {
    padding: 25px 20px !important;
    margin-bottom: 25px !important;
    border-radius: 15px;
    background: #ffffff !important;
    backdrop-filter: none;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }
  
  .cm-service-ai-title {
    font-size: 22px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    text-align: center !important;
  }
  
  .cm-service-ai-title a {
    color: #1f2937 !important;
    text-decoration: none !important;
    display: block !important;
    padding: 8px 0 !important;
    font-family: system-ui, -apple-system, sans-serif !important;
    letter-spacing: 0.5px !important;
  }
  
  .cm-service-ai-title-box:hover {
    background: #f8fafc !important;
    transform: translateY(-3px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(135, 81, 255, 0.25);
    border-color: #8b5cf6 !important;
  }
  
  .cm-service-ai-title-box.active {
    background: #f3f4f6 !important;
    border-color: #8b5cf6 !important;
    box-shadow: 0 6px 20px rgba(135, 81, 255, 0.3);
  }
  
  .cm-service-ai-title-box.active .cm-service-ai-title a {
    color: #7c3aed !important;
    font-weight: 800 !important;
  }
  
  .cm-service-ai-title-box:hover .cm-service-ai-title a {
    color: #6d28d9 !important;
  }
}

/* Móvil pequeño */
@media (max-width: 575px) {
  .cm-service-ai-thumb-box {
    display: none !important;
  }
  
  .cm-service-ai-area {
    padding-top: 50px !important;
    padding-bottom: 70px !important;
  }
  
  .cm-service-ai-title-box {
    padding: 22px 18px !important;
    margin-bottom: 22px !important;
    border-radius: 12px;
    background: #ffffff !important;
    border: 2px solid #e5e7eb;
  }
  
  .cm-service-ai-title {
    font-size: 20px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    text-align: center !important;
  }
  
  .cm-service-ai-title a {
    padding: 10px 0 !important;
    color: #1f2937 !important;
    font-family: system-ui, -apple-system, sans-serif !important;
    letter-spacing: 0.5px !important;
  }
  
  /* Mejorar el layout de la sección de título */
  .cm-service-ai-section-box {
    margin-bottom: 40px !important;
  }
  
  .cm-section-ai-title {
    font-size: 32px !important;
    line-height: 1.2 !important;
    margin-bottom: 20px !important;
    color: #1f2937 !important;
    font-weight: 800 !important;
  }
}

/* Asegurar que en desktop sí se muestren las imágenes */
@media (min-width: 992px) {
  .cm-service-ai-thumb-box {
    display: flex !important;
  }
}

/* Mejorar el diseño general en móviles */
@media (max-width: 767px) {
  .cm-service-ai-title-wrap {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 25px !important;
    padding: 0 20px !important;
    max-width: 100% !important;
  }
  
  .cm-service-ai-wrap {
    padding: 0 !important;
  }
  
  /* Centrar el contenedor */
  .cm-service-ai-area .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
    max-width: 100% !important;
  }
  
  /* Asegurar que el texto sea completamente legible */
  .cm-service-ai-title-box * {
    text-shadow: none !important;
  }
  
  /* Mejorar contraste para mejor legibilidad */
  .cm-service-ai-title a:hover {
    color: #4c1d95 !important;
  }
  
  /* Override cualquier estilo que pueda interferir */
  .cm-service-ai-title,
  .cm-service-ai-title a,
  .cm-service-ai-title-box {
    opacity: 1 !important;
    filter: none !important;
  }
  
  /* Asegurar que el fondo del área de servicios no interfiera */
  .cm-service-ai-area {
    background: #f9fafb !important;
  }
}
