/* Shared responsive safeguards for COSISEGE pages. Loaded after page styles. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-width: 320px;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 320px;
  max-width: 100%;
  overflow-x: clip;
}

img,
video,
canvas,
svg,
iframe {
  max-width: 100%;
}

img,
video,
canvas {
  height: auto;
}

input,
select,
textarea,
button {
  max-width: 100%;
  font: inherit;
}

table {
  max-width: 100%;
}

@media (max-width: 760px) {
  /* Keep fixed desktop widths from forcing a page wider than the screen. */
  .container,
  .main-container,
  .main-content,
  .content-wrapper,
  .page-container,
  .wrapper {
    width: min(100% - 32px, 100%);
    max-width: 100%;
  }

  .row {
    margin-right: -12px;
    margin-left: -12px;
  }

  pre,
  code {
    overflow-wrap: anywhere;
  }

  .table-wrap,
  .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  iframe {
    width: 100%;
  }
}

@media (max-width: 480px) {
  input,
  select,
  textarea,
  button {
    min-width: 0;
  }

  button,
  input[type="submit"],
  input[type="button"] {
    touch-action: manipulation;
  }
}

/* ---------- Ajustes para móviles reales ---------- */

/* iOS hace zoom automático al enfocar un campo con letra menor de 16 px.
   Subirla a 16 px solo en pantallas pequeñas evita ese salto sin tocar el diseño. */
@media (max-width: 600px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* Quien pide menos movimiento por accesibilidad no debe ver el carrusel ni las órbitas. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Pista de desplazamiento en tablas anchas: se ve que hay más columnas. */
@media (max-width: 700px) {
  .table-wrap,
  .table-responsive {
    position: relative;
    background-image: linear-gradient(to left, rgba(16, 45, 74, .10), rgba(16, 45, 74, 0));
    background-position: right center;
    background-repeat: no-repeat;
    background-size: 26px 100%;
  }
}

/* Nada de texto que se salga por una palabra larga o una URL. */
p,
li,
td,
th,
label,
h1,
h2,
h3,
h4,
h5,
h6,
figcaption {
  overflow-wrap: anywhere;
}