/* ========================================
   HEADER - MAVICO Ferretería
   ======================================== */

/* ========================================
   TOP BAR
   ======================================== */
.header-top-bar {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 10px 0;
    font-size: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1003;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-bar-left span,
.top-bar-right a {
    white-space: nowrap;
}

.top-bar-right a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.top-bar-right a:hover {
    color: var(--color-acento);
}

.divider {
    color: rgba(255, 255, 255, 0.4);
}

/* ========================================
   NAVBAR
   ======================================== */
.header-navbar {
    position: fixed;
    top: 40px;
    left: 0;
    width: 100%;
    z-index: 1002;
    background: var(--bg-header);
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: all 0.3s ease;
}

.header-navbar.scrolled {
    top: 0;
}

.header-navbar .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

/* ========================================
   LOGO
   ======================================== */
.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 45px;
    width: auto;
    transition: transform 0.3s ease;
}

.header-logo:hover .logo-image {
    transform: scale(1.05);
}

/* ========================================
   MENÚ PRINCIPAL
   ======================================== */
.header-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.header-nav-link {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.header-nav-link::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-acento);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.header-nav-link:hover,
.header-nav-link.active {
    color: var(--color-primario);
}

.header-nav-link:hover::after,
.header-nav-link.active::after {
    width: 80%;
}

.header-nav-link:hover {
    background: rgba(197, 154, 47, 0.1);
}

/* ========================================
   ICONOS
   ======================================== */
.header-nav-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon-btn i {
    font-size: 20px;
}

.header-icon-btn:hover {
    background: var(--gray-light);
    transform: scale(1.1);
}

/* Theme Toggle */
.theme-toggle:hover i {
    color: var(--color-acento);
}

/* Carrito */
.cart-btn {
    position: relative;
}

.cart-count-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Menú Móvil Button */
.menu-btn {
    display: none;
}

/* ========================================
   MENÚ MÓVIL
   ======================================== */
@media (max-width: 900px) {
    .header-top-bar {
        display: none;
    }

    .header-navbar {
        top: 0;
    }

    .header-navbar .container {
        padding: 0 20px;
    }

    .logo-image {
        height: 40px;
    }

    .header-nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 70px);
        background: var(--bg-header);
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        transition: left 0.3s ease;
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.2);
    }

    .header-nav-menu.active {
        left: 0;
    }

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

    .header-nav-link::after {
        display: none;
    }

    .menu-btn {
        display: flex;
    }

    .theme-toggle {
        display: none;
    }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   DARK MODE
   ======================================== */
[data-theme="dark"] .header-top-bar {
    background: var(--gradient-primary);
}

[data-theme="dark"] .header-navbar {
    background: var(--bg-header);
}

[data-theme="dark"] .header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}
