/* Capa móvil — común a todas las páginas.
   Cada selector de atributo va en dos formas: tal cual está escrito en el HTML y con el espacio
   tras «:» / «;» que añade el navegador al reescribir el atributo style (prototipo).
   Los estilos de la maqueta van en línea; aquí se sobrescriben con selectores de
   atributo para pantallas estrechas. En WordPress va tal cual al style.css del tema hijo. */

.menu-toggle, .menu-btn { display: none; }

@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  div[style*="min-width:1280px"], div[style*="min-width: 1280px"] { min-width: 0 !important; }

  /* Cabecera: logo · idioma/zona cliente · hamburguesa; menú desplegable debajo */
  [data-header][style] { flex-wrap: wrap; gap: 10px !important; padding: 12px 16px !important; }
  label[style*="display:flex"], label[style*="display: flex"] { flex-wrap: nowrap !important; }
  html[data-scrolled] [data-header] { padding: 10px 16px !important; }
  [data-header] img { height: 28px !important; }
  [data-header] > div:last-of-type { order: 1; margin-left: auto; gap: 10px !important; flex-wrap: nowrap !important; }
  [data-header] > div:last-of-type > div { gap: 6px !important; font-size: 10px !important; }
  [data-header] > div:last-of-type a { padding: 8px 12px !important; font-size: 12px !important; white-space: nowrap; }
  .menu-btn { display: flex; flex: none; order: 2; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; cursor: pointer; }
  .menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 18px; height: 2px; background: #FFFFFF; border-radius: 2px; position: relative; content: ""; }
  .menu-btn span::before { position: absolute; top: -6px; }
  .menu-btn span::after { position: absolute; top: 6px; }
  .menu-toggle:checked + .menu-btn span { background: transparent; }
  .menu-toggle:checked + .menu-btn span::before { top: 0; transform: rotate(45deg); }
  .menu-toggle:checked + .menu-btn span::after { top: 0; transform: rotate(-45deg); }
  [data-nav] { display: none !important; order: 3; width: 100%; flex-direction: column; gap: 0 !important; padding-top: 6px; }
  .menu-toggle:checked ~ [data-nav] { display: flex !important; }
  [data-nav] a { padding: 15px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 15px !important; }

  /* Rejillas a una columna; las cifras, a dos */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  [style*="grid-auto-flow:column"], [style*="grid-auto-flow: column"] { grid-auto-flow: row !important; grid-template-columns: 1fr 1fr !important; }
  [style*="grid-column:span"], [style*="grid-column: span"] { grid-column: auto !important; }
  [style*="grid-auto-rows:220px"][style*="grid"], [style*="grid-auto-rows: 220px"][style*="grid"] { grid-auto-rows: 200px !important; grid-template-columns: 1fr !important; }
  [style*="padding:28px 32px"], [style*="padding: 28px 32px"] { padding: 18px 20px !important; }
  [style*="repeat(4,1fr)"], [style*="repeat(4, 1fr)"], [style*="repeat(4, 1fr)"] { grid-template-columns: 1fr 1fr !important; }
  [style*="display:flex"], [style*="display: flex"], [style*="display:inline-flex"], [style*="display: inline-flex"] { flex-wrap: wrap; }
  [style*="gap:60px"], [style*="gap: 60px"], [style*="gap:56px"], [style*="gap: 56px"], [style*="gap:48px"], [style*="gap: 48px"], [style*="gap:40px"], [style*="gap: 40px"] { gap: 28px !important; }

  /* Píldoras (antetítulo del hero): sin partir, texto más pequeño */
  [style*="border-radius:999px"][style*="inline-flex"], [style*="border-radius: 999px"][style*="inline-flex"] { flex-wrap: nowrap !important; }
  [style*="inline-flex"] > span[style*="letter-spacing"] { font-size: 10px !important; letter-spacing: .1em !important; }

  /* Márgenes laterales y verticales */
  [style*=" 48px"] { padding-left: 20px !important; padding-right: 20px !important; }
  [style*="padding:92px"], [style*="padding: 92px"], [style*="padding:88px"], [style*="padding: 88px"], [style*="padding:80px"], [style*="padding: 80px"], [style*="padding:76px"], [style*="padding: 76px"] { padding-top: 56px !important; padding-bottom: 56px !important; }
  [style*="padding:34px 36px"], [style*="padding: 34px 36px"], [style*="padding:28px 36px"], [style*="padding: 28px 36px"], [style*="padding:30px 36px"], [style*="padding: 30px 36px"], [style*="padding:26px 30px"], [style*="padding: 26px 30px"] { padding: 22px 20px !important; }
  [style*="border-right:1px solid"], [style*="border-right: 1px solid"] { border-right: 0 !important; border-bottom: 1px solid rgba(255,255,255,.08); }

  /* Tipografía */
  h1 { font-size: 40px !important; line-height: 1.08 !important; }
  h2 { font-size: 30px !important; line-height: 1.18 !important; }
  [style*="font-size:46px"], [style*="font-size: 46px"], [style*="font-size:38px"], [style*="font-size: 38px"] { font-size: 32px !important; }
  [style*="font-size:25px"], [style*="font-size: 25px"] { font-size: 20px !important; }
  [style*="font-size:19px"], [style*="font-size: 19px"] { font-size: 17px !important; }

  /* Alturas fijas de escritorio */
  [style*="height:780px"], [style*="height: 780px"] { height: auto !important; min-height: 640px; }
  [style*="min-height:560px"], [style*="min-height: 560px"], [style*="min-height:520px"], [style*="min-height: 520px"] { min-height: 340px !important; }
  [style*="height:452px"], [style*="height: 452px"] { height: 260px !important; }
  [style*="position:sticky;top:1"], [style*="position: sticky; top: 1"] { position: static !important; }
}

/* Tableta (601–900 px): las rejillas vuelven a dos columnas; listas y fichas siguen a una */
@media (min-width: 601px) and (max-width: 900px) {
  [style*="grid-template-columns"] { grid-template-columns: 1fr 1fr !important; }
  [style*="150px 1fr"] { grid-template-columns: 110px 1fr !important; }
  #sistemas > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  [style*="grid-auto-rows:220px"][style*="grid"], [style*="grid-auto-rows: 220px"][style*="grid"] { grid-template-columns: 1fr 1fr !important; }
}
