﻿/* ===========================================
HEADER.CSS - CORREÇÕES CONSOLIDADAS
Compatível com mobile.css e menu.css
=========================================== */

/* === CSS VARIABLES === */
:root {
    --header-height: 80px;
    --header-scrolled: 70px;
    --header-padding: 20px;
    --header-mobile-height: 60px;
    --header-mobile-scrolled: 55px;
    --touch-target-min: 44px;
}

/* === HEADER BASE STYLES === */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--header-padding) 50px;
    background: var(--gradient-header);
    box-shadow: 0 4px 20px rgba(7, 32, 66, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition-smooth);
    animation: headerSlideDown 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* Scrolled state */
header.scrolled {
    padding: 12px 50px;
    box-shadow: 0 2px 15px rgba(7, 32, 66, 0.25);
    background: rgba(7, 32, 66, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Header container - CORREÇÃO: Centralizado */
header .container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 30px;
}

/* === LOGO - SEO OPTIMIZED === */
header .logo {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    min-width: 0;
    flex-shrink: 0;
}

header .logo:hover {
    transform: translateY(-2px);
}

header .logo-img {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(7, 32, 66, 0.2);
    flex-shrink: 0;
}

/* Logo text styles - CORREÇÃO: No mobile será escondido */
header .logo-text {
    display: flex;
    flex-direction: column;
}

header .logo-text h1 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 700;
    color: var(--branco);
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(7, 32, 66, 0.3);
    white-space: nowrap;
}

header .logo-text p {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(10px, 1.5vw, 12px);
    font-weight: 400;
    color: rgba(179, 217, 255, 0.9);
    margin: 2px 0 0;
    line-height: 1.2;
    white-space: nowrap;
}

/* === NAVIGATION - SEO FRIENDLY === */
.desktop-menu {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.desktop-menu ul {
    display: flex;
    gap: clamp(20px, 3vw, 30px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.desktop-menu ul li {
    position: relative;
}

/* Navigation links */
.desktop-menu ul li a {
    color: var(--branco);
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: clamp(14px, 1.5vw, 16px);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 25px;
    position: relative;
    transition: var(--transition-smooth);
    display: block;
    line-height: 1.4;
}

/* Hover effects desktop */
.desktop-menu ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.desktop-menu ul li a:hover::before {
    opacity: 1;
}

.desktop-menu ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    left: 50%;
    bottom: 2px;
    background: var(--gradient-primary);
    transition: var(--transition-smooth);
    transform: translateX(-50%);
    border-radius: 1px;
}

.desktop-menu ul li a:hover::after {
    width: 60%;
}

.desktop-menu ul li a:hover {
    color: var(--azul-claro);
    transform: translateY(-1px);
}

/* === HEADER BUTTONS - ACCESSIBLE === */
.btns-header {
    display: flex;
    align-items: center;
    gap: clamp(15px, 2vw, 20px);
}

.header-btns {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 12px);
}

/* Base button styles */
.header-btns .btn {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 12px;
    border-radius: 50%;
    color: var(--branco);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    text-decoration: none;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    box-sizing: border-box;
}

.header-btns .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--azul-claro);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(79, 209, 199, 0.2);
    color: var(--azul-claro);
}

/* WhatsApp specific styles */
.header-btns .whatsapp:hover {
    border-color: #25d366;
    color: #25d366;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.2);
}

/* Cart specific styles */
.header-btns .cart {
    position: relative;
}

/* Cart count badge */
.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 700;
    padding: 0 5px;
    background: #ff4757;
    color: white;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--azul-marinho);
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

.cart-count.visible {
    display: flex;
}

/* === NAVIGATION ICONS - CORREÇÃO CRÍTICA: MOVIDOS PARA HEADER-BTNS === */
.header-btns .nav-icon {
    display: none; /* Escondido no desktop */
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--branco);
    text-decoration: none;
}

.header-btns .nav-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--azul-claro);
    transform: translateY(-2px) scale(1.05);
    color: var(--azul-claro);
}

/* === HAMBURGER MENU - REMOVIDO === */
.hamburger {
    display: none;
}

/* === MOBILE NAV ICONS - REMOVIDO (AGORA ESTÃO NO HEADER) === */
.mobile-nav-icons {
    display: none; /* REMOVIDO - não precisamos mais disso */
}

/* === ACTIVE STATES === */
.desktop-menu ul li a.active {
    color: var(--azul-claro);
    background: rgba(79, 209, 199, 0.1);
}

.desktop-menu ul li a.active::after {
    width: 60%;
}

/* === ANIMATIONS === */
@keyframes headerSlideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === RESPONSIVENESS === */
@media (max-width: 1100px) {
    header {
        padding: var(--header-padding) 30px;
    }
    header.scrolled {
        padding: 12px 30px;
    }
}

@media (max-width: 968px) {
    .desktop-menu ul {
        gap: 15px;
    }
    .desktop-menu ul li a {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    /* Ajuste do texto do logo em tablets */
    header .logo-text h1 {
        font-size: 16px;
    }
    header .logo-text p {
        font-size: 10px;
    }
}

/* === MOBILE LAYOUT - ÍCONES NO HEADER === */
@media (max-width: 768px) {
    header {
        padding: var(--header-padding) 15px;
    }
    header.scrolled {
        padding: 12px 15px;
    }
    
    /* Esconde menu desktop */
    .desktop-menu {
        display: none;
    }
    
    /* Esconde texto do logo no mobile */
    header .logo-text {
        display: none;
    }
    
    /* Ajusta logo image no mobile */
    header .logo-img {
        width: 45px;
        height: 45px;
    }
    
    /* MOSTRA ÍCONES DE NAVEGAÇÃO NO HEADER */
    .header-btns .nav-icon {
        display: flex !important; /* Força exibição no mobile */
    }
    
    /* Ajusta tamanhos dos botões no mobile */
    .header-btns .btn,
    .header-btns .nav-icon {
        width: 38px;
        height: 38px;
        padding: 0;
        font-size: 16px;
    }
    
    .header-btns {
        gap: 8px;
    }
    
    /* Garante que o container do header ajuste corretamente */
    header .container {
        gap: 15px;
        justify-content: space-between;
    }
}

/* === LAYOUT PARA TELAS MUITO PEQUENAS === */
@media (max-width: 480px) {
    header {
        padding: 15px 12px !important;
    }
    header.scrolled {
        padding: 10px 12px !important;
    }
    
    .header-btns {
        gap: 6px;
    }
    
    .header-btns .btn,
    .header-btns .nav-icon {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
    
    header .logo-img {
        width: 40px;
        height: 40px;
    }
}

/* === FOCUS MANAGEMENT === */
.header-btns .btn:focus-visible,
.header-btns .nav-icon:focus-visible,
.desktop-menu ul li a:focus-visible {
    outline: 2px solid var(--azul-claro);
    outline-offset: 2px;
    border-color: var(--azul-claro);
}

/* === CART BADGE ANIMATIONS === */
.cart-count.badge-updating {
    transform: scale(1.2);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-count.badge-added {
    background: #22c55e !important;
    animation: pulse 0.3s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* === HEADER SCROLL EFFECTS === */
header {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.3s ease,
                padding 0.3s ease;
}