/* ============================================================
   RUTA PTY — Navegación móvil (barra inferior + hoja "Más")
   Se activa solo en <= 860px. No altera el header de escritorio.
   ============================================================ */

.mnav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  height: calc(68px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: 56px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 246, .97);
  box-shadow: 0 -8px 24px rgba(51, 49, 68, .10);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.mnav-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 5px 2px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: .6rem;
  font-weight: 700;
  line-height: 1.12;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mnav-tab > span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mnav-tab > svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.mnav-tab:active {
  transform: scale(.96);
}

.mnav-tab.is-active {
  color: var(--marker-deep);
}

.mnav-tab.is-active::before {
  content: '';
  position: absolute;
  top: -7px;
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: var(--marker);
}

.mnav-create {
  transform: translateY(-20px);
}

.mnav-create-bubble {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 4px solid var(--paper-3);
  border-radius: 50%;
  background: var(--marker);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(46, 219, 83, .35);
  transition: background .18s ease, transform .18s ease;
}

.mnav-create-bubble svg {
  width: 24px;
  height: 24px;
}

.mnav-create.is-active .mnav-create-bubble {
  background: var(--sun);
  transform: translateY(-1px);
}

.mnav-create.is-active::before {
  display: none;
}

.mnav-create .mnav-label {
  flex: 0 0 auto;
  margin-top: 1px;
}

/* ---------- Hoja "Más" ---------- */
.mnav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(51, 49, 68, .52);
  opacity: 0;
  transition: opacity .22s ease;
}

.mnav-backdrop[hidden] {
  display: none;
}

.mnav-backdrop.is-open {
  opacity: 1;
}

.mnav-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  max-height: 88dvh;
  border-radius: 24px 24px 0 0;
  background: var(--paper-3);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .28);
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.22, .9, .3, 1);
}

.mnav-sheet[hidden] {
  display: none;
}

.mnav-sheet.is-open {
  transform: translateY(0);
}

.mnav-grab {
  width: 44px;
  height: 5px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: var(--line);
  touch-action: none;
  cursor: grab;
}

.mnav-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .5rem 1rem .55rem;
}

.mnav-sheet-head h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: .04em;
}

.mnav-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.mnav-close svg {
  width: 16px;
  height: 16px;
}

.mnav-sheet-body {
  overflow-y: auto;
  padding: 0 .85rem .8rem;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.mnav-group {
  margin-top: .7rem;
}

.mnav-group h3 {
  margin: 0 .35rem .4rem;
  color: var(--ink-soft);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mnav-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem;
}

.mnav-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  padding: .58rem .55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
}

.mnav-link:hover,
.mnav-link:focus-visible {
  background: var(--paper-2);
}

.mnav-link svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--marker-deep);
}

.mnav-link-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mnav-link-wide {
  grid-column: 1 / -1;
}

.mnav-link-quiet {
  border-style: dashed;
  color: var(--ink-soft);
}

.mnav-link-quiet svg {
  color: var(--ink-soft);
}

.mnav-sheet-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .6rem .9rem calc(.7rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper-3);
}

.mnav-lang {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--ink-soft);
  font-size: .72rem;
}

.mnav-lang-label {
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mnav-lang-btn {
  padding: .22rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: .7rem;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
}

.mnav-lang-btn.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.mnav-foot-brand {
  font-family: var(--font-display);
  font-size: .82rem;
  letter-spacing: .08em;
  color: var(--ink);
}

.mnav-foot-brand b {
  color: var(--marker-deep);
}

/* ---------- Ajustes de página en móvil ---------- */
/* ---------- Mural de Fiestas Patrias (header móvil, noviembre) ---------- */
.fiesta-mural {
  display: none;
  flex: none;
  width: clamp(200px, 64vw, 260px);
  height: 46px;
  margin-left: .25rem;
  pointer-events: none;
  user-select: none;
}

.fiesta-mural svg {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 860px) {
  html {
    scroll-padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .fiesta-mural {
    display: block;
  }

  .mnav {
    display: grid;
  }

  /* El header de escritorio se retira cuando hay JS; sin JS queda el
     botón de menú clásico como respaldo. */
  html.mnav-ready .nav-toggle,
  html.mnav-ready .nav-actions,
  html.mnav-ready .nav-links,
  html.mnav-ready .nav-links.open {
    display: none;
  }

  .site-nav .container {
    min-height: 62px;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  /* La barra inferior tapa el final del footer: le damos aire. */
  .site-footer {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  /* El banner de cookies de la home vive abajo: lo subimos sobre la barra
     para que no tape la navegación. */
  body .cookie-banner {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }

  /* Arpy flota por encima de la barra, no encima de ella. */
  .arpy-fab {
    right: 14px;
    bottom: calc(86px + env(safe-area-inset-bottom));
  }

  body.mnav-open {
    overflow: hidden;
  }

  body.mnav-open .arpy-fab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (min-width: 861px) {
  .mnav-sheet,
  .mnav-backdrop {
    display: none;
  }
}

@media (max-width: 380px) {
  .mnav-tab {
    font-size: .55rem;
  }

  .mnav-links {
    grid-template-columns: 1fr;
  }

  .mnav-tab > svg {
    width: 20px;
    height: 20px;
  }

  .mnav-create-bubble {
    width: 46px;
    height: 46px;
  }

  .mnav-create-bubble svg {
    width: 22px;
    height: 22px;
  }

  .mnav-link {
    font-size: .74rem;
  }
}

@media (max-height: 520px) {
  .mnav-sheet {
    max-height: 94dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mnav-tab,
  .mnav-create-bubble,
  .mnav-backdrop,
  .mnav-sheet {
    transition: none;
  }
}
