/* Base Styles usando colores globales existentes */
.site-header {
    background: var(--color-white);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    position: fixed;
    top: 45px; /* Coloca el header debajo del banner-top */
    left: 0;
    right: 0;
    z-index: 99;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

/* Spacer para evitar que el contenido quede debajo del header fijo */
.site-header-spacer {
    height: calc(45px + 80px); /* Altura del banner-top + altura estimada del header */
    display: block;
    width: 100%;
}

/* Header Container */
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
}

/* Logo Section */
.header-left {
    display: flex;
    align-items: center;
    justify-self: start;
    min-width: 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.logo:hover {
    opacity: 0.9;
}

.logo img {
    height: 46px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Desktop Navigation */
.header-nav {
    justify-self: center;
    min-width: 0;
    display: block;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    letter-spacing: .3px;
    color: var(--color-black);
    padding: 10px 8px;
    /* border-radius: 12px; */
    font-family: var(--font-main);
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.nav-link i {
    font-size: 11px;
    opacity: 0.7;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-item:hover .nav-link,
.nav-link:focus-visible {
    color: var(--color-primary);
    /* Rojo e74c3c */
    background: rgba(0, 0, 0, 0.03);
}

.nav-item:hover .nav-link i {
    opacity: 1;
    transform: translateY(1px);
}

/* Desktop Dropdown */
.dropdown {
    margin-top: -0.8rem;
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 580px;
    background: var(--color-white);
    border: 1px solid rgba(0, 0, 0, .08);
    /* border-radius: 12px; */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    padding: 24px;
    z-index: 100;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dropdown-title {
    color: var(--color-black);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, .10);
    display: block;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.dropdown-title:hover {
    color: var(--color-primary);
    /* Rojo e74c3c */
}

.dropdown-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 28px;
}

.dropdown-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.col-title {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .8px;
    color: rgba(0, 0, 0, .75);
    text-transform: uppercase;
    margin-bottom: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.dropdown a {
    text-decoration: none;
    color: rgba(0, 0, 0, .80);
    font-size: 14px;
    padding: 8px 8px;
    /* border-radius: 8px; */
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 400;
}

.dropdown a:hover {
    background: rgba(0, 0, 0, .04);
    color: var(--color-black);
    padding-left: 12px;
}

/* Right Icons */
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    justify-self: end;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    /* border-radius: 12px; */
    border: 0;
    background: transparent;
    color: var(--color-black);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.icon-btn:hover {
    background: rgba(0, 0, 0, .04);
    transform: translateY(-1px);
}

.icon-btn:active {
    transform: translateY(0);
}

/* Cart Badge */
.icon-btn[aria-label*="Carrito"]::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    /* Rojo e74c3c */
    border-radius: 50%;
    border: 2px solid var(--color-white);
}

/* Hamburger Button - Mejorado */
.hamburger {
    display: none;
    width: 46px;
    height: 46px;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 12px;
    padding: 0;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hamburger:hover {
    background: rgba(0, 0, 0, .04);
}

.hamburger__inner {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-black);
    margin: 5px auto;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.hamburger__inner::before,
.hamburger__inner::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--color-black);
    border-radius: 10px;
    left: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hamburger__inner::before {
    top: -8px;
}

.hamburger__inner::after {
    bottom: -8px;
}

/* Active state hamburger */
.hamburger[aria-expanded="true"] .hamburger__inner {
    background: transparent;
}

.hamburger[aria-expanded="true"] .hamburger__inner::before {
    transform: rotate(45deg);
    top: 0;
}

.hamburger[aria-expanded="true"] .hamburger__inner::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* Search Panel */
.search-panel {
    position: fixed;
    top: 45px; /* Debajo del banner-top */
    left: 0;
    right: 0;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px 16px;
    display: none;
    animation: slideDown 0.3s ease;
    z-index: 98;
    background: var(--color-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);

    margin-top: 5rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-panel.is-open {
    display: block;
}

.search-panel-inner {
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    background: var(--color-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-panel-inner input {
    border: 0;
    outline: none;
    flex: 1;
    font-size: 15px;
    font-family: var(--font-main);
    color: var(--color-black);
    background: transparent;
    padding: 4px 0;
}

.search-panel-inner input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.search-close {
    border: 0;
    background: transparent;
    cursor: pointer;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: var(--color-black);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.search-close:hover {
    background: rgba(0, 0, 0, .04);
}

/* Mobile Drawer */
.drawer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 1000;
}

.drawer.is-open {
    pointer-events: auto;
    opacity: 1;
}

.drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    transition: opacity 0.25s ease;
}

.drawer-panel {
    position: absolute;
    top: 45px; /* Debajo del banner-top */
    left: 0;
    width: min(85vw, 400px);
    height: calc(100% - 45px); /* Ajustar altura considerando el banner-top */
    background: var(--color-white);
    box-shadow: 2px 0 30px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.drawer.is-open .drawer-panel {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.drawer-logo {
    height: 36px;
    width: auto;
}

.drawer-close {
    width: 44px;
    height: 44px;
    border: 0;
    background: rgba(0, 0, 0, .04);
    cursor: pointer;
    border-radius: 12px;
    color: var(--color-black);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.drawer-close:hover {
    background: rgba(0, 0, 0, .08);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .2) transparent;
}

.drawer-body::-webkit-scrollbar {
    width: 4px;
}

.drawer-body::-webkit-scrollbar-track {
    background: transparent;
}

.drawer-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .2);
    border-radius: 10px;
}

/* Mobile Menu Items */
.drawer-item {
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.drawer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    text-decoration: none;
    color: rgba(0, 0, 0, .85);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 500;
    background: transparent;
    border: 0;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.drawer-link i {
    font-size: 12px;
    opacity: 0.6;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.drawer-link:hover,
.drawer-link:focus-visible {
    background: rgba(0, 0, 0, .03);
    color: var(--color-black);
}

.drawer-link:hover i,
.drawer-link:focus-visible i {
    opacity: 1;
}

/* Mobile Submenu */
.drawer-submenu {
    display: none;
    background: rgba(0, 0, 0, .02);
    padding: 16px 24px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.drawer-submenu.is-open {
    display: block;
}

.drawer-submenu-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-black);
    text-decoration: none;
    padding: 12px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.drawer-submenu-title:hover {
    color: var(--color-primary);
    /* Rojo e74c3c */
}

.drawer-submenu-cols {
    display: grid;
    gap: 20px;
    margin-top: 16px;
}

.drawer-submenu-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drawer-submenu-col-title {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .8px;
    color: rgba(0, 0, 0, .75);
    text-transform: uppercase;
    margin-bottom: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.drawer-submenu a {
    display: block;
    text-decoration: none;
    color: rgba(0, 0, 0, .80);
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.drawer-submenu a:hover {
    background: rgba(0, 0, 0, .04);
    color: var(--color-black);
    padding-left: 16px;
}

.drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(0, 0, 0, .08);
    background: rgba(0, 0, 0, .02);
}

.drawer-footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawer-footer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: rgba(0, 0, 0, .75);
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.drawer-footer-link:hover {
    background: rgba(0, 0, 0, .04);
    color: var(--color-black);
}

/* RESPONSIVE DESIGN */

/* Tablet (980px - 768px) */
@media (max-width: 980px) {
    .header-inner {
        grid-template-columns: auto 1fr auto;
        padding: 14px 16px;
        gap: 20px;
    }

    .header-nav {
        display: none;
    }

    .hamburger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        order: -1;
    }

    .header-left {
        justify-self: center;
    }

    .logo img {
        height: 40px;
    }

    .header-right {
        gap: 10px;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
    }

    .site-header-spacer {
        height: calc(45px + 74px); /* Altura del banner-top + altura del header en tablet */
    }
}

/* Mobile (767px - 480px) */
@media (max-width: 767px) {
    .header-inner {
        padding: 12px 16px;
        gap: 16px;
    }

    .logo img {
        height: 36px;
    }

    .icon-btn {
        width: 38px;
        height: 38px;
    }

    .hamburger {
        width: 42px;
        height: 42px;
    }

    .drawer-panel {
        width: min(90vw, 360px);
    }

    .drawer-link {
        padding: 16px 20px;
        font-size: 15px;
    }

    .drawer-submenu {
        padding: 16px 20px;
    }

    .site-header-spacer {
        height: calc(45px + 70px); /* Altura del banner-top + altura del header en mobile */
    }
}

/* Small Mobile (479px - 320px) */
@media (max-width: 479px) {
    .header-inner {
        padding: 10px 12px;
        gap: 12px;
    }

    .logo img {
        height: 32px;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .hamburger {
        width: 38px;
        height: 38px;
    }

    .hamburger__inner,
    .hamburger__inner::before,
    .hamburger__inner::after {
        width: 22px;
    }

    .drawer-panel {
        width: min(92vw, 320px);
    }

    .drawer-link {
        padding: 15px 18px;
        font-size: 14px;
    }

    .drawer-submenu {
        padding: 14px 18px;
    }

    .drawer-footer {
        padding: 16px 18px;
    }

    .search-panel {
        padding: 0 12px 12px;
    }

    .search-panel-inner {
        padding: 10px 14px;
    }

    .site-header-spacer {
        height: calc(45px + 66px); /* Altura del banner-top + altura del header en small mobile */
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .drawer,
    .drawer-panel,
    .dropdown,
    .search-panel {
        transition: none !important;
    }
}

/* Focus styles for accessibility */
.nav-link:focus-visible,
.icon-btn:focus-visible,
.hamburger:focus-visible,
.drawer-link:focus-visible,
.search-close:focus-visible {
    outline: 2px solid var(--color-primary);
    /* Rojo e74c3c */
    outline-offset: 2px;
}