/**
 * Tablet (769px–1025px): footer 2 columnas; newsletter y widget Imagen y texto = layout móvil.
 * Móvil (≤768px): footer 1 columna (uno debajo del otro).
 * Carga con prioridad 999 para ganar a Elementor y plugins.
 */
@media (min-width: 769px) and (max-width: 1025px) {
  /* ----- Footer TABLET: 2 columnas (de dos en dos) ----- */
  .site-footer .ast-builder-grid-row,
  .site-primary-footer-wrap .ast-builder-grid-row,
  .site-footer .ast-builder-row,
  .site-primary-footer-wrap .ast-builder-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem 2rem !important;
    flex-direction: row !important;
  }
  .site-footer .ast-builder-grid-row .ast-builder-grid-row,
  .site-footer .ast-builder-grid-row .ast-builder-row {
    flex-direction: row !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .site-footer .ast-builder-grid-row > *,
  .site-footer .ahfb-builder-area,
  .site-footer .ast-builder-layout-element,
  .site-primary-footer-wrap .ahfb-builder-area {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
  }
  .site-footer .elementor-row,
  .elementor-location-footer .elementor-row,
  body .elementor-location-footer .elementor-section .elementor-container {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    flex-direction: row !important;
  }
  .site-footer .elementor-column,
  .elementor-location-footer .elementor-column {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ----- Footer MÓVIL: 1 columna (uno debajo del otro) ----- */
@media (max-width: 768px) {
  .site-footer .ast-builder-grid-row,
  .site-primary-footer-wrap .ast-builder-grid-row,
  .site-footer .ast-builder-row,
  .site-primary-footer-wrap .ast-builder-row {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 1rem !important;
  }
  .site-footer .ast-builder-grid-row .ast-builder-grid-row,
  .site-footer .ast-builder-grid-row .ast-builder-row {
    flex-direction: column !important;
    display: flex !important;
    grid-template-columns: none !important;
  }
  .site-footer .ast-builder-grid-row > *,
  .site-footer .ahfb-builder-area,
  .site-footer .ast-builder-layout-element,
  .site-primary-footer-wrap .ahfb-builder-area {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
  .site-footer .elementor-row,
  .elementor-location-footer .elementor-row,
  body .elementor-location-footer .elementor-section .elementor-container {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
  }
  .site-footer .elementor-column,
  .elementor-location-footer .elementor-column {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ----- Newsletter: layout móvil a partir de 1200px ----- */
@media (max-width: 1200px) {
  body .eg-newsletter-row,
  .eg-newsletter-card .eg-newsletter-row,
  .elementor-widget-eg-newsletter .eg-newsletter-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  body .eg-newsletter-input,
  .eg-newsletter-card .eg-newsletter-input,
  .elementor-widget-eg-newsletter .eg-newsletter-input {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }
  body #eg-newsletter-submit,
  body .eg-newsletter-button,
  .eg-newsletter-card #eg-newsletter-submit,
  .eg-newsletter-card .eg-newsletter-button,
  .elementor-widget-eg-newsletter #eg-newsletter-submit,
  .elementor-widget-eg-newsletter .eg-newsletter-button {
    margin-left: 0 !important;
    margin-top: 8px !important;
    width: 100% !important;
  }
}

@media (max-width: 1025px) {
  /* ----- Tablet y móvil: social y contact ----- */
  .social-section {
    padding: 0 !important;
    margin: 0 !important;
  }
  .contact-section {
    margin: 0 !important;
    padding: 0 !important;
    margin-top: 40px !important;
  }
  .box-orange-footer {
    padding: 1rem !important;
  }
}

/* ----- Widget Imagen y texto (Text and Media): layout móvil a partir de 1650px ----- */
@media (max-width: 1650px) {
  body .image-text-section-row,
  .image-text-section-wrapper .image-text-section-row,
  .elementor-widget-image_text_section .image-text-section-row,
  .elementor-element .image-text-section-row {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 30px !important;
    padding: 30px 0 !important;
  }
  body .image-text-section-image,
  .image-text-section-wrapper .image-text-section-image,
  .elementor-widget-image_text_section .image-text-section-image,
  .elementor-element .image-text-section-image {
    order: 1 !important;
    height: auto !important;
    margin-top: 0 !important;
  }
  body .image-text-section-single:not(:first-child) .image-text-section-image,
  .image-text-section-wrapper .image-text-section-single:not(:first-child) .image-text-section-image,
  .elementor-widget-image_text_section .image-text-section-single:not(:first-child) .image-text-section-image {
    margin-top: 0 !important;
  }
  body .image-text-section-content,
  .image-text-section-wrapper .image-text-section-content,
  .elementor-widget-image_text_section .image-text-section-content,
  .elementor-element .image-text-section-content {
    order: 2 !important;
    padding: 10px !important;
  }
  body .image-text-section-single.is-visible .image-text-section-image,
  body .image-text-section-single.is-visible .image-text-section-content,
  .image-text-section-wrapper .image-text-section-single.is-visible .image-text-section-image,
  .image-text-section-wrapper .image-text-section-single.is-visible .image-text-section-content,
  .elementor-widget-image_text_section .image-text-section-single.is-visible .image-text-section-image,
  .elementor-widget-image_text_section .image-text-section-single.is-visible .image-text-section-content {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
  }
}

@media (max-width: 1200px) {
  .elementor-1905 .elementor-element.elementor-element-04fc2a1 {
      --e-con-grid-template-columns: repeat(1, 1fr) !important;
      --e-con-grid-template-rows: repeat(1, 1fr) !important;
      --grid-auto-flow: row !important;
  }
  .eg-newsletter-card {
    transform: translateY(0) !important;
  }
  .elementor-1905 .elementor-element.elementor-element-8ca79f0 {
    --e-con-grid-template-columns: 1;
    --grid-auto-flow: row;
    --margin-top: 165px;
    --margin-bottom: 71px;
    --margin-left: 71px;
    --margin-right: 71px;
  }
}

@media (max-width: 767px) {
  .elementor-1905 .elementor-element.elementor-element-b3752d5 {
      --e-con-grid-template-columns: repeat(4, 1fr);
      --grid-auto-flow: row;
  }
}