/*
    <header class="header">
        
        <div class="hd-left">
            <p class="hd-p-logo">[Logo]</p>
        </div>

        <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>

        <div class="hd-actions">
            <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>

            <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>
        </div>

    </header>
*/

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5rem;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    z-index: 1000;
    
    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;

    will-change: backdrop-filter;
}

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-left {
    display: flex;
    align-items: center;
    padding-left: 1rem;
}

.hd-actions {
    display: flex;
    align-items: center;
    padding-right: 0.5rem;
}

.hd-p-logo {
    padding: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin: 0;

    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 6s 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));
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body.dark .hd-p-logo {
    color: #ef4444;
    text-shadow: 0 1px 2px rgba(239, 68, 68, 0.15);
}

.hd-p-logo:hover {
    transform: scale(1.03);
}

.hd-bn-modos,
.hd-bn-hamburguesa {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin: 0 0.25rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition:
        transform 0.25s ease,
        background-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease;
    -webkit-tap-highlight-color: transparent;

    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;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;

    background: rgba(230, 57, 70, 0.3);
}

.hd-bn-modos:active::before,
.hd-bn-hamburguesa:active::before {
    width: 200%;
    height: 200%;
}

.hd-bn-modos:hover,
.hd-bn-hamburguesa:hover {
    transform: scale(1.05);

    background-color: #dec4c4;
    color: #e63946;
}

body.dark .hd-bn-modos:hover,
body.dark .hd-bn-hamburguesa:hover {
    background-color: #2a2a2a;
    color: #ef4444;
}

.hd-bn-modos:active,
.hd-bn-hamburguesa:active {
    transform: scale(0.95);
}

.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: flex;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    flex-direction: column;
    padding: 1rem;
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    
    background-color: #d9c3c3;
    border-top: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

    transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    opacity 0.25s ease,
    transform 0.25s ease;
}

body.dark .hd-nav {
    background-color: #1e1e1e;
    border-top-color: #444;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.hd-nav.nav-abierto {
    opacity: 1;
    pointer-events: auto;
    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-a {
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    display: block;
    transition:
        transform 0.25s ease,
        background-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease;
    position: relative;

    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%);
    transition: width 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 2px;

    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);

    background-color: #dec4c4;
    color: #e63946;
}

body.dark .hd-nav-ul-li-a:hover {
    background-color: #2a2a2a;
    color: #ef4444;
}

[id] {
    scroll-margin-top: 5rem;
}

.submenu {
    display: none;
    list-style: none;
    margin: 1rem 0 0 0;
    padding: 0;
    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 28px rgba(0, 0, 0, 0.12);
    transform-style: preserve-3d;
    perspective: 1000px;
}

body.dark .submenu {
    background: linear-gradient(
        135deg,
        rgba(42, 42, 42, 0.95) 0%,
        rgba(30, 30, 30, 0.98) 100%
    );
    box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.5);
}

.hd-nav-ul-li > .submenu {
    margin-left: 0.5rem;
}

.submenu-abierto {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.submenu li a {
    display: block;
    padding: 1rem 1.25rem;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
    z-index: 2;

    color: #e63946;
}

.submenu li a:hover {
    transform: translateY(-2px);

    background-color: #dec4c4;
}

body.dark .submenu li a:hover {
    background-color: #2a2a2a;
}

.submenu li a:hover::after {
    opacity: 1;
}

@media (min-width: 48rem) {
    .hd-p-logo {
        font-size: 1.5rem;
        padding: 0.5rem 1rem;
    }
    
    .hd-nav {
        position: static;
        display: flex;
        flex-direction: row;
        align-items: center;
        background: none;
        padding: 0 1rem;
        border: none;
        box-shadow: none;
        max-height: none;
        overflow: visible;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }
    
    .hd-bn-hamburguesa {
        display: none;
    }
    
    .hd-bn-modos {
        margin: 0 0.5rem;
    }
    
    .hd-nav-ul {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .hd-nav-ul-li-a {
        font-size: 1rem;
        padding: 0.625rem 1rem;
    }
    
    .hd-nav-ul-li-a:hover {
        transform: translateY(-2px);
        background-color: #dec4c4;
    }
    
    body.dark .hd-nav-ul-li-a:hover {
        background-color: #2a2a2a;
    }
    
    .hd-nav-ul-li {
        position: relative;
    }

    .submenu{
        border-radius: 0;
    }
    
    .hd-nav-ul-li:hover > .submenu {
        display: block;
        position: absolute;
        top: 80%;
        left: -35%;
        transform: translateY(0.5rem);
        opacity: 1;
        transform: translateY(0);
        min-width: 12rem;
        margin: 0.5rem 0 0 0;
        background-color: #d9c3c3;
        border: 1px solid #ddd;
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);

        z-index: 2000;
    }
    
    body.dark .hd-nav-ul-li:hover > .submenu {
        background-color: #1e1e1e;
        border-color: #444;
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.7);
    }
    
    .submenu li a:hover {
        padding-left: 1.25rem;
    }
}

@media (min-width: 64rem) {
    .hd-p-logo {
        font-size: 1.75rem;
    }
    
    .hd-nav-ul {
        gap: 1rem;
    }
    
    .hd-nav-ul-li-a {
        padding: 0.75rem 1.25rem;
    }
    
    .hd-bn-modos {
        font-size: 1.625rem;
        min-width: 3rem;
        min-height: 3rem;
    }
    
    .hd-nav-ul-li:hover > .submenu {
        min-width: 14rem;
    }
    
    .submenu li a {
        padding: 0.875rem 1.25rem;
    }
    
    .submenu li a:hover {
        padding-left: 1.5rem;
    }
}

@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.875rem 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;
    }
}