/**
 * RMI Estilo — ajustes responsive (móvil / tablet)
 * Tipografía fluida, sin recortes de texto ni overflow horizontal.
 */

/* ── Base: evitar cortes y desbordes ── */
#vista-rmiestilo,
#sitio-principal {
  overflow-x: hidden;
  max-width: 100%;
}

#vista-rmiestilo {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

#vista-rmiestilo h1,
#vista-rmiestilo h2,
#vista-rmiestilo h3,
#vista-rmiestilo p,
#vista-rmiestilo li,
#vista-rmiestilo a:not(.rmi-social-btn),
#vista-rmiestilo button,
#vista-rmiestilo label,
#vista-rmiestilo span {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ── Hero (base tablet/móvil) ── */
#vista-rmiestilo .hero-section {
  padding: 72px 16px 48px;
  min-height: 100svh;
  overflow-x: clip;
}

#vista-rmiestilo .hero-badge {
  max-width: calc(100% - 24px);
  text-align: center;
  line-height: 1.45;
  white-space: normal;
  font-size: clamp(0.65rem, 2.8vw, 0.75rem);
  padding: 8px 14px;
  margin-bottom: 28px;
}

#vista-rmiestilo .hero-title {
  font-size: clamp(1.75rem, 7.2vw, 7rem);
  letter-spacing: clamp(-0.06em, -0.04em, -0.02em);
  line-height: 1.08;
  width: 100%;
  max-width: 100%;
  padding: 0 8px;
  margin-bottom: 18px;
}

#vista-rmiestilo .hero-title .line {
  overflow: visible;
}

#vista-rmiestilo .hero-title .line-flip {
  min-height: 1.2em;
}

#vista-rmiestilo .hero-flip-host {
  max-width: 100%;
  padding: 0 4px;
  justify-content: center;
  text-align: center;
  line-height: 1.12;
  hyphens: auto;
}

#vista-rmiestilo .hero-subtitle {
  font-size: clamp(0.95rem, 3.6vw, 1.35rem);
  max-width: min(500px, 100%);
  padding: 0 12px;
  line-height: 1.55;
}

/*
 * Móvil: titular «Tienes 3 segundos» más grande y en HORIZONTAL
 * (letras en fila; si no cabe, el flex-wrap baja a otra línea de palabras).
 * Badge «+150 empresas» más arriba.
 */
@media (max-width: 768px) {
  #vista-rmiestilo .hero-section {
    justify-content: flex-start;
    align-items: center;
    padding: max(56px, calc(env(safe-area-inset-top, 0px) + 52px)) 14px 36px;
    min-height: 100svh;
    gap: 0;
  }

  #vista-rmiestilo .hero-badge {
    margin-top: 0;
    margin-bottom: 14px;
    padding: 7px 12px;
    font-size: clamp(0.72rem, 3.4vw, 0.88rem);
    letter-spacing: 0.02em;
    max-width: min(340px, calc(100% - 16px));
    line-height: 1.35;
    position: relative;
    z-index: 3;
  }

  #vista-rmiestilo .hero-title {
    /* Más grande en móvil; el wrap es por palabra completa */
    font-size: clamp(2.85rem, 12.5vw, 3.75rem) !important;
    letter-spacing: -0.045em;
    line-height: 1.06;
    margin-bottom: 16px;
    padding: 0 2px;
    width: 100%;
    max-width: 100%;
  }

  #vista-rmiestilo .hero-title .line,
  #vista-rmiestilo .hero-title .line-flip {
    display: block;
    overflow: visible !important;
    min-height: 0 !important;
    height: auto !important;
  }

  /* Host: wrap solo entre palabras (gap = espacio real entre palabras) */
  #vista-rmiestilo .hero-flip-host {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: baseline !important;
    width: 100%;
    max-width: 100%;
    white-space: normal !important;
    text-align: center;
    line-height: 1.08 !important;
    font-size: inherit !important;
    padding: 0 2px;
    column-gap: 0.48em !important;
    row-gap: 0.1em !important;
  }

  /* Palabra completa: no se parte nunca a mitad + separación clara */
  #vista-rmiestilo .hero-flip-word {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    max-width: none;
    margin-inline: 0.04em !important;
  }

  /* Letras en fila dentro de la palabra */
  #vista-rmiestilo .hero-flip-char {
    display: inline-block !important;
    width: auto !important;
    max-width: none !important;
    white-space: pre !important;
    vertical-align: baseline;
  }

  #vista-rmiestilo .hero-subtitle {
    font-size: clamp(1.05rem, 4.2vw, 1.25rem);
    margin-top: 6px;
    padding: 0 10px;
    line-height: 1.45;
  }

  #vista-rmiestilo .hero-side-count {
    bottom: 6%;
    opacity: 0.55;
  }
}

#vista-rmiestilo .hero-cta-group {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 12px;
  gap: 12px;
}

#vista-rmiestilo .hero-btn-primary,
#vista-rmiestilo .hero-btn-secondary {
  width: 100%;
  justify-content: center;
  font-size: clamp(0.88rem, 3.4vw, 1rem);
  padding: 14px 20px;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
}

#vista-rmiestilo .hero-case-card {
  max-width: calc(100% - 24px);
  margin-left: auto;
  margin-right: auto;
}

#vista-rmiestilo .hero-case-copy strong,
#vista-rmiestilo .hero-case-copy span,
#vista-rmiestilo .hero-case-copy small {
  overflow-wrap: anywhere;
}

/* Idiomas con frases largas (DE/FR/PT) */
html[lang="de"] #vista-rmiestilo .hero-title,
html[lang="fr"] #vista-rmiestilo .hero-title,
html[lang="pt"] #vista-rmiestilo .hero-title,
html[lang="it"] #vista-rmiestilo .hero-title {
  font-size: clamp(1.55rem, 6.2vw, 6rem);
  letter-spacing: -0.03em;
}

html[lang="de"] #vista-rmiestilo .hero-flip-host,
html[lang="fr"] #vista-rmiestilo .hero-flip-host {
  font-size: 0.92em;
}

/* ── Secciones: títulos y copy ── */
#vista-rmiestilo .features-header h2,
#vista-rmiestilo .trabajos-header h2,
#vista-rmiestilo .servicios3d-header h2,
#vista-rmiestilo .proceso-header h2,
#vista-rmiestilo .precios-header h2,
#vista-rmiestilo .testimonios-header h2,
#vista-rmiestilo .gallery-header h2 {
  font-size: clamp(1.65rem, 5.5vw, 4.2rem);
  letter-spacing: clamp(-0.04em, -0.02em, -0.01em);
  line-height: 1.12;
  padding: 0 12px;
}

#vista-rmiestilo .features-header p,
#vista-rmiestilo .trabajos-header p,
#vista-rmiestilo .servicios3d-header p,
#vista-rmiestilo .proceso-header p,
#vista-rmiestilo .precios-header p,
#vista-rmiestilo .footer-subtitle,
#vista-rmiestilo .trabajos-nota,
#vista-rmiestilo .precios-nota {
  font-size: clamp(0.88rem, 3.2vw, 1.05rem);
  padding: 0 16px;
  line-height: 1.55;
}

#vista-rmiestilo .trust-section {
  padding-left: 0;
  padding-right: 0;
  overflow-x: clip;
}

#vista-rmiestilo .trust-label {
  font-size: clamp(0.82rem, 3vw, 1rem);
  padding: 0 16px;
  line-height: 1.5;
  max-width: 100%;
}

/* Logos de clientes: a color siempre (los blancos van en negro en el PNG).
   Hover del carrusel: solo pausa la animación, sin efectos en los logos. */
#vista-rmiestilo .trust-ticker-track {
  gap: 64px;
  align-items: center;
  min-height: 72px;
}

#vista-rmiestilo .trust-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#vista-rmiestilo .trust-logo--img {
  height: 64px;
  min-width: 56px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  box-sizing: content-box;
  opacity: 1 !important;
  color: inherit;
  transform: none;
  transition: none;
  pointer-events: none; /* el hover lo gestiona .trust-ticker */
}

#vista-rmiestilo .trust-logo--img img {
  display: block;
  height: 53px; /* ~1/3 más que 40px */
  width: auto;
  max-width: 200px;
  min-width: 40px;
  object-fit: contain;
  filter: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transition: none;
}

/* Pausa al enfocar el carrusel; al salir sigue desde donde se quedó */
#vista-rmiestilo .trust-ticker:hover .trust-ticker-track,
#vista-rmiestilo .trust-ticker:focus-within .trust-ticker-track {
  animation-play-state: paused;
}

#vista-rmiestilo .trust-logo--img:hover,
#vista-rmiestilo .trust-logo--img:focus-within,
#vista-rmiestilo .trust-logo--img:hover img,
#vista-rmiestilo .trust-logo--img:focus-within img {
  filter: none;
  opacity: 1;
  transform: none;
}

#vista-rmiestilo .trust-award {
  font-size: clamp(0.72rem, 2.8vw, 0.88rem);
  white-space: normal;
  text-align: center;
}

/* ── Cards y grids ── */
#vista-rmiestilo .trabajo-card-body h3,
#vista-rmiestilo .precio-card h3,
#vista-rmiestilo .servicio3d-card h3 {
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  line-height: 1.25;
}

#vista-rmiestilo .trabajo-card-body p,
#vista-rmiestilo .precio-desc,
#vista-rmiestilo .servicio3d-card p {
  font-size: clamp(0.84rem, 3vw, 0.95rem);
  line-height: 1.5;
}

/* Precios: mobile-first. El !important del 3-col no puede ganar en móvil. */
#vista-rmiestilo .precios-grid {
  display: grid !important;
  width: 100% !important;
  max-width: min(420px, 100%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 16px !important;
  /* 1 columna en móvil: un cajetín debajo de otro al hacer scroll */
  grid-template-columns: 1fr !important;
  gap: 18px !important;
  justify-content: center !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
}

#vista-rmiestilo .precios-grid .precio-card {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

#vista-rmiestilo .precio-card-popular {
  transform: none !important;
}

/* Tablet: 1 columna ancha o 2 si cabe */
@media (min-width: 700px) {
  #vista-rmiestilo .precios-grid {
    max-width: min(720px, 94vw) !important;
    padding: 0 clamp(16px, 3vw, 32px) !important;
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

/* Desktop: 3 columnas lado a lado */
@media (min-width: 980px) {
  #vista-rmiestilo .precios-grid {
    max-width: min(1020px, 94vw) !important;
    padding: 0 clamp(16px, 3vw, 40px) !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(16px, 2vw, 24px) !important;
  }

  #vista-rmiestilo .precio-card-popular {
    transform: scale(1.02) !important;
  }
}

#vista-rmiestilo .trabajos-grid {
  padding: 0 12px;
}

#vista-rmiestilo .testimonio-quote {
  font-size: clamp(0.92rem, 3.4vw, 1.1rem);
  line-height: 1.55;
}

#vista-rmiestilo .proceso-step h3 {
  font-size: clamp(1rem, 3.8vw, 1.2rem);
}

#vista-rmiestilo .proceso-step p {
  font-size: clamp(0.84rem, 3vw, 0.95rem);
  line-height: 1.55;
}

/* ── Modales ── */
#vista-rmiestilo .presupuesto-panel {
  max-height: 92svh;
  border-radius: 18px;
}

#vista-rmiestilo .presupuesto-grid {
  grid-template-columns: 1fr !important;
}

#vista-rmiestilo .presupuesto-side h2 {
  font-size: clamp(1.5rem, 6vw, 2.4rem);
  line-height: 1.15;
}

#vista-rmiestilo .presupuesto-side p,
#vista-rmiestilo .presupuesto-bullets li {
  font-size: clamp(0.84rem, 3vw, 0.95rem);
  line-height: 1.5;
}

#vista-rmiestilo .presupuesto-form label {
  font-size: clamp(0.82rem, 3vw, 0.9rem);
}

#vista-rmiestilo .pf-submit {
  font-size: clamp(0.88rem, 3.2vw, 1rem);
  white-space: normal;
  line-height: 1.35;
}

#vista-rmiestilo .cookie-banner-inner {
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

#vista-rmiestilo .cookie-banner-text span {
  font-size: clamp(0.78rem, 2.8vw, 0.88rem);
  line-height: 1.5;
}

#vista-rmiestilo .cookie-banner-actions {
  flex-wrap: wrap;
  justify-content: stretch;
  width: 100%;
  gap: 8px;
}

#vista-rmiestilo .cookie-banner-actions .cookie-btn {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(0.78rem, 2.8vw, 0.85rem);
  white-space: normal;
  text-align: center;
}

#vista-rmiestilo .rmi-idle-panel {
  margin: 16px;
  width: min(400px, calc(100vw - 32px)) !important;
  max-width: 400px !important;
  flex: 0 1 auto;
}

#vista-rmiestilo .rmi-idle-panel h3 {
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  line-height: 1.3;
}

#vista-rmiestilo .rmi-idle-opt {
  font-size: clamp(0.84rem, 3vw, 0.92rem);
  white-space: normal;
  line-height: 1.4;
  text-align: left;
}

#vista-rmiestilo .rmi-sticky-cta {
  font-size: clamp(0.78rem, 2.8vw, 0.88rem);
  max-width: calc(100vw - 24px);
  white-space: normal;
  line-height: 1.3;
  text-align: center;
  padding: 12px 16px;
}

#vista-rmiestilo .legal-modal-inner,
#vista-rmiestilo .gc-modal-inner {
  max-height: 92svh;
  overflow-y: auto;
}

#vista-rmiestilo .legal-modal-title,
#vista-rmiestilo .gc-modal-title {
  font-size: clamp(1.35rem, 5vw, 2rem);
  line-height: 1.2;
}

/* ── Carrusel 3D: no recortar perspectiva ── */
#vista-rmiestilo .features-section {
  overflow: visible;
}

#vista-rmiestilo .carousel-wrap {
  overflow: hidden;
}

#vista-rmiestilo .carousel-track-viewport {
  overflow: visible !important;
}

/* ── Tablet ── */
@media (min-width: 601px) and (max-width: 900px) {
  #vista-rmiestilo .hero-cta-group {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 520px;
  }

  #vista-rmiestilo .hero-btn-primary,
  #vista-rmiestilo .hero-btn-secondary {
    width: auto;
    flex: 1 1 200px;
  }

}

/* ── Móvil estrecho ── */
@media (max-width: 600px) {
  #vista-rmiestilo .hero-section {
    padding-top: 64px;
  }

  #vista-rmiestilo .scroll-indicator {
    bottom: 20px;
    transform: scale(0.9);
  }

  #vista-rmiestilo .features-section,
  #vista-rmiestilo .trabajos-section,
  #vista-rmiestilo .servicios3d-section,
  #vista-rmiestilo .proceso-section,
  #vista-rmiestilo .precios-section,
  #vista-rmiestilo .testimonios-section,
  #vista-rmiestilo .gallery-section,
  #vista-rmiestilo .footer-section {
    padding-left: 0;
    padding-right: 0;
  }

  #vista-rmiestilo .carousel-wrap {
    padding: 0 8px;
  }

  #vista-rmiestilo .ccname {
    font-size: clamp(0.72rem, 3vw, 0.85rem) !important;
    line-height: 1.2;
  }

  #vista-rmiestilo .servicios3d-grid {
    padding: 0 12px;
  }

  #vista-rmiestilo .testimonio-video-label {
    font-size: clamp(0.72rem, 2.8vw, 0.82rem);
    line-height: 1.35;
  }
}

/* Header cambiador en pantallas estrechas */
@media (max-width: 860px) {
  #cambiador {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
}

/* Móviles muy estrechos: sigue grande, wrap por palabra completa */
@media (max-width: 380px) {
  #vista-rmiestilo .hero-title {
    font-size: clamp(2.55rem, 13.5vw, 3.1rem) !important;
    letter-spacing: -0.04em;
  }

  #vista-rmiestilo .hero-badge {
    font-size: 0.78rem;
    margin-bottom: 12px;
  }

  #vista-rmiestilo .hero-section {
    padding-top: max(52px, calc(env(safe-area-inset-top, 0px) + 48px));
  }
}