/* Car Drive - Header Moderno */
/* Versão 1.0 - Header responsivo e moderno */

/* ========================================
   DESABILITAR ELEMENTOS ANTIGOS
   ======================================== */

/* Desabilitar nav lateral antigo */
.car-drive-nav {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    z-index: -1 !important;
}

/* Desabilitar botões mobile antigos */
.mobile-menu-toggle,
.mobile-menu-toggle-simple,
button[class*="menu-toggle"],
button[class*="mobile-menu"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    z-index: -1 !important;
}

/* Remover margem do main que era para o nav lateral */
.car-drive-main {
    margin-left: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ========================================
   HEADER MODERNO
   ======================================== */

/* Variáveis CSS */
:root {
    --header-height: 70px;
    --primary-color: #007cba;
    --secondary-color: #2c3e50;
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --z-sticky: 1000;
    --z-dropdown: 1001;
}

/* Header Principal */
.car-drive-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--secondary-color) 0%, #34495e 100%);
    color: white;
    z-index: var(--z-sticky);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    transition: all var(--transition);
}

/* Logo/Brand */
.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(45deg, #fff, #a8dadc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.header-brand::after {
    content: '';
    width: 2px;
    height: 30px;
    background: linear-gradient(45deg, var(--primary-color), #a8dadc);
    margin-left: 1rem;
}

/* Menu de Navegação */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.header-menu li {
    position: relative;
}

.header-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.header-menu a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.header-menu a:hover,
.header-menu a.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.header-menu a:hover::before,
.header-menu a.active::before {
    width: 80%;
}

.header-menu a.active {
    background: rgba(0, 124, 186, 0.2);
    font-weight: 600;
}

/* Área do Usuário */
.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.header-user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.header-user-actions {
    display: flex;
    gap: 0.5rem;
}

.header-user a {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.header-user a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Botão Mobile */
.header-mobile-toggle {
    display: none !important;
    background: none !important;
    border: none !important;
    color: white !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    padding: 0.5rem !important;
    border-radius: var(--border-radius) !important;
    transition: var(--transition) !important;
    /* CORREÇÃO: Centralizar ícone do hambúrguer */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
}

/* CORREÇÃO: Garantir alinhamento correto do ícone */
.header-mobile-toggle .toggle-icon {
    display: inline-block !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
}

.header-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Menu Mobile */
.header-mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--secondary-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: var(--z-dropdown);
    transform: translateY(-100%);
    transition: transform var(--transition);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.header-mobile-menu.show {
    transform: translateY(0);
    display: block;
}

.header-mobile-menu .header-menu {
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
}

.header-mobile-menu .header-menu a {
    padding: 1rem;
    border-radius: var(--border-radius);
    justify-content: space-between;
}

.header-mobile-menu .header-menu a::after {
    content: '→';
    opacity: 0.5;
}

/* Área do usuário no mobile */
.header-user-mobile {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
}

.header-user-mobile .header-user-info {
    margin-bottom: 1rem;
}

.header-user-mobile .header-user-actions {
    flex-direction: column;
    gap: 0.5rem;
}

.header-user-mobile .header-user a {
    justify-content: center;
    padding: 0.75rem;
}

/* Ajustes para o conteúdo principal */
.car-drive-main {
    margin-top: calc(var(--header-height) + 0rem) !important;
    padding-top: 1rem !important; /* Desktop: 6rem */
    min-height: calc(100vh - var(--header-height)) !important;
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 1200px) {
    .car-drive-header {
        padding: 0 1rem;
    }

    .header-menu a {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    /* Esconde apenas a navegação desktop dentro do header */
    .car-drive-header > .header-nav {
        display: none !important;
    }
    /* Mantém a navegação visível dentro do menu mobile */
    .header-mobile-menu .header-nav {
        display: flex !important;
    }

    .header-mobile-toggle {
        display: block !important;
    }

    /* Menu mobile como drawer lateral ocupando >=70% da largura */
    .header-mobile-menu {
        left: 0;
        right: auto;
        width: min(640px, 92vw); /* limitar para não vazar */
        max-width: 92vw;
        height: calc(100vh - var(--header-height));
        transform: translateX(-110%); /* sobrescreve translateY padrão */
        border-right: 1px solid rgba(255,255,255,0.08);
        box-shadow: 8px 0 24px rgba(0,0,0,0.25);
        overflow-y: auto;
        overflow-x: hidden;
    }
    .header-mobile-menu.show {
        transform: translateX(0);
    }

    .header-mobile-menu .header-menu { padding: 0.5rem 0.75rem; }
    .header-mobile-menu .header-menu a {
        width: 100%;
        font-size: clamp(1rem, 2.8vw, 1.25rem);
        padding: 1rem 1.25rem;
    }
    .header-mobile-menu .menu-icon { font-size: 1.1em; margin-right: 10px; }

    /* CORREÇÃO: Esconder completamente header-user no mobile */
    .header-user { display: none !important; }
    .header-user-info { display: none !important; }
    .header-user-actions { gap: 0.25rem !important; }
    .header-user a { padding: 0.5rem !important; font-size: 0.7rem !important; }

    /* Mobile: padding-top de 20px */
    .car-drive-main { padding-top: 20px !important; }
}

@media (max-width: 768px) {
    .car-drive-header {
        padding: 0 0.75rem;
    }

    .header-brand h1 {
        font-size: 1.25rem;
    }

    .header-brand::after {
        display: none;
    }

    .header-mobile-menu {
        display: none; /* manter oculto quando fechado para evitar "faixa" lateral */
    }

    .header-user-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .header-user a {
        padding: 0.4rem 0.6rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .car-drive-header {
        padding: 0 0.5rem;
    }

    .header-brand h1 {
        font-size: 1.1rem;
    }

    .header-user-actions {
        gap: 0.2rem;
    }

    .header-user a {
        padding: 0.35rem 0.5rem;
        font-size: 0.6rem;
    }
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

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

.header-mobile-menu.show {
    animation: slideDown 0.3s ease-out;
}

/* ========================================
   ACESSIBILIDADE
   ======================================== */

/* Estados de foco para acessibilidade */
.header-menu a:focus,
.header-user a:focus,
.header-mobile-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========================================
   MODOS ESPECIAIS
   ======================================== */

/* Modo escuro */
@media (prefers-color-scheme: dark) {
    .car-drive-header {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    }
}

/* Redução de movimento */
@media (prefers-reduced-motion: reduce) {
    .car-drive-header,
    .header-menu a,
    .header-user a,
    .header-mobile-toggle,
    .header-mobile-menu {
        transition: none;
    }

    .header-mobile-menu.show {
        animation: none;
    }
}

/* ========================================
   CORREÇÕES ESPECÍFICAS
   ======================================== */

/* Garantir que o header esteja sempre visível */
.car-drive-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
}

/* Remover qualquer overflow que possa esconder o header */
body {
    overflow-x: hidden;
}

/* Garantir que o conteúdo principal não sobreponha o header */
.car-drive-main {
    position: relative;
    z-index: 1;
}

/* Esconder completamente elementos antigos */
.car-drive-nav,
.mobile-menu-toggle,
.mobile-menu-toggle-simple {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    z-index: -9999 !important;
    pointer-events: none !important;
}

/* SOBRESCREVER CONFLITOS DO MAIN-RESPONSIVE.CSS */
body .mobile-menu-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    z-index: -9999 !important;
    pointer-events: none !important;
}

/* Garantir que o header moderno funcione corretamente */
.car-drive-header .header-mobile-toggle {
    display: none !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    z-index: auto !important;
    pointer-events: auto !important;
}

@media (max-width: 768px) {
    .car-drive-header .header-mobile-toggle {
        display: block !important;
    }
} 