/* Estilos mejorados para Hero responsivo */

/* Reseteo del estilo original para permitir mejor control */
.cm-hero-ai-thumb {
  position: relative !important;
  right: auto !important;
  top: auto !important;
  width: 100% !important;
  bottom: auto !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 20px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.cm-hero-ai-thumb img {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: transform 0.3s ease !important;
  display: block !important;
  margin: 0 auto !important;
}

.cm-hero-ai-thumb img:hover {
  transform: scale(1.02) !important;
}

/* Ajustes para el contenido del texto */
.cm-hero-ai-content {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 20px !important;
  min-height: 400px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* Media queries para diferentes tamaños de pantalla */

/* Desktop grande */
@media (min-width: 1200px) {
  .cm-hero-ai-content {
    text-align: left;
    justify-content: flex-start;
  }
  
  .cm-hero-ai-thumb {
    padding: 30px !important;
    max-width: 100% !important;
  }
  
  .cm-hero-ai-thumb img {
    max-width: 500px !important;
    width: auto !important;
  }
}

/* Desktop mediano */
@media (min-width: 992px) and (max-width: 1199px) {
  .cm-hero-ai-thumb {
    padding: 25px !important;
  }
  
  .cm-hero-ai-thumb img {
    max-width: 400px !important;
    width: auto !important;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px) {
  .cm-hero-ai-content {
    min-height: 300px;
    margin-bottom: 30px;
    text-align: center;
    padding: 15px !important;
  }
  
  .cm-hero-ai-thumb {
    padding: 20px !important;
    justify-content: center;
    max-width: 100% !important;
  }
  
  .cm-hero-ai-thumb img {
    max-width: 350px !important;
    width: auto !important;
    margin: 0 auto;
    display: block;
  }
}

/* Tablet pequeña y móvil horizontal */
@media (min-width: 576px) and (max-width: 767px) {
  .cm-hero-ai-content {
    min-height: 250px;
    margin-bottom: 20px;
    text-align: center;
    padding: 15px !important;
  }
  
  .cm-hero-ai-thumb {
    padding: 15px !important;
    justify-content: center;
    max-width: 100% !important;
  }
  
  .cm-hero-ai-thumb img {
    max-width: 300px !important;
    width: auto !important;
    margin: 0 auto;
    display: block;
  }
}

/* Móvil vertical */
@media (max-width: 575px) {
  .cm-hero-area {
    padding-bottom: 50px !important;
    overflow-x: hidden !important;
  }
  
  .cm-hero-ai-content {
    min-height: 200px !important;
    margin-bottom: 20px !important;
    padding: 10px 5px !important;
    text-align: center !important;
    overflow: hidden !important;
  }
  
  .cm-hero-ai-thumb {
    padding: 10px 5px !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    display: block !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  .cm-hero-ai-thumb img {
    max-width: 280px !important;
    width: auto !important;
    border-radius: 0 !important;
    margin: 0 auto !important;
    display: block !important;
  }
  
  /* Ajustar el spacing del hero en móvil */
  .cm-hero-ai-spacing {
    padding: 120px 0 80px 0 !important;
  }
  
  /* Asegurar que no haya overflow horizontal */
  .container-fluid.container-1750.containers {
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  
  /* Override de Bootstrap columns */
  .cm-hero-area .col-lg-6,
  .cm-hero-area .col-md-6 {
    width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-bottom: 20px !important;
  }
}

/* Móvil muy pequeño */
@media (max-width: 480px) {
  .cm-hero-ai-thumb img {
    max-width: 250px !important;
    width: auto !important;
    margin: 0 auto !important;
    display: block !important;
  }
  
  .cm-hero-ai-thumb {
    padding: 8px 5px !important;
    text-align: center !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  .cm-hero-ai-title {
    font-size: 60px !important;
    letter-spacing: -3px !important;
  }
  
  .cm-hero-area {
    overflow-x: hidden !important;
  }
}

/* Ajustes adicionales para mejorar el layout en móvil */
@media (max-width: 767px) {
  .cm-hero-area .row {
    flex-direction: column !important;
  }
  
  .cm-hero-area .col-lg-6,
  .cm-hero-area .col-md-6 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
  
  /* Forzar centrado de imagen en móviles */
  .cm-hero-ai-thumb {
    text-align: center !important;
    display: block !important;
    margin: 0 auto !important;
  }
  
  .cm-hero-ai-thumb img {
    display: block !important;
    margin: 0 auto !important;
  }
}

/* Mejorar el centrado vertical en todas las pantallas */
.cm-hero-area .align-items-center {
  min-height: 70vh !important;
}

@media (max-width: 767px) {
  .cm-hero-area .align-items-center {
    min-height: auto !important;
  }
  
  /* Override específico para Bootstrap en móviles */
  .cm-hero-area .container-fluid {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  
  .cm-hero-area .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  .cm-hero-area [class*="col-"] {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

/* Regla final para asegurar el centrado en móviles - Máxima prioridad */
@media screen and (max-width: 767px) {
  .cm-hero-area .cm-hero-ai-thumb {
    position: static !important;
    width: 100% !important;
    text-align: center !important;
    display: block !important;
    padding: 20px 10px !important;
  }
  
  .cm-hero-area .cm-hero-ai-thumb img {
    width: auto !important;
    max-width: 90% !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
    position: static !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
  }
  
  /* Asegurar que las columnas de Bootstrap se comporten correctamente */
  .cm-hero-area .row > div[class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
    margin-bottom: 20px !important;
  }
}

/* Reglas globales para prevenir desborde */
.cm-hero-area {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
}

.cm-hero-area * {
  box-sizing: border-box !important;
}

.cm-hero-area .container,
.cm-hero-area .container-fluid {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.cm-hero-area .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: 100% !important;
}

.cm-hero-area [class*="col-"] {
  padding-left: 15px !important;
  padding-right: 15px !important;
  max-width: 100% !important;
}
