/* ═══════════════════════════════════════════════════════════════════════════
   DevFix — layout.css
   Componentes compartilhados: Header, Footer, WhatsApp Float, Cookie Consent.
   Importado por TODAS as páginas, junto com tokens.css.
═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════════════════════ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 249, 252, 0.92);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
    transition: background var(--dur) var(--ease);
}

[data-theme="dark"] .site-header {
    background: rgba(12, 13, 18, 0.88);
}

.header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 32px;
}

/* ── Logo ───────────────────────────────────────────────────────────────── */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

.logo-icon-wrap {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: box-shadow var(--dur) var(--ease);
}

.logo:hover .logo-icon-wrap {
    box-shadow: 0 0 16px var(--accent-glow);
}

.logo-text {
    color: var(--text-primary) !important;
}

.logo-text strong {
    color: var(--accent);
    font-weight: 800;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.header-nav a,
.header-nav button.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--r-md);
    transition: color var(--dur), background var(--dur);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
}

.header-nav a:hover,
.header-nav button.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-raised);
}

.nav-separator {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
    flex-shrink: 0;
}

.nav-btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent) !important;
    color: var(--text-on-accent) !important;
    padding: 8px 18px !important;
    border-radius: var(--r-md) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    text-decoration: none;
    transition: all var(--dur) var(--ease);
    box-shadow: var(--shadow-sm);
}

.nav-btn-cta:hover {
    background: var(--accent-hover) !important;
    color: var(--text-on-accent) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.nav-btn-ghost {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary) !important;
    padding: 8px 16px !important;
    border: 1px solid var(--border);
    border-radius: var(--r-md) !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    text-decoration: none;
    transition: all var(--dur) var(--ease);
    background: transparent;
}

.nav-btn-ghost:hover {
    color: var(--text-primary) !important;
    border-color: var(--accent);
    background: var(--accent-soft) !important;
}

/* ── Botão Tema ─────────────────────────────────────────────────────────── */
.btn-theme {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dur) var(--ease);
    flex-shrink: 0;
    margin-left: 4px;
}

.btn-theme:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* Ícone de tema: sun visível no dark, moon visível no light */
.icon-sun  { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ── Botão Histórico (app) ──────────────────────────────────────────────── */
.btn-history {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dur) var(--ease);
    flex-shrink: 0;
    position: relative;
}

.btn-history:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.history-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--r-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Badge PRO no header */
.badge-pro {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Admin link */
.nav-admin {
    color: var(--error) !important;
    font-weight: 700 !important;
}

/* ── Mobile Menu Toggle ─────────────────────────────────────────────────── */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════════════════ */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 64px 24px 40px;
    margin-top: auto;
}

[data-theme="dark"] .site-footer {
    background: var(--bg-raised);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 48px;
}

.footer-brand-col {
    flex: 1;
    min-width: 260px;
    max-width: 380px;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 16px;
}

.footer-brand strong {
    color: var(--accent);
    font-weight: 800;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
}

.footer-col {
    min-width: 160px;
}

.footer-col h4 {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 12px;
    font-size: 0.9rem;
    transition: color var(--dur);
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WHATSAPP FLOATING BUTTON
═══════════════════════════════════════════════════════════════════════════ */
.wpp-float {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #25D366;
    border-radius: var(--r-pill);
    height: 56px;
    padding: 0 22px 0 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.30);
    z-index: 9999;
    text-decoration: none;
    transition: all var(--dur-slow) var(--ease);
}

.wpp-float:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(37, 211, 102, 0.40);
}

.wpp-float svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.wpp-text {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COOKIE CONSENT
═══════════════════════════════════════════════════════════════════════════ */
.cookie-consent {
    position: fixed;
    bottom: 28px;
    left: 28px;
    max-width: 340px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    padding: 20px;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xl);
    z-index: 9998;
    transform: translateY(150%);
    transition: transform 0.4s var(--ease);
}

.cookie-consent.show {
    transform: translateY(0);
}

.cookie-consent p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.cookie-consent button {
    background: var(--accent);
    color: var(--text-on-accent);
    border: none;
    padding: 10px 18px;
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    font-family: var(--font-body);
    transition: background var(--dur) var(--ease);
}

.cookie-consent button:hover {
    background: var(--accent-hover);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Layout
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .header-nav {
        display: none;
    }

    .mobile-toggle {
        display: flex;
        margin-left: auto;
    }

    .header-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
        box-shadow: var(--shadow-lg);
        z-index: 99;
        gap: 8px;
    }

    .nav-separator {
        display: none;
    }

    .footer-inner {
        flex-direction: column;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        gap: 32px;
    }

    .wpp-float {
        height: 54px;
        width: 54px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        bottom: 20px;
        right: 20px;
    }

    .wpp-text {
        display: none;
    }

    .cookie-consent {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}


/* ── SEARCH FORM (Global) ───────────────────────────────── */
.search-form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.search-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: 999px;
    padding: 6px 6px 6px 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s var(--ease);
}

.search-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent2-glow);
}

.search-icon {
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    outline: none;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--accent);
    color: var(--text-on-accent);
    border: none;
    border-radius: 999px;
    padding: 12px 32px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.search-form.carregando .search-btn {
    pointer-events: none;
    opacity: 0.8;
}
