/* =========================================================
   MOTORMAN — Mejoras para TABLET y MÓVIL
   Cargar al FINAL, después de motorman-liqui-theme.css:
   <link href="css/motorman-responsive.css" rel="stylesheet">

   Todo está dentro de media queries: el diseño de escritorio
   (≥ 62em / 992px) NO se modifica.

   Breakpoints (los mismos que usa el template):
     - Tablet y menor : max-width 61.9em  (~990px)
     - Solo tablet    : 48em a 61.9em     (768px – 990px)
     - Móvil          : max-width 47.9em  (~767px)
   ========================================================= */


/* =========================================================
   A) TABLET + MÓVIL  (≤ 990px)
   ========================================================= */
@media (max-width: 61.9em) {

  html { -webkit-text-size-adjust: 100%; }
  img  { max-width: 100%; }

  /* ---------- Barra de navegación ---------- */
  .s-header-v2__navbar {
    width: 100%;
    background: #fff;
  }
  .probootstrap_navbar { min-height: 0; margin-bottom: 0; }

  .s-header-v2__logo { padding: 6px 0 6px 12px !important; }
  .s-header-v2__logo-img--shrink {
    height: 48px;
    max-height: 48px !important;
    width: auto !important;
    margin: 0 !important;
  }

  /* Botón hamburguesa: más compacto y fácil de tocar */
  .s-header-v2__toggle {
    line-height: 2.6rem;
    min-width: 48px;
    padding: .5625rem .75rem;
    margin-top: 2px;
  }

  /* Menú desplegable: los enlaces eran BLANCOS sobre fondo blanco
     hasta hacer scroll; aquí se fuerzan oscuros y con buen tamaño. */
  .s-header-v2__navbar-collapse.collapse.in {
    max-height: calc(100vh - 70px);
    -webkit-overflow-scrolling: touch;
  }
  .s-header-v2__nav { padding: 8px 0 12px; }

  .probootstrap_navbar ul > li > a,
  .probootstrap_navbar .s-header-v2__nav-link,
  .probootstrap_navbar.scrolled .s-header-v2__nav-link {
    color: var(--lm-ink, #16202C) !important;
    text-shadow: none !important;
    line-height: 1.3 !important;
    font-size: .95rem;
    margin: 0 !important;
    padding: 15px 12px !important;
    border-bottom: 1px solid var(--lm-line, #E3E8EF);
    border-radius: 0 !important;
  }
  .s-header-v2__nav-item:last-child .s-header-v2__nav-link { border-bottom: 0; }

  .probootstrap_navbar .s-header-v2__nav-link:hover,
  .probootstrap_navbar .s-header-v2__nav-link:active,
  .probootstrap_navbar ul > li.active > a {
    color: var(--lm-red, #E30613) !important;
    background: rgba(227, 6, 19, .06) !important;
  }
  /* El subrayado animado no tiene sentido en el menú vertical */
  .s-header-v2__nav-link::after { display: none !important; }

  /* ---------- Hero / slider ---------- */
  .s-swiper.js__swiper-one-item .swiper-slide > .container {
    padding-left: 20px;
    padding-right: 20px;
  }
  .s-swiper.js__swiper-one-item .swiper-slide h2 {
    overflow-wrap: break-word;
  }

  /* Sin manto azul sobre las imágenes del slide principal */
  .s-swiper.js__swiper-one-item .swiper-slide::before {
    display: none !important;
  }

  /* ---------- Títulos y secciones ---------- */
  #servicios > .g-text-center--xs,
  #blog > .g-text-center--xs {
    margin-bottom: 40px;
  }
  /* Títulos de sección más chicos (Galería, Servicios, Blog, etc.) */
  .g-text-center--xs h2,
  #subs h2,
  #contactos h2 {
    font-size: 1.1rem !important;
    line-height: 1.3;
    padding-bottom: 12px;
  }
  #galeria h2,
  #servicios h2,
  #blog h2 {
    font-size: 1.5rem !important;
  }
  /* Los títulos de las tarjetas del blog conservan su tamaño propio */
  .post-content h2 { font-size: 1.05rem !important; padding-bottom: 0; }

  /* Blog: sin imagen en las entradas */
  .post-thumbnail { display: none !important; }

  /* Logos más chicos: Servicio técnico autorizado y Alianzas */
  .s-clients-v0 { width: 11rem !important; max-width: 60% !important; }
  .s-clients-v1 { width: 4rem !important; }
  .js__swiper-clients_otrasmarcas .swiper-slide { width: 33.333% !important; }  /* móvil: 3 por fila */
  .col-xs-6 .s-clients-v0 { width: 100% !important; max-width: 100% !important; max-height: 70px !important; object-fit: contain; }

  /* ---------- Suscripción y testimonios: el "fixed" no funciona
       en iOS/Android (imagen ampliada y con saltos) ---------- */
  #subs,
  #testimonios {
    background-attachment: scroll !important;
    background-size: cover !important;
    background-position: center !important;
  }

  /* ---------- Blog ---------- */
  /* #blog tenía margin:20px + width:100% => desbordaba la pantalla */
  #blog {
    margin: 0 !important;
    width: 100%;
    box-sizing: border-box;
    padding: 50px 20px !important;
  }

  /* ---------- Servicio técnico autorizado ----------
     El carrusel de Swiper mostraba solo 2 logos a la vez en pantallas chicas.
     Se convierte en una grilla fija: se ven todas las marcas. */
  .js__swiper-clients_otrasmarcas .swiper-wrapper {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100% !important;
    transform: none !important;
    height: auto !important;
  }
  .js__swiper-clients_otrasmarcas .swiper-slide {
    width: 20% !important;           /* tablet: 5 por fila */
    margin: 0 !important;
    padding: 10px 6px;
    height: auto !important;
  }
  /* Slides vacíos usados como espaciadores del carrusel */
  .js__swiper-clients_otrasmarcas .swiper-slide:first-child,
  .js__swiper-clients_otrasmarcas .swiper-slide:last-child {
    display: none !important;
  }
  .js__swiper-clients_otrasmarcas .s-clients-v1 {
    width: 4.5rem !important;
    max-width: 100%;
    margin: 0 auto;
  }

  /* ---------- Footer ---------- */
  footer .g-padding-y-80--xs { padding-top: 50px !important; padding-bottom: 50px !important; }
  footer ul li a { display: inline-block; padding: 6px 0; }
}


/* =========================================================
   B) SOLO TABLET  (768px – 990px)
   ========================================================= */
@media (min-width: 48em) and (max-width: 61.9em) {

  /* Hero */
  .s-swiper.js__swiper-one-item { --lm-edge: 28%; }
  .s-swiper__arrow-v1--left  { left: 1.25rem; }
  .s-swiper__arrow-v1--right { right: 1.25rem; }

  /* Servicios: dos columnas con tarjetas de igual altura */
  #servicios.container { padding-top: 70px !important; padding-bottom: 70px !important; }
  #servicios .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  #servicios .row::before,
  #servicios .row::after { display: none; }
  #servicios .col-sm-6 {
    float: none;
    width: calc(50% - 12px);
    margin-bottom: 24px;
  }

  /* Logos */
  .s-clients-v0 { width: 18rem; }

  /* Galería */
  #galeria { padding-top: 60px !important; }
  #galeria-frame { height: 460px; }

  /* Testimonios: 28px era demasiado grande para reseñas largas */
  #testimonios .container { padding-top: 60px !important; padding-bottom: 60px !important; }
  #testimonios .swiper-slide {
    padding-left: 90px !important;
    padding-right: 90px !important;
  }
  #testimonios .swiper-slide p,
  #testimonios .swiper-slide p a { font-size: 1.3rem !important; line-height: 1.5; }

  /* Suscripción */
  #subs .g-padding-y-125--sm { padding-top: 70px !important; padding-bottom: 70px !important; }

  /* Contacto */
  #contactos .g-padding-y-125--sm { padding-top: 70px !important; padding-bottom: 70px !important; }

  /* Blog: dos columnas ya (regla base); solo ajustamos imagen */
  .post-thumbnail { height: 190px; }

  /* Redes sociales: barra lateral un poco más compacta */
  .social-bar .icon { width: 44px; height: 44px; font-size: 1.2rem; }
}


/* =========================================================
   C) MÓVIL  (≤ 767px)
   ========================================================= */
@media (max-width: 47.9em) {

  /* ---------- Hero ---------- */
  .s-swiper.js__swiper-one-item .swiper-slide h2 {
    font-size: 1.65rem;
    line-height: 1.15;
    letter-spacing: .02em;
  }

  /* En pantallas angostas el panel azul inclinado tapaba ~80% del slide.
     Lo reemplazamos por un velo degradado a todo el ancho (mejor lectura)
     y la línea roja pasa a ser una franja inferior. Los slides de promo
     siguen sin panel (display:none en el tema). */
  .s-swiper.js__swiper-one-item .swiper-slide::after {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    transform: none;
  }

  /* Lista de servicios del slide: una por línea, sin separadores rojos */
  .s-swiper.js__swiper-one-item .swiper-slide .list-inline-item {
    display: block;
    margin: 0 0 .35rem;
    padding: 0;
  }
  .s-swiper.js__swiper-one-item .swiper-slide .list-inline-item + .list-inline-item {
    border-left: 0;
    padding-left: 0;
    margin-left: 0;
  }
  .s-swiper.js__swiper-one-item .swiper-slide h4 { letter-spacing: .08em; }

  /* Se desliza con el dedo: sin flechas */
  #inicio .s-swiper__arrow-v1--left,
  #inicio .s-swiper__arrow-v1--right { display: none !important; }

  /* ---------- Servicios ---------- */
  #servicios.container { padding-top: 50px !important; padding-bottom: 40px !important; }
  #servicios .row { margin-bottom: 0 !important; }
  #servicios .col-sm-6 {
    padding: 22px 18px;
    margin-bottom: 18px;
  }
  #servicios .g-media.g-width-30--xs { width: 34px; }
  #servicios h3 { font-size: 1rem; }
  #servicios ul li,
  #servicios p { font-size: .92rem; }
  .g-margin-b-60--xs { margin-bottom: 0; }

  /* ---------- Servicio técnico / Alianzas ---------- */
  /* Los 3 divs con display:table-cell inline (5% / 40% / 10%) dejaban el
     título "TRABAJAMOS EN ALIANZA CON" en una columna muy angosta. */
  div[style*="width: 5%"],
  div[style*="width: 10%"] { display: none !important; }
  div[style*="width: 40%"] {
    display: block !important;
    width: 100% !important;
    padding: 0 16px;
    margin-bottom: 30px !important;
  }
  .g-text-center--xs.g-margin-b-80--xs { margin-bottom: 30px; padding: 0 16px; }

  .s-clients-v0 { width: 14rem; max-width: 80%; }
  .col-xs-6 .s-clients-v0 { width: 100%; max-width: 100%; }

  /* ---------- Suscripción ---------- */
  #subs .g-padding-y-80--xs { padding-top: 50px !important; padding-bottom: 50px !important; }
  #subs .g-margin-b-80--xs { margin-bottom: 30px !important; }
  #subs h2 { font-size: 1.3rem; line-height: 1.3; }
  .s-form-v1__input {
    height: 3.1rem;
    padding: .5rem 1.1rem;
    font-size: 16px;            /* evita el zoom automático de iOS */
    letter-spacing: .03rem;
  }

  /* ---------- Galería ---------- */
  #galeria { padding-top: 40px !important; }
  #galeria h2 { font-size: 2rem; }
  #galeria-frame { height: 480px; }

  /* ---------- Testimonios ---------- */
  #testimonios .container { padding-top: 50px !important; padding-bottom: 40px !important; }
  #testimonios .swiper-slide p,
  #testimonios .swiper-slide p a { font-size: 1.05rem !important; line-height: 1.55; }
  #testimonios .swiper-slide h4 { font-size: .9rem; }
  #testimonios p i::before { font-size: 3rem; }

  /* ---------- Blog ---------- */
  #ultimas-entradas { gap: 18px !important; }
  .post-thumbnail { height: 170px; }
  .post-content { padding: 18px 18px 22px; }

  /* ---------- Contacto ---------- */
  #contactos .container { padding-top: 50px !important; padding-bottom: 50px !important; }
  #contactos h2 { font-size: 1.15rem; }
  .contactForm .form-control,
  .contactForm .s-form-v2__input {
    font-size: 16px;            /* evita el zoom automático de iOS */
    letter-spacing: normal;
    text-transform: none;
    height: 3.2rem;
    padding: 12px 18px;
  }
  .contactForm textarea.form-control { height: auto; min-height: 140px; }
  .contactForm .row { margin-bottom: 20px; }
  #botonSubmit {
    width: 100%;
    max-width: 420px;
    padding: 15px 20px !important;
    font-size: 13px;
    letter-spacing: 1.5px;
  }

  /* ---------- Mapa (estilos inline => !important) ---------- */
  .map-header { padding: 22px 16px !important; }
  .map-header h2 { font-size: 20px !important; }
  .map-header p  { font-size: 14px !important; }
  .route-tabs button {
    font-size: 13px !important;
    padding: 14px 8px !important;
    line-height: 1.3;
  }
  .map-frame-wrapper { height: 340px !important; }
  .map-footer { padding: 22px 16px !important; }
  #routeDescription { font-size: 14px !important; }
  .map-footer .btn-group { gap: 12px !important; }
  .map-footer .btn-group a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ---------- Footer ---------- */
  /* Las dos primeras listas de enlaces van lado a lado */
  footer .row > .col-sm-2:nth-child(-n+2) {
    float: left;
    width: 50%;
  }
  footer .row > .col-sm-2:nth-child(2) h4 { visibility: hidden; }  /* el "." decorativo */
  footer .row > .col-sm-2:nth-child(3) { clear: both; padding-top: 10px; }
  footer .s-footer__logo { padding-top: 30px !important; clear: both; }
  footer .s-footer__logo:before { width: 100%; left: 0; opacity: .5; }

  /* ---------- Redes sociales: píldora abajo a la izquierda ----------
     (antes quedaba centrada y chocaba con el botón de WhatsApp) */
  .social-bar {
    flex-direction: row;
    top: auto;
    bottom: 14px;
    left: 12px;
    right: auto;
    transform: none;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  }
  .social-bar .icon,
  .social-bar .icon:first-child,
  .social-bar .icon:last-child {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.1rem;
    border-radius: 0 !important;
  }
  .social-bar .icon:hover {
    padding: 0;
    transform: none;
    box-shadow: none;
  }

  /* ---------- WhatsApp flotante: esquina inferior derecha ---------- */
  .s-back-to-top.-is-visible,
  .s-back-to-top { right: 14px; }
  .s-back-to-top.-is-visible { bottom: 14px; }
}


/* =========================================================
   D) DISPOSITIVOS TÁCTILES (sin hover)
   ========================================================= */
@media (max-width: 61.9em) and (hover: none) {
  /* Los logos en gris solo se "activaban" con hover: en táctil se ven a color */
  .s-clients-v0,
  .s-clients-v1 { filter: none; opacity: 1; }

  /* Evita que las tarjetas queden "levantadas" tras tocarlas */
  #servicios .col-sm-6:hover,
  .post-wrapper:hover { transform: none; }
}


/* =========================================================
   E) TELÉFONOS MUY ANGOSTOS (≤ 360px)
   ========================================================= */
@media (max-width: 22.5em) {
  .s-swiper.js__swiper-one-item .swiper-slide h2 { font-size: 1.4rem; }
  #servicios .col-sm-6 { padding: 18px 14px; }
  .route-tabs button { font-size: 12px !important; }
}