/* ===========================
   HEADER STYLES - DISEÑO ELEGANTE
=========================== */

/* Barra superior */
.header-top {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    padding: 0.75rem 0;
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-contact {
    display: flex;
    gap: 2rem;
}

.header-contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #CCCCCC;
    transition: all 0.3s ease;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.header-contact-item svg {
    color: var(--color-amarillo);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3));
}

.header-contact-item:hover {
    color: var(--color-amarillo);
    transform: translateX(3px);
}

.header-links {
    display: flex;
    gap: 1.5rem;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #CCCCCC;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 300;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.03);
}

.header-link:hover {
    color: var(--color-amarillo);
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

/* Header principal */
.header-main {
    background: #000000;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
}

.header-main-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.site-branding {
    flex-shrink: 0;
}

.site-logo-text h1 {
    font-size: 2rem;
    margin: 0;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.3));
}

.custom-logo-link {
    display: block;
}

.custom-logo {
    max-height: 70px;
    width: auto;
    display: block;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.2));
}

/* Buscador */
.header-search {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-form {
    position: relative;
    display: flex;
}

.search-field {
    width: 100%;
    padding: 1rem 4rem 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 50px;
    color: #FFFFFF;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.search-field:focus {
    outline: none;
    border-color: var(--color-amarillo);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2), inset 0 0 20px rgba(255, 215, 0, 0.05);
}

.search-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}

.search-submit {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #000000;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.search-submit:hover {
    transform: translateY(-50%) scale(1.1) rotate(10deg);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6);
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 1rem);
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    z-index: 1001;
}

.search-results-dropdown.active {
    display: block;
}

/* Carrito */
.header-actions {
    display: flex;
    gap: 1rem;
}

.header-cart {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 50px;
    color: #FFFFFF;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.header-cart::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header-cart:hover {
    border-color: var(--color-amarillo);
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.header-cart:hover::before {
    opacity: 1;
}

.cart-count {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000000;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 50px;
    font-size: 0.75rem;
    min-width: 24px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

.cart-total {
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Menú de categorías */
.header-categories {
    background: #000000;
    border-bottom: 1px solid #1a1a1a;
    padding: var(--espaciado-sm) 0;
}

.categories-nav {
    display: flex;
    align-items: center;
    gap: var(--espaciado-lg);
}

.categories-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem var(--espaciado-sm);
    background: #1a1a1a;
    border: 1px solid var(--color-amarillo);
    border-radius: 6px;
    color: #FFFFFF;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transicion-normal);
}

.categories-toggle:hover {
    background: var(--color-amarillo);
    color: #000000;
}

/* Navegación principal con mega menú elegante */
.header-navigation {
    background: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.main-navigation {
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    justify-content: center;
}

.menu-item {
    position: relative;
}

.menu-item > a {
    display: block;
    padding: 1.25rem 2rem;
    color: #FFFFFF;
    font-weight: 400;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    position: relative;
}

.menu-item > a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-amarillo), transparent);
    transform: translateX(-50%);
    transition: width 0.4s ease;
}

.menu-item > a:hover,
.menu-item.current-menu-item > a {
    color: var(--color-amarillo);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.menu-item > a:hover::before {
    width: 100%;
}

/* Mega Dropdown elegante */
.has-dropdown {
    position: relative;
}

.mega-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    min-width: 1000px;
    background: rgba(0, 0, 0, 0.98);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9), 0 0 100px rgba(255, 215, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.mega-dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, transparent 50%, rgba(255, 165, 0, 0.05) 100%);
    pointer-events: none;
}

.has-dropdown:hover .mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    display: block;
}

.dropdown-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    padding: 3rem;
    max-height: 550px;
    overflow-y: auto;
    position: relative;
}

.dropdown-content::-webkit-scrollbar {
    width: 8px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FFD700, #FFA500);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.category-column {
    min-width: 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.category-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, #FFD700, #FFA500);
    border-radius: 0 4px 4px 0;
    transition: height 0.3s ease;
}

.category-column:hover {
    background: rgba(255, 215, 0, 0.05);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.2);
}

.category-column:hover::before {
    height: 100%;
}

.category-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
}

.category-title::after {
    content: '▶';
    position: absolute;
    right: 0;
    top: 0;
    color: var(--color-amarillo);
    font-size: 0.75rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.category-column:hover .category-title::after {
    opacity: 1;
    transform: translateX(5px);
}

.category-title a {
    color: var(--color-amarillo);
    transition: all 0.3s ease;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-title a:hover {
    color: #FFFFFF;
    text-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    transform: translateX(3px);
}

.category-title a:hover {
    color: var(--color-amarillo-oscuro);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.subcategory-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subcategory-list li {
    position: relative;
    padding-left: 1.25rem;
    transition: all 0.3s ease;
}

.subcategory-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-amarillo);
    font-size: 0.875rem;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.subcategory-list li:hover::before {
    opacity: 1;
    transform: translateX(3px);
}

.subcategory-list li a {
    display: block;
    color: #CCCCCC;
    font-size: 0.875rem;
    font-weight: 300;
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: transparent;
    letter-spacing: 0.3px;
}

.subcategory-list li a:hover {
    color: #FFFFFF;
    background: rgba(255, 215, 0, 0.08);
    padding-left: 1rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* WhatsApp flotante */
.whatsapp-flotante {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    z-index: 9999;
    transition: all var(--transicion-normal);
    animation: pulse 2s infinite;
}

.whatsapp-flotante:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.7);
}

.whatsapp-flotante svg {
    width: 32px;
    height: 32px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    }
    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.8);
    }
}

/* ===========================
   RESPONSIVE
=========================== */

/* Botones de toggle móvil */
.mobile-menu-toggle,
.mobile-search-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #FFD700;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover,
.mobile-search-toggle:hover {
    color: #FFA500;
}

.mobile-menu-toggle {
    flex-direction: column;
    gap: 4px;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #FFD700;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Búsqueda móvil */
.mobile-search-wrapper {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #000000;
    padding: var(--espaciado-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 999;
}

.mobile-search-wrapper.active {
    display: block;
}

.mobile-search-form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-search-field {
    flex: 1;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 1rem;
}

.mobile-search-field:focus {
    outline: none;
    border-color: #FFD700;
    background: rgba(255, 255, 255, 0.08);
}

.mobile-search-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.mobile-search-submit {
    background: #FFD700;
    border: none;
    padding: 0.875rem;
    border-radius: 8px;
    color: #000000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-search-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1024px) {
    .header-main-content {
        gap: 1.5rem;
    }
    
    .header-search {
        max-width: 450px;
    }
    
    .mega-dropdown {
        min-width: 100%;
        left: 0;
        right: 0;
    }
    
    .dropdown-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Ocultar barra superior en móviles */
    .header-top {
        display: none;
    }
    
    /* Header principal */
    .header-main {
        padding: 1rem 0;
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 1001;
    }
    
    .header-main-content {
        gap: 1rem;
    }
    
    /* Logo más pequeño */
    .site-branding {
        flex: 1;
    }
    
    .custom-logo {
        max-height: 40px;
    }
    
    .site-logo-text h1 {
        font-size: 1.25rem;
        letter-spacing: 1px;
    }
    
    /* Ocultar búsqueda desktop */
    .header-search {
        display: none;
    }
    
    /* Mostrar botones móviles */
    .mobile-search-toggle,
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Header actions */
    .header-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    /* Carrito simplificado */
    .header-cart {
        padding: 0.5rem;
        min-width: auto;
    }
    
    .header-cart svg {
        width: 24px;
        height: 24px;
    }
    
    .cart-total {
        display: none;
    }
    
    .cart-count {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        top: 0;
        right: 0;
    }
    
    /* Navegación móvil */
    .header-navigation {
        position: fixed;
        top: 73px;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: calc(100vh - 73px);
        background: #000000;
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    }
    
    .header-navigation.active {
        left: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0;
    }
    
    .menu-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    }
    
    .menu-item > a {
        padding: 1rem 1.5rem;
        display: block;
        font-size: 1rem;
    }
    
    /* Mega dropdown móvil */
    .mega-dropdown {
        position: static;
        display: none;
        max-height: none;
        box-shadow: none;
        background: rgba(255, 215, 0, 0.05);
    }
    
    .menu-item.has-dropdown.active .mega-dropdown {
        display: block;
    }
    
    .dropdown-content {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
    }
    
    .category-column {
        border-bottom: 1px solid rgba(255, 215, 0, 0.1);
        padding: 1rem 1.5rem;
    }
    
    .category-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .subcategory-list {
        padding-left: 1rem;
    }
    
    .subcategory-list li a {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Overlay para menú móvil */
    body::after {
        content: '';
        position: fixed;
        top: 73px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    body.mobile-menu-open::after {
        opacity: 1;
        visibility: visible;
    }
    
    /* Agregar espacio para header fijo */
    body {
        padding-top: 73px;
    }
    
    /* WhatsApp flotante */
    .whatsapp-flotante {
        width: 50px;
        height: 50px;
        bottom: 1rem;
        right: 1rem;
    }
    
    .whatsapp-flotante svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .header-main {
        padding: 0.75rem 0;
    }
    
    .header-navigation {
        width: 90%;
        max-width: none;
    }
    
    .custom-logo {
        max-height: 35px;
    }
    
    .site-logo-text h1 {
        font-size: 1.1rem;
    }
    
    .mobile-search-wrapper {
        padding: 1rem;
    }
    
    .category-column {
        padding: 1rem;
    }
}
