/* ── Tokens ──────────────────────────────────────────────────────────── */
:root {
  --bg:            #ffffff;
  --bg-soft:       #f5f6f8;
  --surface:       #ffffff;
  --border:        #e7e8ee;
  --border-strong: #d6d8e0;
  --ink:           #14161d;
  --ink-soft:      #565d6b;
  --ink-faint:     #8b909c;
  --accent:        #1f4ed8;
  --accent-strong: #1538a8;
  --accent-soft:   #eef2ff;
  --accent-contrast:#ffffff;
  --ok:            #15803d;
  --danger:        #b91c1c;
  --radius:        14px;
  --radius-sm:     9px;
  --radius-pill:   999px;
  --shadow-sm:     0 1px 2px rgba(16,18,28,.05), 0 1px 3px rgba(16,18,28,.04);
  --shadow:        0 10px 30px -12px rgba(16,18,28,.18);
  --shadow-lg:     0 24px 60px -20px rgba(16,18,28,.30);
  --max-w:         1140px;
  --gutter:        clamp(20px, 5vw, 40px);
  --font-sans:     'Inter Tight', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display:  'Fraunces', Georgia, 'Times New Roman', serif;
  --header-h:      72px;
  --ease:          cubic-bezier(.2, .7, .2, 1);
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }
input { font: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.app { display: flex; flex-direction: column; min-height: 100svh; }
/* Utilitário de layout genérico (NÃO é específico de bloco do CMS): usado
   pelos blocos de `cms_block_renderer.jsx` e por telas que nada têm a ver com
   blocos — `.state__inner` (404/erro), `.container--prose` (blog) e
   `.legal-page` (páginas legais), todas abaixo. Fica aqui, carregado ANTES de
   `src/cms_blocks.css`, para que essas classes mais específicas, de mesma
   especificidade, continuem vencendo a cascata (achado B-1,
   review-cms-pagina-institucional-pr1a.md). */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding-inline: var(--gutter); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: .95rem; line-height: 1;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn__icon { width: 17px; height: 17px; transition: transform .2s ease; }
.btn:hover .btn__icon { transform: translateX(3px); }
.btn--primary { background: var(--accent); color: var(--accent-contrast); box-shadow: var(--shadow-sm); }
/* Realce dourado da preview: leve escurecida (independente do tema — não cai no
   fallback azul de --accent-strong quando o tema não define accent_dark) + brilho. */
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 90%, #000); box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--accent) 65%, transparent); transform: translateY(-2px); }
/* Fundo é literalmente branco, então a cor do texto NÃO pode vir de --ink: em
   tema escuro --ink é claro e o botão fica branco no branco (invisível). */
.btn--light { background: #fff; color: #14161d; box-shadow: var(--shadow-sm); }
.btn--light:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--ghost { border: 1.5px solid var(--border-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--ghost-light { border: 1.5px solid rgba(255,255,255,.55); color: #fff; }
.btn--ghost-light:hover { border-color: #fff; background: rgba(255,255,255,.12); }
.btn--lg { padding: 15px 30px; font-size: 1rem; }

/* ── Header ──────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.site-header__inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -.01em; }
.brand__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--ink); color: #fff; font-size: .82rem; font-weight: 700; letter-spacing: .02em;
}
.brand__mark--lg { width: 44px; height: 44px; border-radius: 12px; font-size: 1rem; }
.brand__name { font-size: 1.12rem; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav__link {
  position: relative; padding: 9px 14px; border-radius: var(--radius-sm);
  font-size: .94rem; font-weight: 500; color: var(--ink-soft);
  transition: color .15s ease, background .15s ease;
}
.nav__link:hover { color: var(--ink); background: var(--bg-soft); }
.nav__link.is-active { color: var(--accent); }
.nav__link.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px;
  border-radius: 2px; background: var(--accent);
}
.nav__toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; margin-left: auto; }
.nav__toggle span { width: 22px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .25s ease, opacity .2s ease; }
.site-header.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.site-header.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Search ───────────────────────────────────────────────────────────── */
.search-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: none; border-radius: var(--radius);
  background: transparent; color: var(--ink-soft); cursor: pointer; transition: color .15s, background .15s;
}
.search-toggle:hover { color: var(--ink); background: var(--bg-soft); }
.search-bar {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2px 4px; box-shadow: var(--shadow-sm);
}
.search-bar__input {
  border: none; background: transparent; outline: none;
  color: var(--ink); font-size: .9rem; padding: 4px 6px; width: 220px; min-width: 0;
}
.search-bar__input::placeholder { color: var(--ink-faint); }
.search-bar__btn, .search-bar__close {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: none; border-radius: calc(var(--radius) - 2px);
  background: transparent; color: var(--ink-soft); cursor: pointer; flex-shrink: 0;
  transition: color .15s, background .15s;
}
.search-bar__btn:hover, .search-bar__close:hover { color: var(--ink); background: var(--bg-soft); }

/* ── Cart badge ───────────────────────────────────────────────────────── */
.cart-badge {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: none; border-radius: var(--radius);
  background: transparent; color: var(--ink-soft); cursor: pointer; transition: color .15s;
}
.cart-badge:hover { color: var(--ink); }
.cart-badge__count {
  position: absolute; top: 2px; right: 0;
  background: var(--accent); color: var(--accent-contrast, #fff);
  font-size: .65rem; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 99px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
}
/* Botão de conta / login do cliente (leva à área do cliente) */
.account-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong); color: var(--ink);
  font-size: .88rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.account-link:hover { background: var(--bg-soft); border-color: var(--accent); }
.account-link .icon { width: 17px; height: 17px; }
@media (max-width: 720px) {
  .account-link__label { display: none; }
  .account-link { padding: 8px; border-radius: 50%; }
}

/* ── Footer ──────────────────────────────────────────────────────────── */
/* Rodapé invertido: o texto é branco fixo, então o fundo TEM de ser escuro
   sempre. Não pode cair em var(--ink): em tema escuro --ink é claro (no tema
   DOM BARBER, #f4ecdd) e o rodapé fica creme com texto branco — contraste medido
   de 1,12:1, ilegível. O default é o mesmo literal de .btn--light, pelo mesmo
   motivo: cor de fundo fixa exige cor de texto fixa. --footer-bg (token de tema
   footer_bg) segue permitindo sobrepor por site. */
.site-footer { margin-top: auto; background: var(--footer-bg, #14161d); color: rgba(255,255,255,.7); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-start; padding-block: 52px 32px; }
.site-footer__brand { display: flex; gap: 14px; align-items: center; }
.site-footer__brand .brand__mark { background: #fff; color: var(--ink); }
.site-footer__name { color: #fff; font-weight: 700; font-size: 1.1rem; }
.site-footer__tagline { font-size: .9rem; color: rgba(255,255,255,.6); margin-top: 2px; max-width: 320px; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.site-footer__link { padding: 6px 12px; border-radius: var(--radius-sm); font-size: .9rem; color: rgba(255,255,255,.62); transition: color .15s ease, background .15s ease; }
.site-footer__link:hover { color: #fff; background: rgba(255,255,255,.08); }
.site-footer__bottom { padding-block: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; color: rgba(255,255,255,.5); }

/* ── Skeleton ────────────────────────────────────────────────────────── */
.skeleton__hero { padding-block: clamp(64px, 12vh, 120px); background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.skeleton__bar, .skeleton__pill, .skeleton__card { position: relative; overflow: hidden; background: #e9eaf0; border-radius: 8px; }
.skeleton__bar { height: 18px; margin-bottom: 16px; }
.skeleton__bar--eyebrow { width: 130px; height: 26px; border-radius: var(--radius-pill); }
.skeleton__bar--title { height: 44px; max-width: 560px; }
.skeleton__bar--title.sk-short { max-width: 380px; }
.skeleton__bar--text { height: 14px; max-width: 460px; }
.skeleton__bar--chip { width: 46px; height: 46px; border-radius: 12px; margin-bottom: 18px; }
.skeleton__actions { display: flex; gap: 14px; margin-top: 30px; }
.skeleton__pill { width: 150px; height: 46px; border-radius: var(--radius-pill); }
.skeleton__pill.sk-ghost { width: 130px; opacity: .6; }
.skeleton__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.skeleton__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.skeleton__card .skeleton__bar:last-child { margin-bottom: 0; }
.skeleton__bar::after, .skeleton__pill::after, .skeleton__card::before {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation: shimmer 1.4s infinite;
}
.skeleton__card::before { z-index: 0; }

/* ── States (404 / erro / vazio) ─────────────────────────────────────── */
.state { flex: 1; display: flex; align-items: center; justify-content: center; padding-block: clamp(48px, 9vh, 96px); }
.state__inner {
  max-width: 480px; margin-inline: auto; text-align: center;
  padding: clamp(36px, 5vw, 56px) clamp(24px, 4vw, 44px);
  background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
}
.state__badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; margin: 0 auto 20px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
}
.state__badge .icon { width: 28px; height: 28px; }
.state__code { font-family: var(--font-display); font-weight: 600; font-size: clamp(3.4rem, 10vw, 5.5rem); line-height: 1; color: var(--accent); letter-spacing: -.04em; }
.state__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: 10px; letter-spacing: -.01em; }
.state__text { margin-top: 12px; color: var(--ink-soft); font-size: 1rem; line-height: 1.6; }
.state__actions { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Blog ────────────────────────────────────────────────────────────── */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.post-card { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: box-shadow .15s, transform .15s; }
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.post-card--skeleton { min-height: 140px; }
.post-card__image { height: 160px; background-size: cover; background-position: center; }
.post-card__body { padding: 16px; }
.post-card__type { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 6px; font-weight: 600; }
.post-card__title { font-size: 1.05rem; font-weight: 600; line-height: 1.3; margin: 0 0 6px; }
.post-card__excerpt { font-size: .85rem; color: var(--ink-soft); line-height: 1.5; margin: 0 0 8px; }
.post-card__date { font-size: .75rem; color: var(--ink-faint); }

.post-tag-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border); background: transparent; font-size: .75rem; font-weight: 500; color: var(--ink-soft); cursor: pointer; transition: background .1s, color .1s, border-color .1s; }
.post-tag-chip:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.post-tag-chip--active { background: var(--accent); color: #fff; border-color: var(--accent); }
.post-tag-chip--sm { padding: 1px 7px; font-size: .7rem; cursor: default; pointer-events: none; }
.post-tag-chip--sm:hover { background: transparent; color: var(--ink-soft); border-color: var(--border); }

.post-hero { position: relative; min-height: 320px; display: flex; align-items: center; background-size: cover; background-position: center; overflow: hidden; }
.post-hero--media { color: #fff; }
.post-hero__inner { position: relative; z-index: 1; }
.post-hero__title { font-size: clamp(1.6rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.15; margin: 0 0 12px; }
.post-hero__subtitle { font-size: 1.05rem; color: var(--ink-soft); max-width: 42em; }
.post-hero--media .post-hero__subtitle { color: rgba(255,255,255,.7); }
.post-hero__meta { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink-soft); margin-top: 12px; }
.post-hero--media .post-hero__meta { color: rgba(255,255,255,.6); }

.container--prose { max-width: 720px; }
.post-content img { border-radius: var(--radius); margin: 1.2em 0; }

.post-author { display: flex; align-items: center; gap: 16px; padding: 20px 0; border-top: 1px solid var(--border); }
.post-author__avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.post-author__avatar-fallback { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; color: var(--accent); }
.post-author__name { font-weight: 600; font-size: .95rem; }
.post-author__bio { font-size: .85rem; color: var(--ink-soft); margin: 4px 0 0; }

/* ── Atendimento ─────────────────────────────────────────────────────── */
/* Equipe = cartões-retrato (3:4) como a preview: a FOTO REAL do barbeiro num
   círculo com anel dourado, nome serif + cargo dourado no rodapé. O cartão inteiro
   é clicável (leva à página do barbeiro) quando o membro tem `pageSlug`. */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.team-grid[data-count="4"] { grid-template-columns: repeat(4, 1fr); }
.team-grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) {
  .team-grid, .team-grid[data-count="4"], .team-grid[data-count="3"] { grid-template-columns: repeat(2, 1fr); }
}
.team-member {
  position: relative; display: flex; align-items: flex-end; width: 100%;
  aspect-ratio: 3 / 4; text-align: left; color: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.team-member--link { cursor: pointer; }
.team-member--link:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.team-member--link:hover .team-member__photo { transform: scale(1.05); }
/* Contêiner full-card: sem círculo, a foto preenche o card inteiro. Para o fallback
   (sem foto) vira um card escuro com o monograma centralizado. */
.team-member__photo {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(120% 100% at 50% 0, var(--bg-soft), var(--bg));
  transition: transform .5s var(--ease);
}
/* Foto preenche o card (object-position vem inline por membro, via campo `focus`). */
.team-member__portrait {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
/* Fallback sem foto: monograma dourado centralizado, sem círculo. */
.team-member__mono {
  font-family: var(--font-display); font-weight: 600; font-size: 3rem;
  line-height: 1; color: var(--accent); opacity: .5;
}
/* Degradê escuro só na base, pro nome/cargo ficarem legíveis sobre a foto. */
.team-member::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top,
    color-mix(in srgb, var(--bg) 94%, transparent) 0%,
    color-mix(in srgb, var(--bg) 50%, transparent) 32%,
    transparent 58%);
}
.team-member__cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  width: 100%; padding: 16px 18px; display: block;
}
.team-member__name { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; color: var(--ink); }
.team-member__role { display: block; margin-top: 2px; color: var(--accent); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }

.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.testimonial { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin: 0; transition: transform .28s var(--ease), border-color .28s var(--ease); }
.testimonial:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.testimonial__stars { color: var(--accent); letter-spacing: 3px; font-size: .95rem; margin-bottom: 14px; }
.testimonial__text { font-size: 1rem; line-height: 1.6; font-style: normal; color: var(--ink); margin: 0 0 18px; }
.testimonial__footer { display: flex; align-items: center; gap: 10px; }
.testimonial__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.testimonial__name { font-weight: 600; font-size: .92rem; display: block; font-style: normal; color: var(--ink); }
.testimonial__role { font-size: .78rem; color: var(--ink-faint); display: block; font-style: normal; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
/* 6 serviços em auto-fill viram 4+2 (duas órfãs na segunda linha). 3+3 fecha a
   grade. Mesmo motivo para 3 itens, que em telas largas quebrariam 2+1. */
.services-grid[data-count="6"], .services-grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) {
  .services-grid[data-count="6"], .services-grid[data-count="3"] { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
/* Cartão de serviço com o tratamento da preview: realce dourado à esquerda no
   hover, elevação, ícone dourado que reage, título serif. */
.service-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
  transition: transform .28s var(--ease), border-color .28s var(--ease), box-shadow .28s var(--ease), background .28s var(--ease);
}
.service-card::after { content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 3px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .3s var(--ease); }
.service-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.service-card:hover::after { transform: scaleY(1); }
.service-card__icon { width: 34px; height: 34px; border-radius: 0; background: none; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); margin-bottom: 18px; font-size: 1.7rem; line-height: 1; transition: transform .3s var(--ease); }
.service-card__icon .icon { width: 34px; height: 34px; }
.service-card:hover .service-card__icon { transform: scale(1.12) rotate(-4deg); }
.service-card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin: 0 0 8px; }
.service-card__text { font-size: .92rem; color: var(--ink-soft); line-height: 1.6; margin: 0; }

.contact-form { max-width: 560px; margin: 0 auto; }
.contact-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contact-form__field { display: block; margin-bottom: 12px; }
.contact-form__label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 4px; }
.contact-form__input, .contact-form__textarea { display: block; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: .9rem; background: var(--bg); color: var(--ink); transition: border-color .15s; box-sizing: border-box; }
.contact-form__input:focus, .contact-form__textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.contact-form__error { color: #d63031; font-size: .82rem; margin-bottom: 8px; }
.contact-form__submit { margin-top: 4px; }

/* ── Web Chat ───────────────────────────────────────────────────────── */
.webchat { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.webchat__fab { width: 54px; height: 54px; border: 0; border-radius: 50%; display: grid; place-items: center; color: var(--accent-contrast); background: var(--accent); box-shadow: var(--shadow); cursor: pointer; }
.webchat__fab .icon { width: 22px; height: 22px; }
.webchat__panel { width: min(360px, calc(100vw - 28px)); height: min(520px, calc(100vh - 110px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 24px 70px rgba(0,0,0,.18); }
.webchat__head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px; color: var(--accent-contrast); background: var(--accent); }
.webchat__title { font-size: .98rem; font-weight: 700; }
.webchat__status { margin-top: 2px; font-size: .76rem; opacity: .82; }
.webchat__icon { width: 32px; height: 32px; border: 0; border-radius: 50%; display: grid; place-items: center; color: inherit; background: rgba(255,255,255,.14); cursor: pointer; }
.webchat__icon .icon { width: 17px; height: 17px; }
.webchat__start { padding: 16px; display: grid; gap: 12px; }
.webchat__intro { margin: 0; font-size: .82rem; color: var(--muted); line-height: 1.4; }
.webchat__start label { display: grid; gap: 5px; font-size: .78rem; font-weight: 700; }
.webchat__start input, .webchat__composer input { width: 100%; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--ink); padding: 10px 11px; font: inherit; box-sizing: border-box; }
.webchat__messages { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-soft); }
.webchat__empty { margin: auto; color: var(--ink-soft); font-size: .84rem; text-align: center; max-width: 22em; }
.webchat__message { max-width: 82%; align-self: flex-start; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; border-bottom-left-radius: 2px; background: var(--surface); color: var(--ink); font-size: .88rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.webchat__message--me { align-self: flex-end; border-color: transparent; border-bottom-left-radius: 8px; border-bottom-right-radius: 2px; color: var(--accent-contrast); background: var(--accent); }
.webchat__composer { flex-shrink: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.webchat__error { margin: 0; padding: 0 16px 10px; color: #d63031; font-size: .78rem; }

/* ── E-commerce ──────────────────────────────────────────────────────── */
.store-banner { position: relative; min-height: 340px; display: flex; align-items: center; background-size: cover; background-position: center; overflow: hidden; }
.store-banner--media { color: #fff; }
.store-banner__inner { position: relative; z-index: 1; }
.store-banner__title { font-size: clamp(1.6rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.15; margin: 0 0 12px; }
.store-banner__subtitle { font-size: 1.05rem; max-width: 42em; }
.store-banner--media .store-banner__subtitle { color: rgba(255,255,255,.7); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.product-card { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); transition: box-shadow .15s; }
.product-card:hover { box-shadow: var(--shadow); }
.product-card--skeleton { min-height: 220px; }
.product-card__image { height: 180px; background-size: cover; background-position: center; }
.product-card__body { padding: 14px; }
.product-card__name { font-weight: 600; font-size: .95rem; margin: 0 0 4px; }
.product-card__desc { font-size: .82rem; color: var(--ink-soft); margin: 0 0 8px; }
.product-card__price { font-weight: 700; font-size: 1.1rem; color: var(--accent); }

/* ── Animations ──────────────────────────────────────────────────────── */
@keyframes shimmer { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  :root { --header-h: 62px; }
  .nav__toggle { display: flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 2px; margin: 0; padding: 12px var(--gutter) 18px;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    transform: translateY(-12px); opacity: 0; pointer-events: none; visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .site-header.is-open .nav { transform: translateY(0); opacity: 1; pointer-events: auto; visibility: visible; }
  .nav__link { padding: 12px 14px; font-size: 1rem; }
  .nav__link.is-active::after { display: none; }
  .search-bar__input { width: 140px; }
  .post-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-form__row { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .webchat { right: 12px; bottom: 12px; }
  .webchat__panel { width: calc(100vw - 24px); height: min(520px, calc(100vh - 92px)); }
}

/* ── Consentimento e cookies (issue #89) ──────────────────────────────────── */

.contact-form__consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-top: 4px;
}

.contact-form__consent input[type="checkbox"] {
  /* 20px + a área de toque do label: alvo confortável no telemóvel. */
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 2px;
  cursor: pointer;
}

.contact-form__consent a {
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--surface, #14141a);
  color: var(--text, #f5f5f7);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.cookie-banner__text {
  flex: 1 1 320px;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.cookie-banner__text a {
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Recusar tem de ser tão fácil quanto aceitar — mesmo tamanho, mesma proeminência. */
.cookie-banner__actions .btn {
  min-height: 44px;
  padding: 0 18px;
}

@media (max-width: 560px) {
  .cookie-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }
  .cookie-banner__actions {
    width: 100%;
  }
  .cookie-banner__actions .btn {
    flex: 1 1 0;
  }
}

/* Páginas legais servidas pelo próprio renderer (issue #89). */
.legal-page {
  max-width: 68ch;
}

.legal-page h1 {
  margin-bottom: 24px;
}

.legal-page h2 {
  margin-top: 32px;
  margin-bottom: 8px;
  font-size: 1.125rem;
}

.legal-page p {
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-page a {
  text-decoration: underline;
}

.legal-page__back {
  margin-top: 36px;
}

/* ── Loja com checkout (bloco ecommerce_store) ─────────────────────────────── */
.shopx-prod-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  cursor: pointer;
}
.shopx-prod-img--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-size: 2rem;
  cursor: default;
}
.shopx-out {
  font-size: .8rem;
  color: var(--ink-faint);
  margin: 6px 0 0;
}
/* Barra flutuante para reabrir o carrinho quando o drawer está fechado. */
.shopx-cartbar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
}
.shopx-cartbar__count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, .18);
  font-size: .8rem;
}
.shopx-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 18, 22, .48);
  display: flex;
  justify-content: flex-end;
}
.shopx-drawer {
  width: min(440px, 100%);
  height: 100%;
  background: var(--surface, #fff);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: shopx-slide .18s ease-out;
}
@keyframes shopx-slide {
  from { transform: translateX(24px); opacity: .6; }
  to   { transform: translateX(0); opacity: 1; }
}
.shopx-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.shopx-drawer__title {
  font-family: var(--font-display, inherit);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}
.shopx-drawer__close {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
}
.shopx-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.shopx-drawer__foot {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  display: grid;
  gap: 10px;
}
.shopx-line {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.shopx-line:last-child { border-bottom: 0; }
.shopx-line__img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-soft);
  flex: none;
}
.shopx-line__name {
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.3;
  margin: 0 0 3px;
}
.shopx-line__meta {
  display: block;
  font-size: .8rem;
  color: var(--ink-soft);
}
.shopx-line__price {
  font-weight: 700;
  white-space: nowrap;
  font-size: .95rem;
  padding-top: 1px;
}
/* Linha de ações do item: stepper (pílula) + remover, com respiro */
.shopx-qtyrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.shopx-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  overflow: hidden;
}
.shopx-qty button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.shopx-qty button:hover:not(:disabled) { background: var(--bg-soft); }
.shopx-qty button:disabled { opacity: .4; cursor: default; }
.shopx-qty > span {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
  font-size: .9rem;
}
.shopx-line__remove {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.shopx-line__remove:hover:not(:disabled) {
  background: var(--bg-soft);
  color: var(--ink);
}
.shopx-line__remove:disabled { opacity: .4; cursor: default; }
/* Busca de produtos (dentro do bloco da loja) */
.shopx-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto 28px;
  padding: 0 16px;
  height: 46px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.shopx-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(0,0,0,.06));
}
.shopx-search__icon { width: 18px; height: 18px; color: var(--ink-soft); flex: none; }
.shopx-search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: .95rem;
  color: var(--ink);
}
.shopx-search__input::placeholder { color: var(--ink-faint, var(--ink-soft)); }
.shopx-search__clear {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  display: inline-flex;
  flex: none;
}
.shopx-search__clear:hover { color: var(--ink); }
.shopx-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
  font-size: 1.05rem;
}
.shopx-alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .86rem;
  line-height: 1.45;
}
.shopx-alert--err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.shopx-alert--ok  { background: color-mix(in srgb, var(--ok, #12805c) 14%, transparent); color: var(--ok, #12805c); }
.shopx-qr {
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 140px;
  overflow: auto;
}
.shopx-center {
  text-align: center;
  padding: 12px 0;
}
.shopx-spin {
  width: 34px;
  height: 34px;
  margin: 8px auto;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: shopx-rot .8s linear infinite;
}
@keyframes shopx-rot { to { transform: rotate(360deg); } }
.shopx-field {
  display: grid;
  gap: 5px;
}
.shopx-field > span {
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-soft);
}
@media (max-width: 520px) {
  .shopx-cartbar { right: 12px; bottom: 12px; }
}
