/* ============================================================================
 * grow.css — Design system compartilhado do blueprint `grow`
 * ----------------------------------------------------------------------------
 * Páginas: /desenvolvedores, /calendario-promocoes, /ranking, /historico,
 *          /calculadora-black-friday, /marca, /widgets/preview
 *
 * Princípios:
 *  - Não reinventa o Tailwind do base.html; usa CSS vars e utilitários próprios
 *    só para componentes específicos dessas páginas (evita colisão).
 *  - Tudo com suporte dark mode (html.dark) usando as vars --bdd-* do projeto.
 *  - Sem animações de layout; só transform/opacity com reduced-motion fallback.
 *  - Tipografia com display sizing em clamp() (responsivo sem breakpoint).
 * ========================================================================== */

.grow-wrap {
    --grow-ink: #14110d;
    --grow-ink-2: #4a3f37;
    --grow-muted: #6b5d52;
    --grow-line: #e8e1d7;
    --grow-surface: #ffffff;
    --grow-surface-2: #faf7f2;
    --grow-page: #f5f1eb;
    --grow-brand: #C44A18;
    --grow-brand-ink: #8a2f0a;
    --grow-brand-contrast: #ffffff;
    --grow-accent: #0a8a5f;
    --grow-radius: 14px;
    --grow-radius-sm: 10px;
    --grow-shadow-lift: 0 1px 0 rgba(20, 17, 13, 0.04), 0 8px 24px -12px rgba(20, 17, 13, 0.18);
    --grow-shadow-hover: 0 1px 0 rgba(20, 17, 13, 0.04), 0 16px 36px -16px rgba(20, 17, 13, 0.25);
    font-feature-settings: "ss01", "cv11";
    background: var(--grow-page);
}

html.dark .grow-wrap {
    --grow-ink: #f5f1ec;
    --grow-ink-2: #c4b8ac;
    --grow-muted: #9a8c7c;
    --grow-line: #3a302a;
    --grow-surface: #221c18;
    --grow-surface-2: #2c241f;
    --grow-page: #14110d;
    --grow-brand: #FF8C5A;
    --grow-brand-ink: #FFB088;
    --grow-brand-contrast: #14110d;
    --grow-shadow-lift: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
    --grow-shadow-hover: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 36px -16px rgba(0, 0, 0, 0.6);
}

/* ===== Display heading (hero agressivo mas responsivo) =================== */
.grow-display {
    font-size: clamp(2.25rem, 5vw + 0.5rem, 4rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.035em;
    color: var(--grow-ink);
    text-wrap: balance;
}

.grow-display .accent {
    color: var(--grow-brand);
    font-style: italic;
    font-weight: 900;
}

.grow-lede {
    font-size: clamp(1rem, 0.6vw + 0.9rem, 1.2rem);
    line-height: 1.55;
    color: var(--grow-ink-2);
    max-width: 60ch;
    text-wrap: pretty;
}

/* ===== Section heading sem eyebrow uppercase tracked ===================== */
/* Padrão banido pelo design system: pequeno badge uppercase acima de cada H2.
   Aqui usamos "número grande" como divider visual em vez disso. */
.grow-h2 {
    font-size: clamp(1.5rem, 1.5vw + 1rem, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--grow-ink);
    text-wrap: balance;
    margin: 0;
}

.grow-section-divider {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--grow-line);
}

.grow-section-divider .step-num {
    font-size: clamp(1.75rem, 2vw + 0.8rem, 2.5rem);
    font-weight: 900;
    color: var(--grow-brand);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
    flex-shrink: 0;
}

/* ===== Card primário (substitui grid de cards idênticos) ================= */
.grow-card {
    background: var(--grow-surface);
    border: 1px solid var(--grow-line);
    border-radius: var(--grow-radius);
    padding: 20px;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--grow-shadow-lift);
}

a.grow-card:hover,
.grow-card.is-interactive:hover {
    border-color: var(--grow-brand);
    box-shadow: var(--grow-shadow-hover);
    transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
    .grow-card { transition: border-color 0.1s linear; }
    .grow-card:hover, a.grow-card:hover { transform: none; }
}

/* ===== Hero (com gradient sutil, não saturado) =========================== */
.grow-hero {
    position: relative;
    padding: clamp(48px, 6vw, 96px) 0 clamp(40px, 4vw, 64px);
    overflow: hidden;
}

.grow-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 100% 0%, rgba(255, 107, 53, 0.08), transparent 60%),
        radial-gradient(ellipse 80% 50% at 0% 100%, rgba(10, 138, 95, 0.05), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

html.dark .grow-hero::before {
    background:
        radial-gradient(ellipse 60% 80% at 100% 0%, rgba(255, 140, 90, 0.06), transparent 60%),
        radial-gradient(ellipse 80% 50% at 0% 100%, rgba(10, 138, 95, 0.04), transparent 60%);
}

/* ===== Stat row (substitui grid 4-cols de números gigantes) ============== */
.grow-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    align-items: baseline;
    padding: 20px 0;
    border-top: 1px solid var(--grow-line);
    border-bottom: 1px solid var(--grow-line);
}

.grow-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.grow-stat .num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--grow-ink);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.grow-stat .label {
    font-size: 0.85rem;
    color: var(--grow-muted);
    font-weight: 500;
}

/* ===== Code block (destacado, com header) ================================ */
.grow-code {
    background: #1a1512;
    border-radius: var(--grow-radius);
    overflow: hidden;
    border: 1px solid #2c241f;
}

.grow-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #221c18;
    border-bottom: 1px solid #2c241f;
    font-size: 0.75rem;
    color: #9a8c7c;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.grow-code-header button {
    background: transparent;
    border: 1px solid #3a302a;
    color: #c4b8ac;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.15s;
}
.grow-code-header button:hover { background: #2c241f; color: #f5f1ec; }

.grow-code pre {
    margin: 0;
    padding: 18px 20px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #f5f1ec;
    overflow-x: auto;
}

.grow-code pre code { background: transparent; padding: 0; color: inherit; }
.grow-code .tok-key { color: #ffb088; }
.grow-code .tok-str { color: #b6e3a8; }
.grow-code .tok-com { color: #6b5d52; font-style: italic; }

/* Atalho pra blocos de código soltos (sem header) — widget_preview */
.grow-code-block {
    background: #1a1512;
    border: 1px solid #2c241f;
    border-radius: var(--grow-radius);
    padding: 18px 20px;
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #f5f1ec;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ===== Pill / Badge (único estilo, não 5 variações) ===================== */
.grow-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--grow-surface-2);
    border: 1px solid var(--grow-line);
    color: var(--grow-ink-2);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.grow-pill.is-brand {
    background: rgba(196, 74, 24, 0.12);
    border-color: rgba(196, 74, 24, 0.35);
    color: var(--grow-brand-ink);
}

html.dark .grow-pill.is-brand {
    background: rgba(255, 140, 90, 0.14);
    border-color: rgba(255, 140, 90, 0.35);
    color: var(--grow-brand);
}

/* ===== Button ============================================================ */
.grow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.2;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
}

.grow-btn-primary {
    background: var(--grow-brand);
    color: var(--grow-brand-contrast);
    box-shadow: 0 1px 0 rgba(20, 17, 13, 0.08), 0 4px 12px -4px rgba(196, 74, 24, 0.4);
}
.grow-btn-primary:hover {
    background: var(--grow-brand-ink);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(20, 17, 13, 0.08), 0 8px 20px -6px rgba(196, 74, 24, 0.5);
}
.grow-btn-primary:active { transform: translateY(0); }

.grow-btn-ghost {
    background: var(--grow-surface);
    color: var(--grow-ink);
    border-color: var(--grow-line);
}
.grow-btn-ghost:hover { border-color: var(--grow-brand); color: var(--grow-brand-ink); }

html.dark .grow-btn-ghost { background: var(--grow-surface); color: var(--grow-ink); }

@media (prefers-reduced-motion: reduce) {
    .grow-btn { transition: background 0.1s linear; }
    .grow-btn:hover { transform: none; }
}

/* ===== Timeline (calendário sazonal) ===================================== */
.grow-timeline {
    position: relative;
    padding-left: 32px;
}

.grow-timeline::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--grow-brand) 0%, var(--grow-line) 50%);
}

.grow-timeline-item {
    position: relative;
    padding: 18px 22px;
    margin-left: 0;
    cursor: pointer;
    border-radius: var(--grow-radius-sm);
    transition: background 0.2s ease, transform 0.2s ease;
}

.grow-timeline-item + .grow-timeline-item { margin-top: 4px; }

.grow-timeline-item::before {
    content: "";
    position: absolute;
    left: -28px;
    top: 28px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--grow-surface);
    border: 2px solid var(--grow-line);
    box-shadow: 0 0 0 4px var(--grow-page);
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.grow-timeline-item.is-next::before {
    border-color: var(--grow-brand);
    background: var(--grow-brand);
    box-shadow: 0 0 0 4px var(--grow-page), 0 0 0 7px rgba(196, 74, 24, 0.18);
}

.grow-timeline-item.is-past { opacity: 0.5; }
.grow-timeline-item.is-past::before { background: var(--grow-line); }

.grow-timeline-item:not(.is-past):hover {
    background: var(--grow-surface);
    transform: translateX(4px);
}

.grow-timeline-item:not(.is-past):hover::before { transform: scale(1.2); }
.grow-timeline-item.is-next:hover::before {
    box-shadow: 0 0 0 4px var(--grow-page), 0 0 0 9px rgba(196, 74, 24, 0.22);
}

/* ===== Podium (top 3 ranking) ============================================ */
.grow-podium {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    align-items: end;
    margin-bottom: 28px;
}

.grow-podium-item {
    background: var(--grow-surface);
    border: 1px solid var(--grow-line);
    border-radius: var(--grow-radius);
    padding: 18px 14px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.grow-podium-item:hover { transform: translateY(-3px); box-shadow: var(--grow-shadow-hover); }

.grow-podium-item .position {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--grow-muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
    margin-bottom: 6px;
}

.grow-podium-item.is-1 { padding-top: 28px; padding-bottom: 28px; border-color: var(--grow-brand); }
.grow-podium-item.is-1 .position { color: var(--grow-brand); font-size: 3.5rem; }
.grow-podium-item.is-2 { padding-top: 22px; padding-bottom: 22px; }
.grow-podium-item.is-2 .position { font-size: 3rem; }

@media (max-width: 640px) {
    .grow-podium { grid-template-columns: 1fr; }
    .grow-podium-item.is-1 { order: 1; }
    .grow-podium-item.is-2 { order: 2; }
    .grow-podium-item.is-3 { order: 3; }
}

/* ===== Numbered list (ranking detalhe) =================================== */
.grow-num-list { list-style: none; padding: 0; margin: 0; }

.grow-num-list-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border-bottom: 1px solid var(--grow-line);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.grow-num-list-item:first-child { border-top: 1px solid var(--grow-line); }
.grow-num-list-item:hover { background: var(--grow-surface-2); }

.grow-num-list-item .position {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--grow-muted);
    width: 36px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    flex-shrink: 0;
}

.grow-num-list-item.is-top .position { color: var(--grow-brand); }

/* ===== Chart container (histórico) ======================================= */
.grow-chart-wrap {
    background: var(--grow-surface);
    border: 1px solid var(--grow-line);
    border-radius: var(--grow-radius);
    padding: 24px;
    box-shadow: var(--grow-shadow-lift);
}

.grow-chart {
    width: 100%;
    height: 280px;
    color: var(--grow-ink-2);
}

/* ===== Form (calculadora BF) ============================================= */
.grow-form-field {
    display: block;
    margin-bottom: 18px;
}

.grow-form-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--grow-ink);
    margin-bottom: 6px;
}

.grow-form-field .hint {
    display: block;
    font-size: 0.78rem;
    color: var(--grow-muted);
    font-weight: 400;
    margin-top: 4px;
}

.grow-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--grow-surface);
    border: 1.5px solid var(--grow-line);
    border-radius: var(--grow-radius-sm);
    color: var(--grow-ink);
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.grow-input:focus {
    outline: none;
    border-color: var(--grow-brand);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.grow-input-wrap {
    position: relative;
}

.grow-input-wrap .prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grow-muted);
    font-weight: 700;
    pointer-events: none;
}

/* ===== Result card (calculadora BF) ====================================== */
.grow-result {
    margin-top: 28px;
    padding: 28px;
    border-radius: var(--grow-radius);
    border-left: 4px solid var(--grow-line);
    background: var(--grow-surface-2);
}

.grow-result.is-good {
    border-left-color: #16a34a;
    background: rgba(22, 163, 74, 0.06);
}

.grow-result.is-warn {
    border-left-color: #d97706;
    background: rgba(217, 119, 6, 0.06);
}

.grow-result.is-bad {
    border-left-color: #dc2626;
    background: rgba(220, 38, 38, 0.06);
}

.grow-result.is-neutral {
    border-left-color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
}

html.dark .grow-result.is-good { background: rgba(22, 163, 74, 0.1); }
html.dark .grow-result.is-warn { background: rgba(217, 119, 6, 0.1); }
html.dark .grow-result.is-bad { background: rgba(220, 38, 38, 0.1); }
html.dark .grow-result.is-neutral { background: rgba(37, 99, 235, 0.1); }

/* ===== Marquee de countdown (calendário detalhe) ======================== */
.grow-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2vw, 24px);
    padding: 24px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border-radius: var(--grow-radius);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: inherit;
}

.grow-countdown-cell {
    text-align: center;
    min-width: 60px;
}

.grow-countdown-cell .num {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
    display: block;
}

.grow-countdown-cell .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
}

/* ===== Brand card (marca hub) ============================================ */
/* Card que funciona como mini-banner: cor da marca em cima, conteúdo em baixo.
   Mais expressivo que o card genérico. */
.grow-brand-card {
    display: block;
    background: var(--grow-surface);
    border: 1px solid var(--grow-line);
    border-radius: var(--grow-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--grow-shadow-lift);
}

.grow-brand-card:hover {
    border-color: var(--brand-color, var(--grow-brand));
    box-shadow: var(--grow-shadow-hover);
    transform: translateY(-3px);
}

.grow-brand-card-banner {
    height: 96px;
    background: var(--brand-color, var(--grow-brand));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.grow-brand-card-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 50%, rgba(255,255,255,0.18), transparent 60%),
        radial-gradient(circle at 80% 30%, rgba(255,255,255,0.1), transparent 50%);
}

.grow-brand-card-banner .icon-wrap {
    position: relative;
    z-index: 1;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.75rem;
}

.grow-brand-card-body { padding: 18px 20px; }

/* ===== Aside / callout ================================================== */
.grow-aside {
    padding: 20px 24px;
    background: var(--grow-surface-2);
    border-radius: var(--grow-radius);
    border: 1px solid var(--grow-line);
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--grow-ink-2);
}

/* ===== Product card (marca detalhe, calendário detalhe) ================== */
/* Cards de produto com imagem precisam de tratamento diferente: padding menor,
   imagem em flush top, conteúdo com padding próprio. */
.grow-product-card {
    display: block;
    background: var(--grow-surface);
    border: 1px solid var(--grow-line);
    border-radius: var(--grow-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--grow-shadow-lift);
}

.grow-product-card:hover {
    border-color: var(--grow-brand);
    box-shadow: var(--grow-shadow-hover);
    transform: translateY(-3px);
}

.grow-product-card .img-wrap {
    aspect-ratio: 4 / 3;
    background: var(--grow-surface-2);
    overflow: hidden;
}

.grow-product-card .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.grow-product-card:hover .img-wrap img { transform: scale(1.04); }

.grow-product-card .body {
    padding: 16px 18px 18px;
}

.grow-product-card .title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--grow-ink);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

.grow-product-card .price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.grow-product-card .price-orig {
    font-size: 0.75rem;
    text-decoration: line-through;
    color: var(--grow-muted);
}

.grow-product-card .price-now {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--grow-ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.grow-product-card .price-off {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(196, 74, 24, 0.12);
    color: var(--grow-brand-ink);
}

html.dark .grow-product-card .price-off {
    background: rgba(255, 140, 90, 0.18);
    color: var(--grow-brand);
}

/* ===== Hero detalhe com cor própria (calendário detalhe) ================= */
/* Quando o .grow-hero tem cor própria (BF preto, Mães rosa), não carrega o
   gradient decorativo padrão. Recebe padding extra no topo. */
.grow-hero.is-colored {
    color: #ffffff;
}
.grow-hero.is-colored::before { display: none; }
.grow-hero.is-colored a:not(.grow-btn) {
    color: rgba(255, 255, 255, 0.78);
    transition: color 0.15s;
}
.grow-hero.is-colored a:not(.grow-btn):hover { color: #ffffff; }
.grow-hero.is-colored h1 { color: #ffffff; }

/* ===== Utilities ======================================================== */
.grow-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 32px);
}

.grow-container-narrow {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 32px);
}

.grow-stack > * + * { margin-top: 16px; }
.grow-stack-lg > * + * { margin-top: 28px; }

.grow-divider {
    height: 1px;
    background: var(--grow-line);
    margin: 40px 0;
    border: none;
}

/* Reduced motion: corta todas as transições em 0.1s */
@media (prefers-reduced-motion: reduce) {
    .grow-wrap *,
    .grow-wrap *::before,
    .grow-wrap *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
