/* =====================================================
   ÍNDICE
   01. Variables
   02. Configuración general
   03. Utilidades
   04. Header y navegación
   05. Hero
   06. Títulos de sección
   07. Información de la empresa
   08. Servicios
   09. Catálogo
   10. Clientes (logos)
   11. Contacto y formulario
   12. Footer
   13. Chatbot
   14. Responsive (de mayor a menor)
   15. Accesibilidad (reduced motion)
===================================================== */


/* =====================================================
   CONVENCIÓN DE UNIDADES
   html { font-size: 62.5% }  →  1rem = 10px

   font-size, margin, padding, gap ....... rem
   width ................................. %, rem o px según el caso
   height ................................ rem, px o auto
   border-radius ......................... rem o px
   border, border-width, box-shadow ...... px
   media queries ......................... px
===================================================== */


/* =====================================================
   01. VARIABLES
===================================================== */

:root {
  /* Colores */
  --blue: #033473;
  --blue2: #1d5273;

  --green: #04bf55;
  --green2: #03a64a;
  --green-glow: rgba(4, 191, 85, 0.4);

  --light: #f2f2f2;
  --white: #fff;

  --ink: #102238;
  --muted: #667789;
  --line: #dbe3ea;

  /* Efectos */
  --shadow: 0 18px 50px rgba(3, 52, 115, 0.12);
  --radius: 1.8rem;

  /* Layout */
  --gutter: 7vw;

  /* Animaciones */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* =====================================================
   02. CONFIGURACIÓN GENERAL
===================================================== */

* {
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
  scroll-padding-top: 8rem;
}

body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  font-size: 1.6rem;
  color: var(--ink);
  background: #fff;
  line-height: 1.55;
}

p {
  text-align: justify;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}


/* =====================================================
   03. UTILIDADES
===================================================== */

.hidden {
  display: none;
}

.section-pad {
  padding: 9.2rem var(--gutter);
}

.section-light {
  background: var(--light);
}

.eyebrow {
  display: inline-block;
  color: var(--green2);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.14em;
}


/* =====================================================
   04. HEADER Y NAVEGACIÓN
===================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;

  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 8rem;
  padding: 0 var(--gutter);

  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(1.6rem);
  border-bottom: 1px solid rgba(3, 52, 115, 0.08);
}

/* Marca */

.brand {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.brand-logo {
  height: 4.2rem;
  width: auto;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  color: var(--blue);
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 1.12rem;
}

/* Menú principal */

.main-nav {
  display: flex;
  align-items: center;
  gap: 2.4rem;
}

.main-nav a {
  color: var(--blue);
  font-size: 1.47rem;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.main-nav a:hover {
  color: var(--green2);
}

/* Botón de acceso */

.main-nav .btn-login {
  padding: 0.9rem 2.2rem;
  background: linear-gradient(135deg, var(--blue2) 0%, var(--green2) 100%);
  color: var(--white);
  font-weight: 700;
  font-size: 1.44rem;
  border-radius: 99rem;
  box-shadow: 0 4px 14px var(--green-glow);
  transition: all 0.3s ease;
}

.main-nav .btn-login:hover {
  color: var(--white);
  transform: translateY(-0.2rem);
  box-shadow: 0 6px 22px rgba(4, 191, 85, 0.6);
}

/* Botón hamburguesa (visible solo en tablet/móvil) */

.nav-toggle {
  display: none;
  position: relative;
  width: 4.4rem;
  height: 4.4rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--white);
}

.nav-toggle span {
  position: absolute;
  left: 1rem;
  right: 1rem;
  height: 0.2rem;
  border-radius: 1rem;
  background: var(--blue);
  transition:
    top 0.25s ease,
    transform 0.25s ease,
    opacity 0.2s ease;
}

.nav-toggle span:nth-child(1) {
  top: 1.3rem;
}

.nav-toggle span:nth-child(2) {
  top: 2rem;
}

.nav-toggle span:nth-child(3) {
  top: 2.7rem;
}

/* Animación hamburguesa → X */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 2rem;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 2rem;
  transform: rotate(-45deg);
}

.nav-toggle:focus-visible {
  outline: 0.3rem solid rgba(3, 52, 115, 0.25);
  outline-offset: 0.2rem;
}


/* =====================================================
   05. HERO
===================================================== */

.hero {
  min-height: 65rem;
  display: flex;
  align-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 85% 30%,
      rgba(29, 82, 115, 0.9),
      transparent 55%),
    linear-gradient(135deg, #021f47 0%, var(--blue) 60%, #023d79 100%);
}

/* Distribución del texto y la imagen */
.hero-container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 4rem;
  width: 100%;
  max-width: 150rem;
  margin: 0 auto;
}

/* Título principal */
.hero h1 {
  max-width: 65rem;
  margin: 1.8rem 0 2.2rem;
  font-size: clamp(4rem, 4.5vw, 7.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #fff;
}

/* Texto descriptivo */
.hero p {
  max-width: 55rem;
  color: #dbe8f5;
  font-size: 1.76rem;
}

/* Contenedor visual de la imagen */
.hero-visual {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Imagen principal */
.hero-img {
  display: block;
  width: 100%;
  max-width: 65rem;
  height: 48rem;
  object-fit: contain;
  object-position: center;

  -webkit-mask-image: radial-gradient(ellipse at center, #000 65%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 65%, transparent 100%);
}


/* =====================================================
   06. TÍTULOS DE SECCIÓN
===================================================== */

.section-heading {
  max-width: 78rem;
  margin: 0 auto 4.4rem;
  text-align: center;
}

.section-heading h2 {
  margin: 1rem 0 1.2rem;
  font-size: clamp(3.2rem, 3.3vw, 5.44rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-heading p {
  color: var(--muted);
}

.split-heading {
  max-width: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 4rem;
  text-align: left;
}

.split-heading>p {
  max-width: 43rem;
  margin: 0;
}


/* =====================================================
   07. INFORMACIÓN DE LA EMPRESA
===================================================== */

.company-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.info-card {
  display: flex;
  flex-direction: column;
  min-height: 20rem;
  padding: 2.8rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 34, 56, 0.03);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.info-card:hover {
  transform: translateY(-0.4rem);
  box-shadow: 0 12px 30px rgba(3, 52, 115, 0.08);
}

.info-card span {
  color: var(--green2);
  font-size: 1.36rem;
  font-weight: 900;
  margin-bottom: 0.6rem;
}

.info-card h3 {
  margin: 0.6rem 0 1rem;
  font-size: 2rem;
  font-weight: 700;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.52rem;
}

/* Variante destacada */
.info-card.featured {
  background: var(--blue);
  color: white;
}

.info-card.featured span {
  color: #93ffc4;
}

.info-card.featured p {
  color: #dbe8f5;
}


/* =====================================================
   08. SERVICIOS
===================================================== */

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.service-card {
  padding: 3rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition:
    transform 0.3s ease,
    border-color 0.3s ease;
}

.service-card:hover {
  transform: translateY(-0.4rem);
  border-color: var(--green2);
}

.service-icon {
  width: 4.8rem;
  height: 4.8rem;
  display: grid;
  place-items: center;
  border-radius: 1.4rem;
  background: rgba(4, 191, 85, 0.12);
  color: var(--green2);
  font-weight: 900;
}

.service-card h3 {
  margin: 2rem 0 0.8rem;
  font-size: 1.92rem;
  font-weight: 700;
}

.service-card p {
  margin: 0;
  color: var(--muted);
}


/* =====================================================
   09. CATÁLOGO
===================================================== */

.catalog-grid {
  display: flex;
  gap: 2.2rem;
  padding: 1rem 0.4rem 2.8rem;

  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.catalog-grid .info-card {
  flex: 0 0 32rem;
  min-height: 32rem;
  scroll-snap-align: start;
}

/* Barra de desplazamiento */
.catalog-grid::-webkit-scrollbar {
  height: 0.8rem;
}

.catalog-grid::-webkit-scrollbar-track {
  background: #e5e9ed;
  border-radius: 1rem;
}

.catalog-grid::-webkit-scrollbar-thumb {
  background: var(--blue);
  border-radius: 1rem;
}

/* Tarjeta */
.catalog-card {
  display: flex;
  flex-direction: column;
  text-align: left;
}

/* Contenedor de imagen */
.img-container {
  width: 100%;
  height: 19rem;
  margin-bottom: 1.6rem;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  overflow: hidden;
}

.img-design {
  width: 100%;
  height: 100%;
  padding: 0.8rem;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.catalog-card:hover .img-design {
  transform: scale(1.12);
}


/* =====================================================
   10. CLIENTES (LOGOS)
===================================================== */

.clients-group+.clients-group {
  margin-top: 4.8rem;
}

.clients-title {
  margin: 0 0 2rem;
  padding-bottom: 1rem;

  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);

  border-bottom: 1px solid var(--line);
}

.logo-grid {
  list-style: none;
  margin: 0;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 2rem;
}

.logo-item {
  height: 12rem;
  padding: 2rem;

  display: flex;
  align-items: center;
  justify-content: center;

  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);

  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.logo-item:hover {
  transform: translateY(-0.4rem);
  border-color: var(--green2);
  box-shadow: 0 12px 30px rgba(3, 52, 115, 0.08);
}

.logo-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;

  filter: grayscale(1);
  opacity: 0.75;
  transition:
    filter 0.3s ease,
    opacity 0.3s ease;
}

.logo-item:hover img {
  filter: none;
  opacity: 1;
}


/* =====================================================
   11. CONTACTO Y FORMULARIO
===================================================== */

/* Datos de contacto */

.contact-data {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.contact-data div {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-data strong {
  color: var(--green2);
  font-size: 1.36rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.contact-data span {
  font-weight: 600;
}

/* Formulario */

.form {
  margin-top: 3rem;
}

.contact-form {
  padding: 3rem;
  background: var(--light);
  border: 1px solid var(--line);
  border-radius: 2.2rem;
}

label {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.6rem;
  font-size: 1.31rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  padding: 1.2rem 1.3rem;

  border: 1px solid #cfd9e1;
  border-radius: 1.1rem;
  outline: none;

  background: white;
  color: var(--ink);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(3, 52, 115, 0.08);
}

/* Botón de envío */

.btn-submit {
  padding: 1rem 2rem;
  margin-top: 2rem;
  border: none;
  border-radius: 1rem;
  background-color: var(--blue);
  color: white;
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Mensajes de resultado */

.form-result,
.form-error {
  margin: 1.1rem 0 0;
  font-size: 1.31rem;
}

.form-result.ok {
  color: var(--green2);
}

.form-error {
  color: #a62d2d;
}


/* =====================================================
   12. FOOTER
===================================================== */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;

  padding: 3rem var(--gutter);

  background: var(--blue);
  color: white;
  font-size: 1.36rem;
}

.site-footer div {
  display: grid;
  gap: 0.3rem;
}

.site-footer span {
  opacity: 0.8;
}


/* =====================================================
   13. CHATBOT AUTOMAQ MÉXICO
===================================================== */

.chatbot {
  font-family: "DM Sans", sans-serif;
}

/* ---------- Botón flotante ---------- */

.chat-toggle {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  z-index: 1000;

  width: 6rem;
  height: 6rem;

  display: grid;
  place-items: center;

  border: none;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 2.6rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);

  transition:
    background 0.3s ease,
    transform 0.4s var(--ease-spring),
    box-shadow 0.3s ease;
}

.chat-toggle:hover {
  background: var(--green2);
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(3, 166, 74, 0.35);
}

.chat-toggle:active {
  transform: scale(0.94);
}

/* Ícono interno (el JS cambia 💬 ↔ ✕); gira al abrir/cerrar */
.chat-toggle .chat-toggle-icon {
  display: inline-block;
  transition: transform 0.4s var(--ease-spring);
}

.chat-toggle.is-open .chat-toggle-icon {
  transform: rotate(90deg);
}

/* ---------- Ventana del chat ---------- */

.chat-panel {
  position: fixed;
  right: 2.5rem;
  bottom: 10rem;
  z-index: 999;

  width: 35rem;
  height: 47rem;
  max-height: calc(100dvh - 12.5rem);

  display: flex;
  flex-direction: column;

  background: white;
  border: 1px solid var(--line);
  border-radius: 1.6rem;
  overflow: hidden;
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.2);

  /* Estado cerrado */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(2.4rem) scale(0.9);
  transform-origin: bottom right;

  /* Al cerrar: se desvanece rápido y luego se oculta */
  transition:
    opacity 0.2s ease,
    transform 0.25s ease,
    visibility 0s linear 0.25s;
}

.chat-panel.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);

  /* Al abrir: pequeño rebote */
  transition:
    opacity 0.25s ease,
    transform 0.45s var(--ease-spring),
    visibility 0s;
}

/* ---------- Encabezado ---------- */

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 1.7rem;
  background: var(--blue);
  color: white;
}

.chat-header strong {
  display: block;
  font-size: 1.6rem;
}

.chat-header span {
  color: #a9f5c7;
  font-size: 1.2rem;
}

.chat-header button {
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  transition: transform 0.25s ease;
}

.chat-header button:hover {
  transform: rotate(90deg);
}

/* ---------- Mensajes ---------- */

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  background: #f8fafc;

  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.bot-message,
.user-message {
  max-width: 88%;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.2rem;

  border-radius: 1.2rem;
  font-size: 1.4rem;
  overflow-wrap: anywhere;

  animation: msgInLeft 0.35s var(--ease-out) both;
}

.bot-message {
  background: #e8edf3;
  color: var(--ink);
  border-bottom-left-radius: 0.4rem;
}

.user-message {
  margin-left: auto;
  background: var(--blue);
  color: white;
  border-bottom-right-radius: 0.4rem;

  animation-name: msgInRight;
}

@keyframes msgInLeft {
  from {
    opacity: 0;
    transform: translateX(-1.4rem) translateY(0.8rem) scale(0.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes msgInRight {
  from {
    opacity: 0;
    transform: translateX(1.4rem) translateY(0.8rem) scale(0.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Indicador "escribiendo..." ---------- */

.typing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  padding: 1.4rem 1.6rem;
}

.typing span {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--muted);
  animation: typingDot 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingDot {

  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-0.5rem);
  }
}

/* ---------- Opciones rápidas ---------- */

.quick-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 1.2rem 0;
}

.quick-options button {
  padding: 1rem;

  text-align: left;
  font-size: 1.3rem;

  background: white;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 0.9rem;

  /* Cada botón entra con un pequeño retraso escalonado */
  animation: optionIn 0.4s var(--ease-out) both;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.quick-options button:nth-child(1) {
  animation-delay: 0.05s;
}

.quick-options button:nth-child(2) {
  animation-delay: 0.10s;
}

.quick-options button:nth-child(3) {
  animation-delay: 0.15s;
}

.quick-options button:nth-child(4) {
  animation-delay: 0.20s;
}

.quick-options button:nth-child(5) {
  animation-delay: 0.25s;
}

.quick-options button:hover {
  background: var(--blue);
  color: white;
  transform: translateX(0.4rem);
  box-shadow: 0 3px 10px rgba(3, 52, 115, 0.15);
}

@keyframes optionIn {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Zona de escritura ---------- */

.chat-input-area {
  display: flex;
  gap: 0.8rem;
  padding: 1.2rem;
  background: white;
  border-top: 1px solid var(--line);
}

.chat-input-area input {
  flex: 1;
  min-width: 0;
  padding: 1rem 1.3rem;
  font-size: 1.3rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
}

.chat-input-area button {
  width: 4rem;
  height: 4rem;
  border: none;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.chat-input-area button:hover {
  background: var(--green2);
  transform: scale(1.08);
}


/* =====================================================
   14. RESPONSIVE (de mayor a menor)
===================================================== */

/* ---------- Laptops pequeñas · ≤ 1200px ---------- */

@media (max-width: 1200px) {
  .main-nav {
    gap: 1.8rem;
  }

  .hero-container {
    gap: 3rem;
  }

  .service-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* ---------- Tablet · ≤ 992px ---------- */

@media (max-width: 992px) {
  :root {
    --gutter: 5vw;
  }

  .section-pad {
    padding: 7.2rem var(--gutter);
  }

  /* Navegación: menú desplegable con botón */
  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    flex-direction: column;
    align-items: stretch;
    gap: 0;

    max-height: calc(100vh - 8rem);
    max-height: calc(100dvh - 8rem);
    overflow-y: auto;

    padding: 0.8rem var(--gutter) 2.4rem;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(3, 52, 115, 0.12);

    /* Cerrado por defecto */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-1rem);
    transition:
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0.25s;
  }

  .main-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .main-nav a {
    padding: 1.4rem 0;
    font-size: 1.7rem;
    border-bottom: 1px solid var(--line);
  }

  .main-nav .btn-login {
    margin-top: 1.8rem;
    padding: 1.3rem 2.2rem;
    text-align: center;
    border-bottom: 0;
  }

  /* Hero: una columna, centrado */
  .hero {
    min-height: auto;
    padding-top: 5.6rem;
    padding-bottom: 4.8rem;
  }

  .hero-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-copy {
    text-align: center;
  }

  .hero h1,
  .hero p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero p {
    text-align: center;
  }

  .hero-img {
    max-width: 52rem;
    height: 36rem;
  }

  /* Encabezados */
  .section-heading {
    margin-bottom: 3.6rem;
  }

  .split-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.6rem;
  }

  .split-heading>p {
    max-width: none;
  }

  /* Rejillas */
  .service-grid,
  .company-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ---------- Tablet vertical / móvil grande · ≤ 768px ---------- */

@media (max-width: 768px) {
  :root {
    --gutter: 2.4rem;
  }

  html {
    scroll-padding-top: 7rem;
  }

  /* En columnas angostas el texto justificado deja "ríos" de espacios */
  p {
    text-align: left;
  }

  .section-pad {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }

  /* Header */
  .site-header {
    height: 7rem;
  }

  .main-nav {
    max-height: calc(100vh - 7rem);
    max-height: calc(100dvh - 7rem);
  }

  .brand-logo {
    height: 3.6rem;
  }

  .brand strong {
    font-size: 1.45rem;
  }

  /* Hero */
  .hero {
    padding-top: 4.4rem;
    padding-bottom: 4rem;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 7vw, 4.4rem);
  }

  .hero p {
    font-size: 1.7rem;
  }

  .hero-img {
    max-width: 46rem;
    height: 30rem;
  }

  .section-heading {
    margin-bottom: 3.2rem;
  }

  /* Clientes */
  .logo-grid {
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1.6rem;
  }

  .logo-item {
    height: 10rem;
    padding: 1.6rem;
  }

  /* Formulario (16px evita el zoom automático en iOS) */
  input,
  textarea,
  select {
    font-size: 1.6rem;
  }

  .contact-form {
    padding: 2.4rem;
  }

  .g-recaptcha {
    margin: 1rem 0 1.4rem;
  }

  /* Footer apilado */
  .site-footer {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}


/* ---------- Móvil · ≤ 576px ---------- */

@media (max-width: 576px) {
  :root {
    --gutter: 2rem;
  }

  .section-pad {
    padding-top: 5.2rem;
    padding-bottom: 5.2rem;
  }

  .hero {
    padding-top: 3.6rem;
    padding-bottom: 3.2rem;
  }

  .hero p {
    font-size: 1.6rem;
  }

  .hero-img {
    height: 24rem;
  }

  .section-heading h2 {
    font-size: 2.6rem;
  }

  /* Una columna */
  .service-grid,
  .company-grid {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  .service-card {
    padding: 2.4rem;
  }

  .info-card {
    padding: 2.2rem;
    min-height: auto;
  }

  .info-card h3 {
    font-size: 1.8rem;
  }

  /* Catálogo: carrusel; la siguiente tarjeta asoma como pista */
  .catalog-grid {
    gap: 1.4rem;
  }

  .catalog-grid .info-card {
    flex: 0 0 min(28rem, 82%);
    min-height: 28rem;
  }

  .img-container {
    height: 16rem;
  }

  /* Clientes: 3 logos por fila */
  .logo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
  }

  .logo-item {
    height: 9rem;
    padding: 1.4rem;
  }

  /* Formulario */
  .contact-form {
    padding: 2rem 1.6rem;
  }

  .btn-submit {
    width: 100%;
  }
}


/* ---------- Chatbot en celulares · ≤ 480px ---------- */

@media (max-width: 480px) {
  .chat-panel {
    right: 1.2rem;
    left: 1.2rem;
    bottom: 8.5rem;
    width: auto;
    height: min(47rem, calc(100dvh - 10.5rem));
  }

  .chat-toggle {
    right: 1.8rem;
    bottom: 1.8rem;
  }
}


/* ---------- Móvil pequeño · ≤ 400px ---------- */

@media (max-width: 400px) {
  :root {
    --gutter: 1.6rem;
  }

  .brand {
    gap: 0.8rem;
  }

  .brand-logo {
    height: 3.2rem;
  }

  .brand strong {
    font-size: 1.3rem;
    letter-spacing: 0.02em;
  }

  .hero-img {
    height: 20rem;
  }

  .section-heading h2 {
    font-size: 2.4rem;
  }

  .catalog-grid .info-card {
    flex: 0 0 86%;
  }

  /* El reCAPTCHA mide 304px de ancho: se reduce para que no desborde */
  .g-recaptcha {
    transform: scale(0.88);
    transform-origin: 0 0;
  }
}


/* =====================================================
   15. ACCESIBILIDAD: reducir movimiento
===================================================== */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}