/*
 * V8 BASE — Fastyshop V8 Design System (primitivas universais)
 * ------------------------------------------------------------------
 * REGRA NUCLEAR: este arquivo é CONGELADO e COMPARTILHADO por todas
 * as áreas do módulo 2.8. Contém APENAS tokens, reset e primitivas
 * (botões, cards, inputs, tipografia, layout).
 *
 * O QUE NUNCA PODE FICAR AQUI:
 *  - rupturas guilhotina anti-tema (fica em area-*.css, por área);
 *  - regras com !important (fica em area-*.css);
 *  - escopos de determinada página (fica em area-*.css);
 *  - overrides de classes do WooCommerce/Razzi (fica em area-*.css);
 *  - componentes sobrepostos a outro (fica na área correta).
 *
 * Erra: um bug aqui afeta TODAS as áreas — por isso só entra o que
 * já está comprovado no 2.7 Super Checkout em produção.
 */

:root {
    --brand: #000000;
    --success: #10B981;
    --success-dark: #059669;
    --bg: #F3F4F6;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --danger: #DC2626;
    --star: #F59E0B;
}

/* ------------------------------------------------------------------ */
/* RESET                                                               */
/* ------------------------------------------------------------------ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body.v8sf-ready {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--bg);
    color: var(--text-main);
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ------------------------------------------------------------------ */
/* ESTRUTURA                                                           */
/* ------------------------------------------------------------------ */
.v8sf-container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 10px;
}
.v8sf-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.v8sf-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* ------------------------------------------------------------------ */
/* CARTÕES                                                             */
/* ------------------------------------------------------------------ */
.v8sf-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}
.v8sf-card-inner {
    padding: 18px 12px 12px;
}
.v8sf-card.is-success {
    border-color: var(--success);
    box-shadow: 0 4px 25px rgba(16, 185, 129, 0.1);
}
.v8sf-card.is-success .v8sf-step-num {
    background: var(--success);
    color: #fff;
}

/* ------------------------------------------------------------------ */
/* CABEÇALHO DE PASSO                                                  */
/* ------------------------------------------------------------------ */
.v8sf-step-header {
    display: flex;
    align-items: center;
    gap: 6px;
}
.v8sf-step-num {
    width: 28px;
    height: 28px;
    background: var(--brand);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}
.v8sf-step-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
    margin-left: 3px;
}

/* ------------------------------------------------------------------ */
/* FORMULÁRIOS — FLOATING LABELS                                       */
/* ------------------------------------------------------------------ */
.v8sf-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.v8sf-form-row {
    margin-bottom: 16px;
}
.v8sf-floating {
    position: relative;
    width: 100%;
}
.v8sf-floating input,
.v8sf-floating select {
    width: 100%;
    height: 54px;
    padding: 16px 28px 0 10px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    background-color: #FAFAFA;
    outline: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.v8sf-floating input:focus,
.v8sf-floating select:focus {
    height: 64px;
    padding-top: 24px;
    padding-bottom: 8px;
    border-color: var(--success);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}
.v8sf-floating label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-transform: capitalize;
}
.v8sf-floating input:focus ~ label,
.v8sf-floating input:not(:placeholder-shown) ~ label,
.v8sf-floating select:focus ~ label {
    top: 12px;
    transform: translateY(0);
    font-size: 11px;
    font-weight: 700;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.v8sf-floating input::placeholder { color: transparent; }
.v8sf-floating select { cursor: pointer; }
.v8sf-floating select.has-value ~ label,
.v8sf-floating select:focus ~ label,
.v8sf-floating select:valid ~ label { top: 12px; transform: translateY(0); font-size: 11px; font-weight: 700; color: var(--success); text-transform: uppercase; letter-spacing: 0.3px; }

/* estados valid/erro */
.v8sf-floating .v8sf-check-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
}
.v8sf-floating input.is-valid ~ .v8sf-check-icon,
.v8sf-floating select.is-valid ~ .v8sf-check-icon { display: flex; }
.v8sf-floating input.has-error,
.v8sf-floating select.has-error { border-color: var(--danger) !important; }
.v8sf-floating input.has-error ~ label,
.v8sf-floating select.has-error ~ label { color: var(--danger) !important; }

/* ------------------------------------------------------------------
 * BOTÕES
 * ------------------------------------------------------------------ */
.v8sf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 30px;
    border: none;
    border-radius: 14px;
    background: var(--success);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.1px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.v8sf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -5px rgba(16, 185, 129, 0.5);
}
.v8sf-btn:active { transform: translateY(0) scale(0.98); }
.v8sf-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.v8sf-btn-block { width: 100%; }
.v8sf-btn-dark { background: var(--brand); }
.v8sf-btn-dark:hover { box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.5); }
.v8sf-btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1.5px solid var(--border);
}
.v8sf-btn-outline:hover {
    border-color: var(--text-main);
    box-shadow: none;
    transform: translateY(-1px);
    background: #FAFAFA;
}
.v8sf-btn-ghost {
    background: transparent;
    color: var(--text-main);
    padding: 10px 14px;
}
.v8sf-btn-ghost:hover { background: #F3F4F6; box-shadow: none; transform: none; }
.v8sf-btn-sm { padding: 10px 16px; font-size: 13.5px; border-radius: 10px; }

/* ------------------------------------------------------------------
   RADIO CARDS
 * ------------------------------------------------------------------ */
.v8sf-radio-group { display: flex; flex-direction: column; gap: 12px; }
.v8sf-radio-card {
    display: flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    background: #FFF;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.v8sf-radio-card:hover { border-color: #D1D5DB; }
.v8sf-radio-card.active { border-color: var(--success); }
.v8sf-radio-card input[type="radio"] {
    accent-color: var(--success);
    width: 22px;
    height: 22px;
    margin-right: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
.v8sf-radio-text { flex: 1; display: flex; justify-content: space-between; align-items: center; }
.v8sf-radio-title { font-weight: 700; font-size: 15px; color: var(--text-main); }
.v8sf-radio-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.v8sf-radio-price { font-weight: 800; font-size: 15px; color: var(--success); }

/* ------------------------------------------------------------------
- TOTAIS
 * ------------------------------------------------------------------ */
.v8sf-total-box { padding-top: 8px; }
.v8sf-total-label { font-size: 14px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.v8sf-total-value { font-size: 28px; font-weight: 900; color: var(--brand); letter-spacing: -1px; }

/* ------------------------------------------------------------------
- ITENS DE CARRINHO (primitiva visual genérica)
 * ------------------------------------------------------------------ */
.v8sf-cart-item { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px dashed var(--border); margin-bottom: 20px; }
.v8sf-cart-img { width: 72px; height: 72px; border-radius: 12px; border: 1px solid var(--border); object-fit: cover; }
.v8sf-cart-info { flex: 1; }
.v8sf-cart-title { font-size: 16px; font-weight: 700; color: var(--text-main); }
.v8sf-cart-price { font-size: 16px; font-weight: 800; color: var(--text-main); margin-top: 4px; }
.v8sf-cart-check { display: flex; align-items: center; gap: 4px; color: var(--success); font-size: 13px; font-weight: 700; margin-top: 6px; }

/* ------------------------------------------------------------------
- PROVA SOCIAL
 * ------------------------------------------------------------------ */
.v8sf-social-proof {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
}
.v8sf-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid #fff; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.v8sf-social-content { flex: 1; }
.v8sf-social-name { font-size: 14px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; color: var(--text-main); }
.v8sf-social-time { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.v8sf-stars { color: var(--star); margin: 4px 0; display: flex; gap: 2px; }
.v8sf-social-text { font-size: 14px; font-weight: 500; color: var(--text-muted); font-style: italic; line-height: 1.5; }

/* ------------------------------------------------------------------
- SELOS DE CONFIANÇA
 * ------------------------------------------------------------------ */
.v8sf-trust-footer { background: #F9FAFB; padding: 20px 24px; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.v8sf-trust-item { display: flex; align-items: center; gap: 10px; text-align: left; }
.v8sf-trust-icon { width: 40px; height: 40px; background: #FFFFFF; border: 1px solid var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #0F172A; box-shadow: 0 2px 4px rgba(0,0,0,0.02); flex-shrink: 0; }
.v8sf-trust-title { font-size: 12.5px; font-weight: 800; color: #0F172A; line-height: 1.2; }
.v8sf-trust-desc { font-size: 11px; color: #64748B; font-weight: 500; line-height: 1.2; }

/* ------------------------------------------------------------------
- CUPOM
 * ------------------------------------------------------------------ */
.v8sf-coupon-box { display: flex; gap: 10px; }
.v8sf-coupon-box input { flex: 1; padding: 16px; border: 1.5px solid var(--border); border-radius: 10px; font-weight: 600; font-size: 14px; outline: none; }
.v8sf-coupon-box input:focus { border-color: var(--success); }
.v8sf-coupon-box button { background: var(--brand); color: #fff; padding: 0 20px; border-radius: 10px; font-weight: 700; cursor: pointer; border: none; }
.v8sf-offer-box { background: rgba(16, 185, 129, 0.1); border: 1.5px dashed var(--success); padding: 16px; border-radius: 12px; color: var(--success-dark); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------------
- UTILITÁRIOS
 * ------------------------------------------------------------------ */
.v8sf-b-8 { gap: 12px; margin-top: 12px; }
.v8sf-made-in-brazil { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 700; color: #9CA3AF; margin-top: 24px; text-transform: uppercase; letter-spacing: 1px; }
.v8sf-pay-icons { display: flex; gap: 6px; }
.v8sf-pay-icons svg { height: 24px; border-radius: 4px; border: 1px solid var(--border); padding: 2px; background: #fff; }

/* ------------------------------------------------------------------
- TOST AUTOMÁTICO
 * ------------------------------------------------------------------ */
.v8sf-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 80px);
    background: var(--success);
    color: #fff;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
}
.v8sf-toast.show { transform: translate(-50%, 0); opacity: 1; }
.v8sf-toast.is-error { background: var(--danger); }

/* ----------------------------------------------------------------------
- RESPONSIVO (primitivas)
 * ---------------------------------------------------------------------- */
@media (max-width: 768px) {
    .v8sf-form-grid-2 { grid-template-columns: 1fr; }
    .v8sf-total-value { font-size: 24px; }
    .v8sf-btn { width: 100%; }
    .v8sf-trust-footer { display: flex; overflow-x: auto; padding: 14px; grid-template-columns: none; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .v8sf-trust-footer::-webkit-scrollbar { display: none; }
    .v8sf-trust-item { flex: 0 0 auto; min-width: 150px; }
    .v8sf-trust-icon { width: 34px; height: 34px; }
    .v8sf-trust-desc { font-size: 10.5px; }
}

/* Botão "voltar ao topo" do tema Razzi (#gotop) — oculto globalmente.
   O Razzi o renderiza server-side (razzi_after_close_site_footer), fora da
   troca do 2.8, e a guilhotina só corta assets, não o markup. */
#gotop { display: none !important; }
