/* --- Importação de Fontes --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@500;600;700&display=swap');

/* =====================================================
   VARIÁVEIS GLOBAIS
   ===================================================== */
:root {
    --azul-pantone: #2A4FDA;
    --azul-sebrae: #0054a6;
    --sidebar-bg: #111827;
    --sidebar-hover: #1F2937;
    --sidebar-text: #9CA3AF;
    --sidebar-active-text: #FFFFFF;
    --offwhite: #F1F5F9;
    --azul-claro: #3B82F6;
    --texto-escuro: #0F172A;
    --texto-suave: #64748B;
    --borda-suave: #E2E8F0;
    --branco: #FFFFFF;
    --whatsapp-green: #25D366;
    --novo-red: #EF4444;
    --fav-yellow: #FACC15;
    --transicao: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   RESET & BASE
   ===================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--offwhite);
    color: var(--texto-escuro);
    line-height: 1.6;
    min-height: 100vh;
}

/* =====================================================
   LAYOUT ESTRUTURAL
   ===================================================== */
.main-container { display: flex; min-height: calc(100vh - 80px); }

/* =====================================================
   BANNER — imagem 1810x162px, proporção preservada
   ===================================================== */
.banner {
    width: 100%;
    height: 0;
    overflow: hidden;
    background: url('Banner.png') center / 100% 100% no-repeat, linear-gradient(135deg, #2A4FDA, #7C3AED);
    box-shadow: none;
    position: relative;
    z-index: 101;
    transition: height 0.42s cubic-bezier(.2,.8,.2,1), box-shadow 0.42s ease;
}

body.banner-on .banner {
    height: clamp(60px, 8.95vw, 162px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    padding: 2.5rem 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.logo-area {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #1F2937;
}

.portal-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-title .portal-nome {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: #FFFFFF;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.portal-title .portal-org {
    font-size: 0.72rem;
    color: var(--sidebar-text);
    font-weight: 500;
    letter-spacing: 0.03em;
}

.sidebar nav ul { list-style: none; }

.sidebar nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transicao);
    position: relative;
}

.sidebar nav li a:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-active-text);
}

.sidebar nav li a.active {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-active-text);
}

.sidebar nav li a.active::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 4px;
    background-color: var(--azul-claro);
    border-radius: 0 4px 4px 0;
}

.sidebar nav li a i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* Toggle do banner — item especial da navegação */
.sidebar nav li.nav-toggle {
    margin-top: 0.4rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--borda-suave, rgba(255,255,255,0.12));
}
.sidebar nav li.nav-toggle a {
    cursor: pointer;
    color: var(--sidebar-text);
}
.sidebar nav li.nav-toggle a .nav-toggle-state {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.55;
}
body.banner-on .sidebar nav li.nav-toggle a {
    color: var(--sidebar-active-text, #fff);
}
body.banner-on .sidebar nav li.nav-toggle a .nav-toggle-state {
    opacity: 1;
    color: #FF8A6B;
}

.logout-btn {
    margin-top: auto;
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transicao);
    font-size: 0.9rem;
    border-radius: 8px;
}
.logout-btn:hover { color: white; background-color: var(--sidebar-hover); }

/* =====================================================
   ÁREA DE CONTEÚDO
   ===================================================== */
.content {
    flex-grow: 1;
    padding: 2.5rem 3rem;
    max-width: 1400px;
    animation: entradaSuave 0.4s ease-out forwards;
}

/* =====================================================
   CONTENT BOX
   ===================================================== */
.content-box {
    background: var(--branco);
    border: 1px solid var(--borda-suave);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.content-box h1 {
    font-size: 1.3rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--texto-escuro);
    margin-bottom: 1rem;
}

.content-box h2 {
    font-size: 1.2rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--texto-escuro);
    margin-bottom: 0.75rem;
}

.centered-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.link-description {
    font-size: 0.9rem;
    color: var(--texto-suave);
    line-height: 1.8;
}

/* =====================================================
   BOTÕES
   ===================================================== */
.botao-principal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--azul-pantone);
    color: var(--branco) !important;
    text-decoration: none;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transicao);
    white-space: nowrap;
}

.botao-principal:hover {
    background: #1e3db8;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(42, 79, 218, 0.35);
}

.botão-de-link,
.botao-de-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--whatsapp-green);
    color: var(--branco) !important;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transicao);
}

.botão-de-link:hover,
.botao-de-link:hover {
    background: #1da851;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

/* =====================================================
   LINKS DE RECURSOS
   ===================================================== */
.resource-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    margin-bottom: 10px;
    background: var(--branco);
    border: 1px solid var(--borda-suave);
    border-radius: 10px;
    text-decoration: none;
    color: var(--texto-escuro);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transicao);
    cursor: pointer;
}

.resource-link:hover {
    border-color: var(--azul-claro);
    background: #EFF6FF;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

/* =====================================================
   INPUTS DE BUSCA
   ===================================================== */
.input-field-search {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--borda-suave);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--texto-escuro);
    background: var(--branco);
    transition: var(--transicao);
    margin-bottom: 1rem;
    outline: none;
}

.input-field-search:focus {
    border-color: var(--azul-claro);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* =====================================================
   GRID DE MATERIAIS
   ===================================================== */
.materiais-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.coluna-material {
    display: flex;
    flex-direction: column;
}

.coluna-material h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--borda-suave);
    margin-bottom: 0.75rem;
}

/* =====================================================
   CALCULADORA
   ===================================================== */
.calc-section {
    margin-top: 1.5rem;
}

/* =====================================================
   ESTRELA FAVORITO
   ===================================================== */
.star-fav {
    font-size: 1rem;
    color: #CBD5E1;
    transition: var(--transicao);
    flex-shrink: 0;
    margin-left: 8px;
    cursor: pointer;
}

.star-fav.is-fav {
    color: var(--fav-yellow);
}

.star-fav:hover {
    color: var(--fav-yellow);
    transform: scale(1.2);
}

/* =====================================================
   BADGE "NOVO"
   ===================================================== */
.badge-novo {
    display: inline-block;
    background: var(--novo-red);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 8px;
    vertical-align: middle;
}

/* =====================================================
   BOTÃO FLUTUANTE DE FAVORITOS
   ===================================================== */
.fav-quick-access {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--azul-pantone);
    color: white !important;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(42, 79, 218, 0.4);
    transition: var(--transicao);
    z-index: 999;
}

.fav-quick-access:hover {
    background: #1e3db8;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(42, 79, 218, 0.5);
}

.fav-quick-access span {
    color: var(--fav-yellow);
}

/* =====================================================
   CARDS DE PREÇO
   ===================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.price-card {
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.card-claro {
    background-color: var(--branco);
    border: 1px solid var(--borda-suave);
}

.card-escuro {
    background-color: #1E293B;
    color: white;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.icon-box {
    background: #EFF6FF;
    color: var(--azul-claro);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-box.dark {
    background: rgba(255, 255, 255, 0.1);
    color: var(--azul-claro);
}

.card-subtitle { font-size: 0.8rem; color: var(--texto-suave); margin-bottom: 0.2rem; }
.card-price { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.card-desc { font-size: 0.85rem; color: var(--texto-suave); margin-bottom: 1.5rem; flex-grow: 1; }

.btn-detalhes {
    background: #EFF6FF;
    color: var(--azul-claro);
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transicao);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-detalhes:hover { background: #DBEAFE; }

.btn-escuro { background: var(--branco); color: #1E293B; }
.btn-escuro:hover { background: #F1F5F9; }

.card-footer-dark {
    background: #1E293B;
    margin: 1.5rem -1.5rem -1.5rem -1.5rem;
    padding: 1.5rem;
}

/* =====================================================
   ANIMAÇÕES
   ===================================================== */
@keyframes entradaSuave {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   RESPONSIVO
   ===================================================== */
@media (max-width: 768px) {
    .sidebar { width: 200px; padding: 1.5rem 1rem; }
    .content { padding: 1.5rem; }
    .content-box { padding: 1.5rem; }
    .materiais-container { grid-template-columns: 1fr; }
    .fav-quick-access { bottom: 16px; right: 16px; padding: 10px 16px; font-size: 0.8rem; }
}

@media (max-width: 560px) {
    .main-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; padding: 1rem; }
    .sidebar nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem; }
    .logout-btn { margin-top: 0; }
}
