/**
 * Econecta — style.css (Design System Global)
 * © 2026 Pedro Augusto Ferreira Oliveira Santos — FATEC Campinas / TecnoGreen
 * Todos os direitos reservados. Reprodução proibida sem autorização expressa.
 */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --verde-escuro:     #2C5F3E;
    --verde-medio:      #4CAF72;
    --verde-claro:      #A8D9B0;
    --verde-suave:      #D8F0DE;
    --verde-fundo:      #F0F7F1;
    --verde-floresta:   #1B4332;
    --folinhas-cor:     #C9A84C;
    --folinhas-fundo:   #FDF6E3;
    --texto-primario:   #1A1A1A;
    --texto-secundario: #555555;
    --texto-auxiliar:   #888888;
    --fonte:            'Poppins', sans-serif;
    --fonte-editorial:  'Playfair Display', Georgia, serif;
    --borda-sm:         6px;
    --borda-md:         12px;
    --borda-lg:         20px;
    --borda-xl:         28px;
    --borda-pill:       50px;
    --sombra-ring:      0 0 0 1px rgba(44,95,62,0.12);
    --sombra-sm:        0 2px 8px rgba(44,95,62,0.08);
    --sombra-md:        0 4px 16px rgba(44,95,62,0.12);
    --sombra-lg:        0 8px 32px rgba(44,95,62,0.16);
    --sombra-focus:     0 0 0 3px rgba(44,95,62,0.15);
    --transicao:        all 0.25s ease;
    --container:        1100px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--fonte);
    color: var(--texto-primario);
    background: var(--verde-fundo);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: var(--transicao); }
ul { list-style: none; }
input, textarea, select, button { font-family: var(--fonte); }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 32px;
}

h1 { font-size: 2.5rem;  font-weight: 700; line-height: 1.12; letter-spacing: -0.04em; }
h2 { font-size: 1.75rem; font-weight: 700; line-height: 1.22; letter-spacing: -0.025em; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3;  letter-spacing: -0.01em; }
h4 { font-size: 1rem;    font-weight: 600; letter-spacing: -0.005em; }
p  { font-size: 0.9375rem; line-height: 1.75; color: var(--texto-secundario); }

/* Header */
.header {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(44,95,62,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 32px;
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.logo { display: flex; align-items: center; gap: 8px; }
.logo-texto { font-size: 1.25rem; font-weight: 700; color: var(--verde-escuro); letter-spacing: -0.5px; }

.nav { display: flex; align-items: center; gap: 32px; }
.nav a { font-size: 0.875rem; font-weight: 500; color: var(--texto-secundario); }
.nav a:hover { color: var(--verde-escuro); }
.nav a.ativo { color: var(--verde-escuro); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.carrinho-btn {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--texto-secundario);
}

.carrinho-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--verde-escuro);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    min-height: 44px;
    border-radius: var(--borda-pill);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transicao);
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn-primario {
    background: var(--verde-escuro);
    color: white;
    border-color: var(--verde-escuro);
    box-shadow: 0 1px 3px rgba(44,95,62,0.2), 0 1px 2px rgba(44,95,62,0.12);
}
.btn-primario:hover {
    background: #1e4a2e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44,95,62,0.3), 0 2px 4px rgba(44,95,62,0.15);
}
.btn-primario:active { transform: translateY(0); box-shadow: none; }

.btn-outline { background: transparent; color: var(--verde-escuro); border-color: var(--verde-escuro); }
.btn-outline:hover { background: var(--verde-escuro); color: white; box-shadow: 0 4px 12px rgba(44,95,62,0.2); }

.btn-sm { padding: 7px 16px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* Cards */
.card {
    background: white;
    border-radius: var(--borda-lg);
    border: 1px solid rgba(44,95,62,0.07);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.card:hover {
    box-shadow: var(--sombra-ring), var(--sombra-md);
    transform: translateY(-3px);
    border-color: rgba(44,95,62,0.14);
}
.card-body { padding: 20px; }

/* Badge Folinhas — D3: identidade visual âmbar exclusiva */
.badge-folinha {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--folinhas-fundo);
    color: #8B6914;
    border: 1px solid rgba(201,168,76,0.3);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--borda-pill);
}

/* Badge Em Destaque — D4: curadoria premium, não desconto */
.badge-em-destaque {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--verde-floresta);
    color: var(--folinhas-cor);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--borda-pill);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Formulários */
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.form-label { font-size: 0.8125rem; font-weight: 500; color: var(--texto-primario); }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #E0E0E0;
    border-radius: var(--borda-sm);
    font-size: 0.875rem;
    background: white;
    transition: var(--transicao);
    outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--verde-escuro);
    box-shadow: var(--sombra-focus);
    background: white;
}

/* Seções */
.section { padding: 72px 0; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
}

.section-header h2 { letter-spacing: -0.025em; }

.section-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--verde-escuro);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.section-link:hover { opacity: 1; }

/* Footer */
.footer {
    background: var(--verde-escuro);
    padding: 48px 32px 24px;
}

.footer-inner { max-width: var(--container); margin: 0 auto; }

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-logo { color: white; font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.footer-desc { color: rgba(255,255,255,0.65); font-size: 0.875rem; line-height: 1.7; }
.footer-titulo { color: white; font-size: 0.875rem; font-weight: 600; margin-bottom: 16px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: rgba(255,255,255,0.65); font-size: 0.875rem; }
.footer-links a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-slogan { color: rgba(255,255,255,0.85); font-size: 0.875rem; font-weight: 500; }
.footer-copy { color: rgba(255,255,255,0.45); font-size: 0.8125rem; }

/* ══════════════════════════════════════
   Hamburger Button — TECH-12
   ══════════════════════════════════════ */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: var(--borda-md);
    transition: background 0.2s;
    flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--verde-suave); }
.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--texto-primario);
    border-radius: 2px;
    transition: var(--transicao);
}

/* ══════════════════════════════════════
   Drawer Overlay — TECH-12
   ══════════════════════════════════════ */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1099;
    backdrop-filter: blur(2px);
}
.drawer-overlay.ativo { display: block; }

/* ══════════════════════════════════════
   Nav Drawer — TECH-12 (mobile only)
   ══════════════════════════════════════ */
.nav-drawer {
    display: none; /* oculto no desktop — ativado apenas via @media mobile */
}

.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(44,95,62,0.08);
    flex-shrink: 0;
}

.nav-drawer-fechar {
    width: 36px;
    height: 36px;
    background: var(--verde-suave);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--verde-escuro);
    transition: var(--transicao);
    flex-shrink: 0;
}
.nav-drawer-fechar:hover { background: var(--verde-claro); }

.nav-drawer-busca {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(44,95,62,0.06);
    flex-shrink: 0;
}
.nav-drawer-busca-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--verde-fundo);
    border-radius: var(--borda-md);
    padding: 10px 14px;
    border: 1.5px solid transparent;
    transition: border-color 0.2s;
}
.nav-drawer-busca-form:focus-within { border-color: var(--verde-claro); }
.nav-drawer-busca-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.875rem;
    font-family: var(--fonte);
    color: var(--texto-primario);
    min-width: 0;
}
.nav-drawer-busca-input::placeholder { color: var(--texto-auxiliar); }

.nav-drawer-links {
    display: flex;
    flex-direction: column;
    padding: 8px;
    flex: 1;
}

.nav-drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--texto-secundario);
    border-radius: var(--borda-md);
    text-decoration: none;
    transition: var(--transicao);
    min-height: 48px;
}
.nav-drawer-link:hover,
.nav-drawer-link.ativo {
    background: var(--verde-suave);
    color: var(--verde-escuro);
}
.nav-drawer-link svg { flex-shrink: 0; }

.nav-drawer-divider {
    height: 1px;
    background: rgba(44,95,62,0.08);
    margin: 8px 12px;
}

.nav-drawer-folinha {
    padding: 10px 12px;
    font-size: 0.875rem;
    color: var(--verde-escuro);
    background: var(--verde-suave);
    border-radius: var(--borda-md);
    margin: 0 8px 4px;
}

.nav-drawer-sair { color: #D32F2F !important; }
.nav-drawer-sair:hover { background: #FFEBEE !important; }

.nav-drawer-acoes {
    padding: 8px 16px 24px;
    border-top: 1px solid rgba(44,95,62,0.08);
    flex-shrink: 0;
}

/* ══════════════════════════════════════
   Responsivo — TECH-12
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.375rem; }
    .container { padding: 0 16px; }

    /* Header mobile */
    .nav { display: none; }
    .header-busca { display: none; }
    .hamburger-btn { display: flex; }
    .badge-folinha-header { display: none; }
    .logo img { max-height: 40px !important; width: auto !important; }

    /* Drawer — só ativo no mobile */
    .nav-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0; right: 0;
        width: 280px;
        height: 100%;
        background: white;
        z-index: 1100;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--sombra-lg);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .nav-drawer.aberto { transform: translateX(0); }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ══════════════════════════════════════
   Busca no Header — EDEV-148
   ══════════════════════════════════════ */
.header-busca {
    position: relative;
    display: flex;
    align-items: center;
}

.header-busca-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--texto-secundario);
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: background .2s, color .2s;
    line-height: 1;
}

.header-busca-btn:hover {
    background: var(--verde-suave);
    color: var(--verde-escuro);
}

.header-busca-form {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 280px;
    background: white;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    border: 1.5px solid var(--verde-suave);
    border-bottom: none;
    opacity: 0;
    transform: translateY(-8px) scale(.98);
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 1001;
    overflow: visible;
}

.header-busca-form.ativo {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ── Dropdown de sugestões de busca ─── */
.busca-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    border: 1px solid #F0F0F0;
    border-top: none;
    max-height: 420px;
    overflow-y: auto;
    z-index: 1002;
}
.busca-dropdown.ativo { display: block; }
.busca-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--texto-principal);
    border-bottom: 1px solid #F8F8F8;
    transition: background .12s;
}
.busca-item:hover,
.busca-item.ativo { background: var(--verde-suave); }
.busca-item-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #F8F8F6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.busca-item-img img { width: 100%; height: 100%; object-fit: cover; }
.busca-item-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.busca-item-info { flex: 1; min-width: 0; }
.busca-item-nome {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--texto-principal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.busca-item-nome mark { background: none; color: var(--verde-escuro); font-weight: 800; }
.busca-item-cat { font-size: 0.72rem; color: #888; }
.busca-item-preco {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--verde-escuro);
    white-space: nowrap;
    flex-shrink: 0;
}
.busca-ver-todos {
    display: block;
    padding: 10px 14px;
    font-size: 0.8125rem;
    color: var(--verde-escuro);
    text-decoration: none;
    text-align: center;
    background: #F8FAF8;
    border-top: 1px solid #F0F0F0;
}
.busca-ver-todos:hover { background: var(--verde-suave); }

.header-busca-form form {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.header-busca-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 14px;
    font-size: 0.875rem;
    font-family: var(--fonte);
    color: var(--texto-primario);
    background: transparent;
    min-width: 0;
}

.header-busca-input::placeholder { color: #bbb; }

.header-busca-submit {
    background: var(--verde-escuro);
    border: none;
    cursor: pointer;
    padding: 12px 13px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    flex-shrink: 0;
}

.header-busca-submit:hover { background: #1e4a2e; }

/* Utilitários */
.w-100 { width: 100%; }

@media (max-width: 768px) {
    .header-busca { display: none; }
}

/* Utilitários */
.w-100 { width: 100%; }

/* Busca mobile */
@media (max-width: 768px) {
    .header-busca-form {
        width: 220px;
    }
}