/* =========================================================================
   ACTA ROBOTICS — camada de componentes da loja
   Complementa o Tailwind. Tokens em :root para uso fora das classes utilitárias.
   ========================================================================= */

:root {
    --acta-primary: #ff5a00;
    --acta-primary-dark: #e04d00;
    --acta-primary-soft: #fff1e8;
    --acta-secondary: #0284c7;
    --acta-success: #047857;
    --acta-ink: #0f172a;
    --acta-ink-soft: #475569;
    --acta-ink-mute: #64748b;
    --acta-line: #e2e8f0;
    --acta-surface: #ffffff;
    --acta-bg: #f4f6f9;
    --acta-radius: 12px;
    --acta-radius-sm: 8px;
    --acta-shell: 1320px;
    --acta-header-h: 132px;
    /* Altura do cabeçalho no mobile (sem a barra de categorias) */
    --acta-header-h-mobile: 116px;
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
    background: var(--acta-bg);
    color: var(--acta-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    user-select: none;
}
.material-symbols-outlined.filled { font-variation-settings: 'FILL' 1; }

/* --- Anti-FOUC -----------------------------------------------------------
   O Tailwind via CDN só pinta depois de rodar o JS. Escondemos o corpo por no
   máximo 700ms para evitar o "flash" de página sem estilo. Se o JS falhar, o
   fallback do <noscript> e o timeout garantem que o conteúdo sempre apareça. */
html.acta-booting body { opacity: 0; }
body { opacity: 1; transition: opacity .18s ease-out; }

.acta-shell {
    width: 100%;
    max-width: var(--acta-shell);
    margin-inline: auto;
    padding-inline: 16px;
}
@media (min-width: 768px) { .acta-shell { padding-inline: 24px; } }

/* =========================================================================
   Tipografia
   ========================================================================= */
.acta-h1 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.acta-h2 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; }
.acta-eyebrow {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase;
    color: var(--acta-primary);
}

/* =========================================================================
   Botões
   ========================================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700; font-size: 14px; line-height: 1;
    padding: 13px 22px; border-radius: var(--acta-radius-sm);
    border: 1px solid transparent; cursor: pointer;
    transition: background-color .18s, border-color .18s, color .18s, box-shadow .18s, transform .12s;
    text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--acta-secondary); outline-offset: 2px; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn--primary { background: var(--acta-primary); color: #fff; box-shadow: 0 1px 2px rgba(224,77,0,.25); }
.btn--primary:hover { background: var(--acta-primary-dark); box-shadow: 0 6px 18px rgba(224,77,0,.28); }

.btn--dark { background: var(--acta-ink); color: #fff; }
.btn--dark:hover { background: #1e293b; }

.btn--outline { background: #fff; color: var(--acta-ink); border-color: var(--acta-line); }
.btn--outline:hover { border-color: var(--acta-ink-mute); background: #f8fafc; }

.btn--ghost-light { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.35); backdrop-filter: blur(6px); }
.btn--ghost-light:hover { background: #fff; color: var(--acta-ink); }

.btn--lg { padding: 16px 28px; font-size: 15px; }
.btn--block { width: 100%; }

/* =========================================================================
   Cartão de produto — padrão de e-commerce
   ========================================================================= */
.pcard {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--acta-surface);
    border: 1px solid var(--acta-line);
    border-radius: var(--acta-radius);
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s, transform .18s;
    height: 100%;
}
.pcard:hover {
    border-color: var(--acta-line-strong, #cbd5e1);
    box-shadow: 0 10px 30px rgba(15,23,42,.10), 0 2px 6px rgba(15,23,42,.06);
    transform: translateY(-3px);
}

.pcard__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    padding: 18px;
    border-bottom: 1px solid #f1f5f9;
    overflow: hidden;
}
.pcard__media img {
    width: 100%; height: 100%;
    object-fit: contain;
    transition: transform .45s cubic-bezier(.16,1,.3,1);
}
.pcard:hover .pcard__media img { transform: scale(1.05); }

.pcard__body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 16px; gap: 6px; }

.pcard__brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--acta-ink-mute);
}
.pcard__title {
    font-family: 'Inter', sans-serif;
    font-size: 14px; font-weight: 500; line-height: 1.4;
    color: var(--acta-ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 2.8em;
}
.pcard:hover .pcard__title { color: var(--acta-primary); }

.pcard__pricing { margin-top: auto; padding-top: 10px; }
.pcard__foot { padding: 0 16px 16px; }

/* Selos sobre a imagem */
.pcard__flags { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }

.flag {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    padding: 4px 8px; border-radius: 999px; line-height: 1;
}
.flag--brand   { background: var(--acta-primary); color: #fff; }
.flag--info    { background: var(--acta-secondary); color: #fff; }
.flag--neutral { background: #f1f5f9; color: var(--acta-ink-soft); border: 1px solid var(--acta-line); }
.flag--success { background: var(--acta-success); color: #fff; }

/* =========================================================================
   Bloco de preço
   ========================================================================= */
.price__from { font-size: 11px; color: var(--acta-ink-mute); display: block; margin-bottom: 1px; }
.price__main {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px; font-weight: 700; color: var(--acta-ink);
    letter-spacing: -.02em; line-height: 1.1;
}
.price__main--lg { font-size: 34px; }
.price__installment { font-size: 12px; color: var(--acta-ink-soft); margin-top: 3px; }
.price__installment strong { color: var(--acta-ink); font-weight: 600; }

/* =========================================================================
   Imagem ausente — placeholder da marca (substitui a caixa cinza genérica)
   ========================================================================= */
.img-missing {
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px;
    background:
        linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    color: #94a3b8;
    border-radius: var(--acta-radius-sm);
    text-align: center; padding: 12px;
}
.img-missing .material-symbols-outlined { font-size: 34px; opacity: .55; }
.img-missing span.label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}

/* =========================================================================
   Cabeçalho
   ========================================================================= */
.acta-header { background: #fff; border-bottom: 1px solid var(--acta-line); }
.acta-header__top { background: var(--acta-ink); color: #cbd5e1; font-size: 12px; }
.acta-header__top a { color: #e2e8f0; text-decoration: none; }
.acta-header__top a:hover { color: #fff; }

.navlink {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--acta-ink-soft); text-decoration: none;
    padding: 12px 0; position: relative; white-space: nowrap;
    transition: color .16s;
}
.navlink:hover { color: var(--acta-primary); }
.navlink::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0;
    height: 2px; background: var(--acta-primary);
    transform: scaleX(0); transition: transform .18s;
}
.navlink:hover::after, .navlink.is-active::after { transform: scaleX(1); }
.navlink.is-active { color: var(--acta-primary); }

.search-field {
    width: 100%;
    padding: 11px 14px 11px 42px;
    border: 1px solid var(--acta-line);
    border-radius: var(--acta-radius-sm);
    background: #f8fafc; font-size: 14px; color: var(--acta-ink);
    transition: border-color .16s, background .16s, box-shadow .16s;
}
.search-field::placeholder { color: #94a3b8; }
.search-field:focus {
    outline: none; background: #fff;
    border-color: var(--acta-secondary);
    box-shadow: 0 0 0 3px rgba(2,132,199,.12);
}

.cart-badge {
    position: absolute; top: -6px; right: -8px;
    min-width: 19px; height: 19px; padding: 0 5px;
    background: var(--acta-primary); color: #fff;
    font-size: 11px; font-weight: 700; font-family: 'Space Grotesk', sans-serif;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
    transition: transform .18s;
}
.cart-badge[hidden] { display: none; }
.cart-badge.pulse { transform: scale(1.25); }

/* =========================================================================
   Barra de confiança
   ========================================================================= */
.trustbar { background: #fff; border-block: 1px solid var(--acta-line); }
.trust-item { display: flex; align-items: center; gap: 12px; padding: 18px 8px; }
.trust-item .material-symbols-outlined { color: var(--acta-primary); font-size: 26px; }
.trust-item strong { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 13px; color: var(--acta-ink); line-height: 1.25; }
.trust-item span.sub { font-size: 12px; color: var(--acta-ink-mute); }

/* =========================================================================
   Filtros do catálogo
   ========================================================================= */
.filter-group + .filter-group { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--acta-line); }
.filter-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--acta-ink); margin-bottom: 12px;
}
.filter-link {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 10px; border-radius: var(--acta-radius-sm);
    font-size: 14px; color: var(--acta-ink-soft); text-decoration: none;
    transition: background .14s, color .14s; cursor: pointer;
    border: 1px solid transparent; width: 100%; text-align: left; background: none;
}
.filter-link:hover { background: #f1f5f9; color: var(--acta-ink); }
.filter-link.is-active { background: var(--acta-primary-soft); color: var(--acta-primary-dark); border-color: rgba(255,90,0,.25); font-weight: 600; }
.filter-link .count { font-size: 12px; color: var(--acta-ink-mute); }
.filter-link.is-active .count { color: var(--acta-primary-dark); }

/* Chips horizontais (mobile) */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--acta-line); background: #fff;
    font-size: 13px; color: var(--acta-ink-soft); text-decoration: none; white-space: nowrap;
    cursor: pointer; transition: all .14s;
}
.chip:hover { border-color: var(--acta-ink-mute); }
.chip.is-active { background: var(--acta-ink); color: #fff; border-color: var(--acta-ink); }

.select-field {
    padding: 10px 34px 10px 12px;
    border: 1px solid var(--acta-line); border-radius: var(--acta-radius-sm);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    font-size: 14px; color: var(--acta-ink);
    appearance: none; -webkit-appearance: none; cursor: pointer;
}
.select-field:focus { outline: none; border-color: var(--acta-secondary); box-shadow: 0 0 0 3px rgba(2,132,199,.12); }

/* =========================================================================
   Página de produto
   ========================================================================= */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--acta-ink-mute); }
.breadcrumb a { color: var(--acta-ink-mute); text-decoration: none; }
.breadcrumb a:hover { color: var(--acta-primary); text-decoration: underline; }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .current { color: var(--acta-ink); font-weight: 500; }

.gallery-main {
    aspect-ratio: 1 / 1; background: #fff;
    border: 1px solid var(--acta-line); border-radius: var(--acta-radius);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative; padding: 24px;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }

.thumb {
    width: 72px; height: 72px; flex: 0 0 auto;
    border: 1px solid var(--acta-line); border-radius: var(--acta-radius-sm);
    background: #fff; padding: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .16s, box-shadow .16s;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb:hover { border-color: var(--acta-ink-mute); }
.thumb.is-active { border-color: var(--acta-primary); box-shadow: 0 0 0 2px rgba(255,90,0,.18); }

/* Seletor de variante */
.opt-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--acta-ink-soft); margin-bottom: 8px; display: block;
}
.opt-btn {
    padding: 10px 14px; border-radius: var(--acta-radius-sm);
    border: 1px solid var(--acta-line); background: #fff;
    font-size: 13px; color: var(--acta-ink-soft); cursor: pointer;
    transition: all .14s; text-align: left; line-height: 1.3;
}
.opt-btn:hover { border-color: var(--acta-ink-mute); background: #f8fafc; }
.opt-btn.is-active {
    border-color: var(--acta-primary); background: var(--acta-primary-soft);
    color: var(--acta-primary-dark); font-weight: 600;
    box-shadow: 0 0 0 1px var(--acta-primary) inset;
}

.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table th, .spec-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--acta-line); }
.spec-table th { width: 40%; font-weight: 500; color: var(--acta-ink-mute); background: #f8fafc; }
.spec-table td { color: var(--acta-ink); }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

/* Barra de compra fixa no mobile */
.buybar-mobile {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: #fff; border-top: 1px solid var(--acta-line);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 -4px 16px rgba(15,23,42,.08);
}
@media (min-width: 1024px) { .buybar-mobile { display: none; } }

/* =========================================================================
   Carrinho
   ========================================================================= */
.qty {
    display: inline-flex; align-items: center;
    border: 1px solid var(--acta-line); border-radius: var(--acta-radius-sm);
    overflow: hidden; background: #fff;
}
.qty button {
    width: 34px; height: 36px; background: #fff; border: 0; cursor: pointer;
    color: var(--acta-ink-soft); display: flex; align-items: center; justify-content: center;
    transition: background .14s;
}
.qty button:hover { background: #f1f5f9; color: var(--acta-ink); }
.qty button[disabled] { opacity: .35; cursor: not-allowed; }
.qty output {
    min-width: 38px; text-align: center; font-size: 14px; font-weight: 600;
    border-inline: 1px solid var(--acta-line); line-height: 36px;
}

/* =========================================================================
   Rodapé
   ========================================================================= */
.acta-footer { background: var(--acta-ink); color: #94a3b8; }
.acta-footer h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: #fff; margin-bottom: 16px;
}
.acta-footer a { color: #94a3b8; text-decoration: none; transition: color .14s; }
.acta-footer a:hover { color: #fff; }
.acta-footer__legal { border-top: 1px solid rgba(255,255,255,.10); color: #64748b; font-size: 12px; }

.social-btn {
    width: 38px; height: 38px; border-radius: var(--acta-radius-sm);
    border: 1px solid rgba(255,255,255,.16);
    display: flex; align-items: center; justify-content: center;
    color: #cbd5e1; transition: all .16s;
}
.social-btn:hover { background: #fff; color: var(--acta-ink); border-color: #fff; }
.social-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* Bandeiras de pagamento */
.paytag {
    height: 30px; padding: 0 10px;
    background: #fff; border-radius: 5px;
    display: inline-flex; align-items: center; gap: 5px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px; font-weight: 700; color: #334155; letter-spacing: .02em;
}
.paytag svg { width: 14px; height: 14px; }

/* =========================================================================
   Utilidades
   ========================================================================= */
.skeleton {
    background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 50%, #eef2f7 75%);
    background-size: 200% 100%;
    animation: acta-skeleton 1.4s infinite linear;
    border-radius: var(--acta-radius-sm);
}
@keyframes acta-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.acta-toast {
    position: fixed; z-index: 60;
    left: 16px; right: 16px; bottom: 16px;
    background: var(--acta-ink); color: #fff;
    border-radius: var(--acta-radius); padding: 14px 18px;
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 12px 32px rgba(15,23,42,.24);
    transform: translateY(140%); opacity: 0;
    transition: transform .32s cubic-bezier(.16,1,.3,1), opacity .32s;
    font-size: 14px;
}
.acta-toast.is-visible { transform: translateY(0); opacity: 1; }
.acta-toast .material-symbols-outlined { color: #4ade80; }
@media (min-width: 640px) { .acta-toast { left: auto; right: 24px; bottom: 24px; max-width: 380px; } }

/* Botão flutuante de WhatsApp */
.wa-fab {
    position: fixed; right: 18px; bottom: 18px; z-index: 44;
    width: 54px; height: 54px; border-radius: 50%;
    background: #25d366; color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(37,211,102,.38);
    transition: transform .18s, box-shadow .18s;
}
.wa-fab:hover { transform: scale(1.07); box-shadow: 0 12px 30px rgba(37,211,102,.48); }
.wa-fab svg { width: 28px; height: 28px; fill: currentColor; }
/* Sai da frente da barra de compra fixa no mobile */
body.has-buybar .wa-fab { bottom: 84px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
