/*
Theme Name: MaisShopp - Central de Ajuda
Description: Tema de central de ajuda para clientes do MaisShopp — minimalista, acolhedor e fácil de navegar.
Version: 2.0
Author: MaisShopp
*/

/* ==========================================================================
   0. FONTES E VARIÁVEIS DE MARCA
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --brand: #1978D8;
    --brand-dark: #125FAE;
    --brand-light: #EAF3FD;
    --brand-soft: #F3F8FE;
    --ink: #1A202C;
    --ink-soft: #4A5568;
    --muted: #718096;
    --border: #E2E8F0;
    --bg: #F7FAFC;
    --white: #FFFFFF;
    --success: #2F9E63;
    --font-heading: 'Comfortaa', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius: 14px;
    --shadow-sm: 0 2px 6px rgba(17, 24, 39, 0.04);
    --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.08);
}

/* ==========================================================================
   1. RESET E ESTILOS GLOBAIS
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--ink-soft);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo a, .btn, .category-card h2, .cta-title {
    font-family: var(--font-heading);
    color: var(--ink);
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 15px 0;
}

/* ==========================================================================
   2. CABEÇALHO COMPARTILHADO (HEADER)
   ========================================================================== */
header {
    background: var(--brand);
    border-bottom: 1px solid var(--brand);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo a {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo a:hover { text-decoration: none; color: var(--brand); }

.logo img,
.logo .custom-logo {
    max-height: 55px;
    width: auto;
    display: block;
}

/* Formulário de busca (componente usado no cabeçalho e no hero da home) */
.kb-search-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Variante do cabeçalho: pílula compacta */
.search-bar .kb-search-form {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 4px 4px 4px 16px;
    width: 280px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar .kb-search-form:focus-within {
    border-color: var(--white);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.35);
}

.search-bar .search-field {
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.92rem;
    width: 100%;
    color: var(--ink);
}

.search-bar .search-field::placeholder {
    color: var(--muted);
}

.search-bar .search-submit {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--white);
}

.search-bar .search-submit:hover {
    background: var(--brand-dark);
}

/* Variante do hero: botão maior, flutuando dentro do input arredondado */
.hero-search .kb-search-form {
    position: relative;
    display: block;
}

.hero-search .search-field {
    width: 100%;
    padding: 17px 64px 17px 26px;
    border: none;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 1.05rem;
    box-shadow: var(--shadow-md);
    outline: none;
}

.hero-search .search-submit {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--white);
}

.hero-search .search-submit:hover {
    background: var(--brand-dark);
}

/* Botão circular base: ícone de lupa, sem borda, com transição suave */
.search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.15s ease;
}

.search-submit:active {
    transform: scale(0.94);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); text-decoration: none; }
.breadcrumbs .sep { color: #CBD5E0; }
.breadcrumbs .current { color: var(--ink-soft); font-weight: 500; }

/* ==========================================================================
   3. SEÇÃO HERO (PÁGINA INICIAL)
   ========================================================================== */
.hero-section {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: var(--white);
    padding: 70px 0 80px;
    text-align: center;
}

.hero-section h1 {
    font-family: var(--font-heading);
    color: var(--white);
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.hero-section .hero-subtitle {
    color: rgba(255,255,255,0.85);
    font-size: 1.05rem;
    margin-bottom: 30px;
}

.hero-search {
    max-width: 620px;
    margin: 0 auto;
}

.hero-quicklinks {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-quicklinks a {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.12);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.hero-quicklinks a:hover {
    background: rgba(255,255,255,0.22);
    text-decoration: none;
    color: var(--white);
}

/* ==========================================================================
   4. GRADE DE CATEGORIAS (PÁGINA INICIAL)
   ========================================================================== */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--ink);
    margin: 55px 0 25px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    margin: 0 0 30px;
}

.category-card {
    background: var(--white);
    padding: 32px 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    border-color: var(--brand);
}

.category-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--brand-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 14px;
}

.category-card h2 {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.category-card p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.category-card .category-count {
    margin-top: 14px;
    font-size: 0.82rem;
    color: var(--brand);
    font-weight: 600;
}

/* Categorias em destaque (ex: "Comece aqui") */
.featured-categories {
    margin-top: 50px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.featured-category {
    position: relative;
    display: flex;
    align-items: center;
    gap: 26px;
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 5px solid var(--brand);
    border-radius: var(--radius);
    padding: 30px 36px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.featured-category::after {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: var(--brand-light);
    border-radius: 50%;
    opacity: 0.5;
    z-index: 0;
}

.featured-category:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand);
    text-decoration: none;
}

.featured-category-icon {
    position: relative;
    z-index: 1;
    font-size: 2.1rem;
    background: var(--brand-light);
    color: var(--brand);
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-category-text {
    position: relative;
    z-index: 1;
    flex: 1;
}

.featured-category-label {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--brand);
    background: var(--brand-light);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.featured-category-text h2 {
    font-family: var(--font-heading);
    color: var(--ink);
    font-size: 1.35rem;
    margin: 2px 0 6px;
}

.featured-category-text p {
    color: var(--muted);
    font-size: 0.96rem;
}

.featured-category-arrow {
    position: relative;
    z-index: 1;
    font-size: 1.4rem;
    color: var(--brand);
    transition: transform 0.2s ease;
}

.featured-category:hover .featured-category-arrow {
    transform: translateX(5px);
}

.featured-category-links {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-left: 90px;
}

.featured-category-links a {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.86rem;
    color: var(--ink-soft);
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.featured-category-links a:hover {
    color: var(--brand);
    border-color: var(--brand);
    background: var(--brand-light);
    text-decoration: none;
}

/* CTA de suporte no rodapé da home */
.support-cta {
    background: var(--brand-soft);
    border: 1px solid var(--brand-light);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    margin: 55px 0 50px;
}

.support-cta .cta-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.support-cta p {
    color: var(--ink-soft);
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    background: var(--brand);
    color: var(--white);
    padding: 12px 26px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover {
    background: var(--brand-dark);
    text-decoration: none;
    color: var(--white);
    transform: translateY(-2px);
}

/* ==========================================================================
   5. LAYOUT DE ARTIGOS (INDEX.PHP & PAGE.PHP)
   ========================================================================== */
.kb-layout {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) 210px;
    gap: 24px;
    max-width: 1340px;
    margin: 36px auto 60px;
    align-items: start;
}

/* Trava cada bloco na sua coluna. Sem isso, quando o índice (.kb-toc) é
   escondido via display:none (artigo sem H2/H3 para listar), o CSS Grid
   reorganiza o artigo e a barra de relacionados para a esquerda, usando
   as faixas de 190px/513px em vez de article/sidebar nas larguras certas. */
.kb-layout > .kb-toc { grid-column: 1; }
.kb-layout > .article-card { grid-column: 2; }
.kb-layout > .kb-sidebar { grid-column: 3; }

.article-card, .page-wrapper {
    background: var(--white);
    padding: 44px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    min-width: 0;
}

.article-card h1, .page-wrapper h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--ink);
    line-height: 1.3;
}

.page-wrapper h1 {
    border-bottom: 2px solid var(--bg);
    padding-bottom: 18px;
    margin-bottom: 24px;
}

.article-meta {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

/* Formatação rica do conteúdo interno dos artigos (Gutenberg) */
.article-content h1,
.article-content h2,
.article-content h3 {
    scroll-margin-top: 90px;
}

.article-content h2 {
    margin: 35px 0 15px 0;
    font-size: 1.45rem;
    color: var(--ink);
}

.article-content h3 {
    margin: 25px 0 10px 0;
    font-size: 1.15rem;
    color: var(--ink);
}

.article-content p {
    margin-bottom: 20px;
    font-size: 1.02rem;
    color: var(--ink-soft);
}

.article-content ul, .article-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
    color: var(--ink-soft);
}

.article-content li {
    margin-bottom: 8px;
}

.article-content a { text-decoration: underline; }

/* Caixas de avisos/notas dentro do texto */
.article-content blockquote {
    background: var(--brand-soft);
    border-left: 4px solid var(--brand);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

/* Bloco de feedback "esse artigo ajudou?" */
.article-feedback {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.article-feedback p {
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 14px;
    font-family: var(--font-heading);
    font-size: 1rem;
}

.feedback-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.feedback-buttons button {
    font-family: var(--font-body);
    border: 1px solid var(--border);
    background: var(--white);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--ink-soft);
    transition: border-color 0.2s, color 0.2s;
}

.feedback-buttons button:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* ==========================================================================
   5b. ÍNDICE DO ARTIGO (SUMÁRIO À ESQUERDA)
   ========================================================================== */
.kb-toc {
    background: var(--white);
    padding: 22px 20px;
    border-radius: var(--radius);
    height: fit-content;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: sticky;
    top: 100px;
}

.kb-toc summary {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
}

.kb-toc summary::-webkit-details-marker,
.kb-toc summary::marker {
    display: none;
}

.kb-toc ul {
    list-style: none;
    margin-top: 14px;
    border-left: 2px solid var(--border);
}

.kb-toc .toc-item a {
    display: block;
    padding: 6px 0 6px 14px;
    margin-left: -2px;
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--ink-soft);
    border-left: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.kb-toc .toc-item a:hover {
    color: var(--brand);
    text-decoration: none;
}

.kb-toc .toc-item a.active {
    color: var(--brand);
    border-left-color: var(--brand);
    font-weight: 600;
}

.kb-toc .toc-h1 a { font-weight: 600; }
.kb-toc .toc-h2 a { padding-left: 26px; }
.kb-toc .toc-h3 a { padding-left: 38px; font-size: 0.83rem; color: var(--muted); }

/* ==========================================================================
   6. BARRA LATERAL (ARTIGOS RELACIONADOS)
   ========================================================================== */
.kb-sidebar {
    background: var(--white);
    padding: 22px 20px;
    border-radius: var(--radius);
    height: fit-content;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: sticky;
    top: 100px;
    min-width: 0;
}

.kb-sidebar h3 {
    font-family: var(--font-heading);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 9px;
}

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

.kb-sidebar li {
    margin-bottom: 2px;
    font-size: 0.82rem;
}

.kb-sidebar li a {
    color: var(--ink-soft);
    display: block;
    padding: 6px 0;
    line-height: 1.4;
}

.kb-sidebar li a:hover {
    color: var(--brand);
    text-decoration: none;
}

.kb-sidebar .sidebar-cta {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.kb-sidebar .sidebar-cta a {
    color: var(--brand);
    font-weight: 600;
    font-size: 0.8rem;
}

/* ==========================================================================
   7. SEÇÕES DE LISTAGEM, CATEGORIAS E BUSCA (ARCHIVE.PHP & SEARCH.PHP)
   ========================================================================== */
.category-header, .search-header {
    background: var(--white);
    padding: 45px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.category-header h1, .search-header h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--ink);
}

.category-header p {
    color: var(--muted);
    font-size: 1.02rem;
    margin-top: 8px;
}

.search-header span {
    color: var(--brand);
    font-weight: bold;
}

/* Lista de artigos em linha */
.articles-list, .search-results-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 50px;
}

.article-link-item, .search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 22px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.article-link-item:hover {
    transform: translateX(6px);
    text-decoration: none;
    border-color: var(--brand);
}

.article-link-item span {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink);
}

.arrow {
    color: var(--brand);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Customizações específicas para itens de busca */
.search-item {
    display: block;
}

.search-item h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.search-item p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* Centralização de feedbacks e ausência de resultados */
.no-results {
    text-align: center;
    padding: 60px 0;
}

.no-results h2 {
    font-family: var(--font-heading);
    margin-bottom: 15px;
    color: var(--ink);
}

.no-results input[type="text"],
.no-results input[type="search"] {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
}

/* ==========================================================================
   8. RODAPÉ
   ========================================================================== */
footer.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 30px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 40px;
}

/* ==========================================================================
   9. ADAPTAÇÃO PARA DISPOSITIVOS MÓVEIS (RESPONSIVIDADE)
   ========================================================================== */
@media (max-width: 850px) {
    .kb-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* No mobile o grid vira coluna única — libera os blocos da trava de
       coluna fixa do desktop para eles empilharem normalmente. */
    .kb-layout > .kb-toc,
    .kb-layout > .article-card,
    .kb-layout > .kb-sidebar {
        grid-column: auto;
    }

    .kb-sidebar,
    .kb-toc {
        position: static;
    }

    .kb-toc {
        margin-bottom: 24px;
    }

    .hero-section h1 {
        font-size: 1.7rem;
    }

    .featured-category {
        flex-direction: column;
        text-align: center;
        padding: 28px 24px;
    }

    .featured-category-links {
        padding-left: 0;
        justify-content: center;
    }

    .article-card, .page-wrapper {
        padding: 26px;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .search-bar .kb-search-form {
        width: 100%;
    }

    .support-cta { padding: 28px 20px; }
}