/* =====================================================
   MARUZ HEADER - NAVEGACIÓN LIMPIA (DESKTOP & MÓVIL)
   ===================================================== */

.maruz-header {
  --mh-blue: #0b2d66;
  --mh-dark: #08234d;
  --mh-yellow: #ffc400;
  --mh-text: #425675;
  --mh-border: #e4eaf2;

  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 0 2px 14px rgba(8, 35, 77, 0.05);
  border-bottom: 1px solid var(--mh-border);
}

.maruz-header,
.maruz-header * {
  box-sizing: border-box;
}

.maruz-header a {
  text-decoration: none;
}

.maruz-header button {
  font-family: inherit;
  border: none;
  background: none;
}

.mh-container {
  width: min(100% - 32px, 1320px);
  min-height: 74px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* LOGO ORIGINAL */
.mh-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--mh-blue);
  user-select: none;
  text-decoration: none;
}

.mh-logo img {
  height: 44px;
  width: auto;
  display: block;
  transition: transform 0.2s ease;
}

.mh-logo:hover img {
  transform: scale(1.04);
}

.mh-logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
}

.mh-logo-text strong {
  color: #142750;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.mh-logo-text small {
  font-size: 11px;
  letter-spacing: 2px;
  color: #64748b;
  font-weight: 600;
}

/* NAVEGACIÓN DESKTOP (SIN DESPLEGABLES, LIMPIO) */
.mh-navigation {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(16px, 2.2vw, 32px);
}

.mh-nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
}

.mh-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 26px 4px;
  border: 0;
  background: transparent;
  color: var(--mh-text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease;
}

.mh-link:hover,
.mh-link.is-active {
  color: var(--mh-blue);
}

.mh-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 18px;
  left: 0;
  height: 2.5px;
  border-radius: 5px;
  background: var(--mh-yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.mh-link:hover::after,
.mh-link.is-active::after {
  transform: scaleX(1);
}

/* BOTONES DE ACCIÓN */
.mh-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 6px;
}

.mh-login,
.mh-register,
.mh-logout {
  min-height: 40px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid #142750;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.mh-login {
  color: #142750;
  background: #ffffff;
}

.mh-login:hover {
  background: #f1f5f9;
}

.mh-register {
  border-color: #ffd000;
  background: #ffd000;
  color: #102347;
}

.mh-register:hover {
  transform: translateY(-1px);
  background: #f0c300;
  box-shadow: 0 4px 14px rgba(255, 208, 0, 0.3);
}

.mh-logout {
  border-color: #fecdd3;
  color: #e11d48;
  background: #ffffff;
}

.mh-logout:hover {
  background: #fff1f2;
}

.mh-actions form {
  margin: 0;
  display: inline-flex;
}

/* BOTÓN TOGGLE MÓVIL (Hamburguesa animada) */
.mh-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 11px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--mh-border);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mh-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 4px;
  background: var(--mh-blue);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.mh-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(7px) rotate(45deg);
}

.mh-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.mh-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

/* TABLET MEDIA QUERY (1024px) */
@media (max-width: 1024px) {
  .mh-container {
    width: calc(100% - 32px);
    gap: 16px;
  }

  .mh-navigation {
    gap: 16px;
  }

  .mh-link {
    font-size: 13px;
  }

  .mh-login,
  .mh-register,
  .mh-logout {
    padding: 0 14px;
    font-size: 12px;
  }
}

/* =====================================================
   MÓVIL RESPONSIVE (max-width: 900px)
   ===================================================== */
@media (max-width: 900px) {
  .mh-container {
    min-height: 64px;
    width: calc(100% - 24px);
    gap: 0;
  }

  .mh-logo img {
    height: 36px;
  }

  .mh-logo-text strong {
    font-size: 17px;
  }

  .mh-logo-text small {
    font-size: 10px;
    letter-spacing: 1.8px;
  }

  .mh-toggle {
    display: flex;
  }

  /* NAVEGACIÓN EN MÓVIL (Menú desplegable) */
  .mh-navigation {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 20px 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-top: 1px solid var(--mh-border);
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(8, 35, 77, 0.16);
  }

  .mh-navigation.is-open {
    display: flex;
    animation: mhSlideDown 0.22s ease-out forwards;
  }

  @keyframes mhSlideDown {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .mh-nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  /* ENLACES MÓVIL: LIMPIOS, CÓMODOS AL TACTO Y SIN ICONOS */
  .mh-link {
    width: 100%;
    justify-content: flex-start;
    padding: 15px 4px;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid #edf1f6;
  }

  .mh-link.is-active {
    color: var(--mh-blue);
    font-weight: 700;
  }

  .mh-link::after {
    display: none;
  }

  /* ACCIONES Y BOTONES EN MÓVIL */
  .mh-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 18px 0 0;
    padding-top: 14px;
    border-top: 1px solid #edf1f6;
    width: 100%;
  }

  .mh-actions > a:only-child,
  .mh-actions > form:only-child {
    grid-column: 1 / -1;
  }

  .mh-login,
  .mh-register,
  .mh-logout {
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    font-size: 13.5px;
  }

  .mh-actions form {
    width: 100%;
  }

  .mh-actions form button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .maruz-header *,
  .maruz-header *::before,
  .maruz-header *::after {
    transition: none !important;
    animation: none !important;
  }
}
