/* Menú móvil y botones flotantes estandarizados (guía, calculadora y auditoría).
   El home y términos ya usan este mismo patrón desde styles.css. */
:root {
  --mnav-surface: #ffffff;
  --mnav-ink: #102925;
  --mnav-muted: #60736f;
  --mnav-border: #dce6e2;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mnav-surface: #0c211c;
    --mnav-ink: #eef9f5;
    --mnav-muted: #98b3aa;
    --mnav-border: #1c3a32;
  }
}
:root[data-theme="dark"] {
  --mnav-surface: #0c211c;
  --mnav-ink: #eef9f5;
  --mnav-muted: #98b3aa;
  --mnav-border: #1c3a32;
}

.mnav-btn,
.mnav { display: none; }

@media (max-width: 860px) {
  /* Botón hamburguesa, igual al del home */
  .mnav-btn {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid var(--mnav-border);
    background: var(--mnav-surface);
    color: var(--mnav-ink);
    cursor: pointer;
  }
  .mnav-btn--on-dark {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: #eef9f5;
  }
  .mnav-btn:focus-visible { outline: 2px solid #19a974; outline-offset: 2px; }

  /* Panel desplegable, igual al del home */
  .mnav {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    top: 68px;
    z-index: 60;
    padding: 25px 18px 30px;
    background: var(--mnav-surface);
    border-bottom: 1px solid var(--mnav-border);
    box-shadow: 0 20px 60px #0d332e1a;
    font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-130%);
    transition: all 0.25s;
  }
  .mnav.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .mnav a {
    display: block;
    padding: 14px 10px;
    border-bottom: 1px solid var(--mnav-border);
    color: var(--mnav-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    transition: color 0.2s;
  }
  .mnav a:hover { color: #19a974; }
  .mnav a.mnav-cta {
    display: flex;
    justify-content: center;
    margin-top: 16px;
    border: 0;
    border-radius: 9px;
    background: #0b3b54;
    color: #fff;
  }

  /* Guía y calculadora: logo a la izquierda, toggle y menú a la derecha */
  .site-header-inner {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 10px;
    min-height: 68px;
  }
  .site-header-inner .theme-toggle {
    position: static;
    transform: none;
    margin-left: auto;
  }
}

/* Botones flotantes en móvil: ancho completo, como el de la auditoría */
@media (max-width: 700px) {
  .top-btn {
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    min-height: 54px;
    padding: 0 26px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
  }
  .actions-row {
    justify-content: stretch;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .actions-row .btn {
    flex: 1 1 auto;
    width: 100%;
    min-height: 54px;
    padding: 0 26px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
  }
  body:has(.top-btn) .site-footer { padding-bottom: 88px; }
}
