/*
<header class="header">
  <button class="hd-bn-hamburguesa" type="button" aria-label="Menú de navegación">
    <i class="bi bi-list"></i>
    <i class="bi bi-x-lg"></i>
  </button>

  <p class="hd-p-logo">[Logo]</p>

  <button class="hd-bn-modos" type="button" aria-label="Cambiar modo de color">
    <i class="bi bi-sun hd-bn-modos-sun"></i>
    <i class="bi bi-moon hd-bn-modos-moon"></i>
  </button>

  <nav class="hd-nav" aria-label="Navegación principal">
    <ul class="hd-nav-ul">
      <li class="hd-nav-ul-li"><a class="hd-nav-ul-li-a" href="#Inicio">Inicio</a></li>
      <li class="hd-nav-ul-li">
        <a class="hd-nav-ul-li-a" href="#Categorias">Categorías</a>
        <ul class="submenu"></ul>
      </li>
      <li class="hd-nav-ul-li"><a class="hd-nav-ul-li-a" href="#Datos">Información</a></li>
    </ul>
  </nav>
</header>
*/

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5rem;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0;
  gap: 0.5rem;

  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);

  background: rgba(217, 195, 195, 0.75);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid #ddd;

  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

body.dark .header {
  background: rgba(30, 30, 30, 0.85);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.7),
    0 1px 2px rgba(0, 0, 0, 0.3);
  border-bottom-color: #444;
}

.hd-p-logo {
  margin: 0;
  padding: 0.5rem;

  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.3px;

  background: linear-gradient(135deg, #e63946 0%, #f28b82 50%, #e63946 100%);
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  animation: gradientShift 3s ease infinite;
  transition: transform 0.2s ease;

  user-select: none;
  -webkit-user-select: none;
  cursor: default;

  filter: drop-shadow(0 2px 6px rgba(230, 57, 70, 0.35));
}

.hd-p-logo:hover {
  transform: scale(1.03);
}

body.dark .hd-p-logo {
  color: #ef4444;
  text-shadow: 0 1px 2px rgba(239, 68, 68, 0.15);
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hd-bn-modos,
.hd-bn-hamburguesa {
  appearance: none;
  background: none;
  border: none;

  font-size: 1.5rem;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  padding: 0.5rem;
  margin: 0;

  min-width: 2.5rem;
  min-height: 2.5rem;

  border-radius: 0.5rem;
  position: relative;
  overflow: hidden;

  backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent;

  transition: transform 0.25s ease, color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;

  color: #222222;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.05));
  box-shadow:
    4px 4px 8px rgba(0, 0, 0, 0.1),
    -4px -4px 8px rgba(255, 255, 255, 0.5),
    inset 2px 2px 4px rgba(255, 255, 255, 0.1);
}

body.dark .hd-bn-modos,
body.dark .hd-bn-hamburguesa {
  color: #f0f0f0;
}

.hd-bn-modos::before,
.hd-bn-hamburguesa::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(230, 57, 70, 0.28) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.hd-bn-modos:hover,
.hd-bn-hamburguesa:hover {
  transform: translateY(-2px) scale(1.03);
}

.hd-bn-modos:hover::before,
.hd-bn-hamburguesa:hover::before {
  opacity: 1;
}

.hd-bn-modos:active,
.hd-bn-hamburguesa:active {
  transform: scale(0.96);
}

.hd-bn-modos-sun,
.hd-bn-modos-moon {
  display: none;
}
body:not(.dark) .hd-bn-modos-sun { display: inline; }
body.dark .hd-bn-modos-moon { display: inline; }

.hd-bn-hamburguesa .bi-list { display: inline; }
.hd-bn-hamburguesa .bi-x-lg { display: none; }
.hd-bn-hamburguesa.activo .bi-list { display: none; }
.hd-bn-hamburguesa.activo .bi-x-lg { display: inline; }

.hd-nav {
  position: absolute;
  top: 5rem;
  left: 0;
  right: 0;

  display: none;
  flex-direction: column;

  padding: 1rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;

  background-color: #d9c3c3;
  border-top: 1px solid #ddd;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);

  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    background-color 0.3s ease,
    border-color 0.3s ease;
}

body.dark .hd-nav {
  background-color: #1e1e1e;
  border-top-color: #444;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.hd-nav.nav-abierto {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.hd-nav-ul {
  list-style: none;
  padding: 0;
  margin: 0;

  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hd-nav-ul-li {
  position: relative;
}

.hd-nav-ul-li-a {
  text-decoration: none;
  display: block;

  font-size: 1.125rem;
  font-weight: 500;

  padding: 0.75rem 1rem;
  border-radius: 0.75rem;

  position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease;

  color: #222222;
}

body.dark .hd-nav-ul-li-a {
  color: #f0f0f0;
}

.hd-nav-ul-li-a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 2px;
  transition: width 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  background: linear-gradient(90deg, transparent, #e63946, transparent);
}

body.dark .hd-nav-ul-li-a::after {
  background: linear-gradient(90deg, transparent, #ef4444, transparent);
}

.hd-nav-ul-li-a:hover::after { width: 100%; }

.hd-nav-ul-li-a:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.10),
    0 2px 6px rgba(0, 0, 0, 0.06);
}

body.dark .hd-nav-ul-li-a:hover {
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.35);
}

[id] {
  scroll-margin-top: 5rem;
}

.submenu {
  display: none;
  list-style: none;

  margin: 0.75rem 0 0;
  padding: 0.35rem;

  border-left: 4px solid #e63946;
  border-top: 1px solid #ddd;
  border-radius: 0 0.75rem 0.75rem 0;

  background: linear-gradient(135deg, rgba(217, 195, 195, 0.95) 0%, rgba(222, 196, 196, 0.98) 100%);
  backdrop-filter: blur(15px);

  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);

  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

body.dark .submenu {
  border-top-color: #444;
  background: linear-gradient(135deg, rgba(42, 42, 42, 0.95) 0%, rgba(30, 30, 30, 0.98) 100%);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.submenu-abierto {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.submenu li { margin: 0; padding: 0; }

.submenu li a {
  display: block;
  padding: 0.9rem 1.1rem;

  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;

  letter-spacing: 0.05em;
  text-transform: uppercase;

  border-radius: 0.6rem;
  transition: transform 0.2s ease, padding-left 0.2s ease, letter-spacing 0.2s ease;

  color: #e63946;
}

body.dark .submenu li a {
  color: #ef4444;
}

.submenu li a:hover {
  transform: translateY(-1px);
  padding-left: 1.5rem;
  letter-spacing: 0.08em;
}

@media (min-width: 48rem) {
  .header {
    padding: 0;
  }

  .hd-p-logo {
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
  }

  .hd-bn-hamburguesa {
    display: none;
  }

  .hd-nav {
    position: static;
    display: flex !important;

    opacity: 1;
    transform: none;

    flex-direction: row;
    align-items: center;

    padding: 0;
    max-height: none;
    overflow: visible;

    background: none;
    border: none;
    box-shadow: none;

    
  }

  .hd-nav-ul {
    flex-direction: row;
    gap: 0.75rem;
  }

  .hd-nav-ul-li-a {
    font-size: 1rem;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
  }

  .submenu {
    display: block;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px) scale(0.98);

    position: absolute;
    top: calc(100% + 0.55rem);
    left: 50%;
    translate: -50% 0;

    min-width: 12rem;
    z-index: 1001;
    margin: 0;
  }

  .hd-nav-ul-li:hover > .submenu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 64rem) {
  .hd-p-logo { font-size: 1.75rem; }
  .hd-nav-ul { gap: 1rem; }
  .hd-bn-modos { font-size: 1.625rem; min-width: 3rem; min-height: 3rem; }
  .submenu { min-width: 14rem; }
}

@media (min-width: 90rem) {
  .hd-p-logo { font-size: 2rem; }
  .hd-nav-ul { gap: 1.5rem; }
  .hd-nav-ul-li-a { font-size: 1.0625rem; padding: 0.75rem 1.5rem; }
}

.hd-bn-modos:focus-visible,
.hd-bn-hamburguesa:focus-visible,
.hd-nav-ul-li-a:focus-visible {
  outline: 2px solid #e63946;
  outline-offset: 2px;
}

body.dark .hd-bn-modos:focus-visible,
body.dark .hd-bn-hamburguesa:focus-visible,
body.dark .hd-nav-ul-li-a:focus-visible {
  outline-color: #ef4444;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}