/* ========================================
   HEADER GLOBAL - ESTILO QUE CUIDA
   CSS-first, mobile-first, Next.js ready
   ======================================== */

/* Header Container */
.global-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 1200;
}

.header-container {
    max-width: 1536px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Logo */
.header-logo img {
    height: 48px;
    width: auto;
}

@media (min-width: 768px) {
    .header-logo img {
        height: 60px;
    }
}

/* Navigation */
.header-nav {
    display: none;
}

@media (min-width: 1024px) {
    .header-nav {
        display: flex;
        align-items: center;
        gap: 2rem;
    }
}

.header-nav-list {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.header-nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-secondary, #4a5568);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.25s ease;
}

@media (hover: hover) {
    .header-nav-link:hover {
        color: var(--color-accent);
        background: var(--color-accent-soft);
    }
}

.header-nav-link:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* Dropdown (CSS-first) */
.header-dropdown {
    position: relative;
}

.header-dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.header-dropdown-toggle::after {
    content: '▼';
    font-size: 0.75rem;
    margin-left: 0.5rem;
    transition: transform 0.25s ease;
}

.header-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 1000;
}

/* Dropdown aberto via hover ou focus-within */
.header-dropdown:hover .header-dropdown-menu,
.header-dropdown:focus-within .header-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-dropdown:hover .header-dropdown-toggle::after,
.header-dropdown:focus-within .header-dropdown-toggle::after {
    transform: rotate(180deg);
}

.header-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
}

@media (hover: hover) {
    .header-dropdown-menu a:hover {
        background: var(--color-bg-subtle, #f5f7f9);
    }
}

/* Ícones de produtos */
.product-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.product-icon.contare { background: #ff6b35; }
.product-icon.essentia { background: #00b386; }
.product-icon.raiza { background: #8ba888; }
.product-icon.flexa { background: #e07a5f; }

/* Actions Container */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0; /* Apenas um CTA agora */
}


/* CTA - Primary Action */
.header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-accent); /* Fallback */
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-strong) 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    min-height: 44px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.25s ease;
    white-space: nowrap;
}

@media (hover: hover) {
    .header-cta:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        filter: brightness(110%);
    }
}

.header-cta:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* Mobile Toggle */
.header-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

@media (min-width: 1024px) {
    .header-toggle {
        display: none;
    }
}

.header-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text-primary, #1a202c);
    border-radius: 2px;
    transition: all 0.25s ease;
}

/* Mobile Menu (JS-enhanced) */
.header-nav.mobile-open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 1.5rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-nav.mobile-open .header-nav-list {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.header-nav.mobile-open .header-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    margin-top: 0.5rem;
    display: none;
}

.header-nav.mobile-open .header-dropdown.open .header-dropdown-menu {
    display: block;
}

.header-nav.mobile-open .header-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-subtle);
    margin-top: 1rem;
}

.header-nav.mobile-open .header-cta {
    width: 100%;
    text-align: center;
    margin: 0;
}

/* Body padding */
body {
    padding-top: 80px;
}

@media (min-width: 768px) {
    body {
        padding-top: 88px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
