/* === MODO MÓVIL === */
@media (max-width: 700px) {

  body {
    height: 100dvh; /* evita el solapamiento con la barra del navegador */
    min-height: 100dvh;
  }

  header {
    grid-column: 1 / 25;
    padding-left: calc(100vw / 12);
    padding-right: calc(100vw / 12);
  }

  nav {
    grid-column: 1 / 25;
    padding-left: calc(100vw / 12);
  }
  
  nav:nth-of-type(2) {
    grid-column: 1 / 24;
    grid-row: 5 / 6;
  }

  main {
    display: flex;
    overflow-y: auto;
    
    padding-bottom: 0;
    padding-top: 0;
    padding-left: calc(100vw / 12);
    padding-right: calc(100vw / 12);
  }

  main section,
  main article section {
    padding-left: 0;
  }

  /* Formularios a ancho completo en móvil */
  form input,
  form select,
  form textarea {
    max-width: 100%;
    width: 100%;
  }

  /* Footer deslizable en móvil */
  footer {
    grid-row: 24 / 25;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;

    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    justify-content: flex-start;
    align-items: stretch;

    position: relative;
  }

  footer nav ul {
    display: flex;
    flex-direction: row;
    list-style: none;
    padding: 0;
    margin: 0;
  }

  footer nav li {
    flex: 0 0 100vw;
    scroll-snap-align: center;
    position: relative;
    text-align: center;
  }

  footer nav a {
    display: inline-block;
    white-space: normal;
    text-align: center;
    position: relative;
  }

  /* Flechas de scroll visual */

  /* 1º elemento → flecha derecha */
  footer nav li:first-child::after {
    content: "›";
    font-size: 1.5rem;
    position: absolute;
    right: calc(100vw / 12);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
  }

  /* Último elemento → flecha izquierda */
  footer nav li:last-child::before {
    content: "‹";
    font-size: 1.5rem;
    position: absolute;
    left: calc(100vw / 12);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
  }

  /* Intermedios → izquierda + derecha */
  footer nav li:not(:first-child):not(:last-child)::before,
  footer nav li:not(:first-child):not(:last-child)::after {
    font-size: 1.5rem;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
  }

  footer nav li:not(:first-child):not(:last-child)::before {
    content: "‹";
    left: calc(100vw / 12);
  }

  footer nav li:not(:first-child):not(:last-child)::after {
    content: "›";
    right: calc(100vw / 12);
  }

  footer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}
