/* Sorocaba Web — estilos dos componentes reutilizáveis (componentes.js)
   Usam os tokens de cor da página (--surface, --line, --accent…) e funcionam no modo escuro. */

/* ---------- Capa ---------- */
.sw-capa { position: relative; aspect-ratio: 4 / 1; border-radius: 16px; overflow: hidden; background: var(--azul-escuro, #091d3e); }
.sw-capa img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sw-capa-sombra { position: absolute; inset: 0; background: linear-gradient(to top, rgba(9, 29, 62, .45), rgba(9, 29, 62, 0) 55%); pointer-events: none; }
.sw-capa-padrao { background: radial-gradient(120% 140% at 85% 10%, #3d6bff 0%, #1747db 38%, #0f2f8f 70%, #091d3e 100%); color: #fff; }
.sw-capa-arte { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Logotipo ---------- */
.sw-logo { width: 100px; height: 100px; flex: none; border-radius: 18px; background: #fff; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(9, 29, 62, .12), 0 10px 24px rgba(9, 29, 62, .14); overflow: hidden; display: grid; place-items: center; }
.sw-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sw-logo-vazio { background: hsl(var(--h) 55% var(--thumb-l, 88%)); color: hsl(var(--h) 45% var(--thumb-ink-l, 32%)); border-color: var(--surface, #fff); }
.sw-logo-vazio svg { width: 46px; height: 46px; }

/* ---------- Faixa de informações rápidas ---------- */
.sw-faixa { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.sw-faixa-item { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.sw-faixa-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.sw-faixa-rot { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sw-faixa-val { font-weight: 600; line-height: 1.3; margin-top: 2px; }
.sw-faixa-val.bom { color: var(--good); }
.sw-faixa-val.ruim { color: var(--bad); }
.sw-faixa-det { font-size: 13px; color: var(--muted); margin-top: 1px; }

/* ---------- Cartão de serviço ---------- */
.sw-servicos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.sw-serv { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-width: 0; }
.sw-serv-topo { position: relative; }
.sw-serv-img { display: block; width: 100%; aspect-ratio: 16 / 10; padding: 0; border: 0; margin: 0; background: var(--bg); overflow: hidden; }
button.sw-serv-img { cursor: zoom-in; }
.sw-serv-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sw-serv-vazio { display: grid; place-items: center; background: hsl(var(--h) 55% var(--thumb-l, 88%)); color: hsl(var(--h) 45% var(--thumb-ink-l, 32%)); }
.sw-serv-vazio svg { width: 44px; height: 44px; opacity: .85; }
.sw-serv-corpo { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sw-serv-tipo { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sw-serv h3 { font-family: var(--f-display); font-size: 17px; line-height: 1.25; margin: 0; }
.sw-serv-desc { margin: 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sw-serv-chamada { margin: 0; font-size: 14px; font-weight: 600; color: var(--oferta-ink, #8a5a00); }
.sw-serv-rodape { margin-top: auto; padding-top: 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sw-serv-precos { display: grid; line-height: 1.2; }
.sw-preco { font-family: var(--f-display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.sw-preco small { font-family: var(--f-body); font-weight: 400; font-size: 12px; color: var(--muted); }
.sw-preco-consulta { font-family: var(--f-body); font-size: 14px; font-weight: 600; color: var(--muted); }
.sw-preco-de { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sw-preco-promo { color: var(--oferta-ink, #8a5a00); }
.sw-serv-acao { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--accent); color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.sw-serv-acao:hover { background: var(--accent); color: var(--accent-ink); }
.sw-serv-promo { border-color: var(--oferta, #f5b841); background: var(--oferta-soft, #fff7e3); }
.sw-selo-oferta { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px; background: var(--oferta, #f5b841); color: #3a2600; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.sw-selo-pct { position: absolute; right: 10px; top: 10px; background: #091d3e; color: #fff; font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 8px; font-variant-numeric: tabular-nums; }

/* Texto completo ao passar o mouse (só em cartões com nome ou descrição cortados) */
.sw-serv { position: relative; }
.sw-serv-completo { position: absolute; top: 0; left: 0; right: 0; bottom: var(--sw-rodape, 56px); z-index: 2; display: none; flex-direction: column; gap: 6px; padding: 14px 14px 8px; background: inherit; font-size: 14px; line-height: 1.45; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; cursor: zoom-in; border-radius: 14px 14px 0 0; }
.sw-serv-completo b { font-family: var(--f-display); font-size: 16px; line-height: 1.25; }
.sw-serv-completo span { color: var(--ink); overflow-wrap: anywhere; }
.sw-serv-completo .sw-serv-chamada { color: var(--oferta-ink, #8a5a00); }
.sw-serv.sw-cortado:hover .sw-serv-completo, .sw-serv.sw-cortado:focus-within .sw-serv-completo { display: flex; }
.sw-serv-compacto .sw-serv-completo { padding: 11px 11px 6px; font-size: 13px; }
.sw-serv-compacto .sw-serv-completo b { font-family: var(--f-body); font-size: 14px; }
@media (hover: none) { .sw-serv.sw-cortado:hover .sw-serv-completo { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .sw-serv.sw-cortado:hover .sw-serv-completo, .sw-serv.sw-cortado:focus-within .sw-serv-completo { animation: sw-aparece .15s ease-out; }
  @keyframes sw-aparece { from { opacity: 0; } to { opacity: 1; } }
}

/* Versão compacta (produtos): mais itens por linha */
.sw-servicos.sw-compactos { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.sw-serv-compacto .sw-serv-img { aspect-ratio: 1 / 1; }
.sw-serv-compacto .sw-serv-vazio svg { width: 34px; height: 34px; }
.sw-serv-compacto .sw-serv-corpo { padding: 10px 11px 11px; gap: 3px; }
.sw-serv-compacto h3 { font-family: var(--f-body); font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sw-serv-compacto .sw-serv-desc { font-size: 12.5px; -webkit-line-clamp: 2; }
.sw-serv-compacto .sw-serv-chamada { font-size: 12.5px; }
.sw-serv-compacto .sw-serv-rodape { padding-top: 6px; align-items: center; flex-wrap: nowrap; }
.sw-serv-compacto .sw-preco { font-size: 16px; }
.sw-serv-compacto .sw-preco-de { font-size: 12px; }
.sw-serv-compacto .sw-preco-consulta { font-size: 13px; }
.sw-serv-compacto .sw-serv-acao { flex: none; width: 36px; height: 36px; min-height: 0; padding: 0; justify-content: center; }
.sw-serv-compacto .sw-selo-oferta { left: 6px; top: 6px; font-size: 11px; padding: 3px 7px; }
.sw-serv-compacto .sw-selo-pct { right: 6px; top: 6px; font-size: 12px; padding: 2px 6px; }
@media (max-width: 600px) { .sw-servicos.sw-compactos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* ---------- Abas ---------- */
.sw-abas { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 16px; max-width: 100%; overflow-x: auto; }
.sw-aba { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; padding: 8px 16px; min-height: 40px; border-radius: 999px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.sw-aba:hover { color: var(--ink); }
.sw-aba[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(9, 29, 62, .12); }
.sw-aba-n { font-size: 12px; font-weight: 600; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-align: center; }
.sw-aba-oferta { width: 8px; height: 8px; border-radius: 50%; background: var(--oferta, #f5b841); }

/* ---------- Galeria em mosaico ---------- */
.sw-mosaico { display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 120px; }
.sw-mos-item { position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--bg); cursor: zoom-in; }
.sw-mos-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sw-mosaico .sw-mos-item:first-child { grid-column: span 2; grid-row: span 2; }
.sw-mosaico.n1 { grid-template-columns: 1fr; grid-auto-rows: auto; }
.sw-mosaico.n1 .sw-mos-item { grid-column: auto; grid-row: auto; aspect-ratio: 16 / 9; }
.sw-mosaico.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 220px; }
.sw-mosaico.n2 .sw-mos-item:first-child, .sw-mosaico.n3 .sw-mos-item:first-child { grid-row: auto; grid-column: auto; }
.sw-mosaico.n3 { grid-template-columns: 2fr 1fr; grid-auto-rows: 120px; }
.sw-mosaico.n3 .sw-mos-item:first-child { grid-row: span 2; }
.sw-mosaico.n4 .sw-mos-item:nth-child(4) { grid-column: span 2; }
.sw-mos-vt { width: 100%; height: 100%; display: grid; place-items: center; background: #11162a; color: #fff; font-size: 13px; }
.sw-mos-play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.sw-mos-play span { width: 46px; height: 46px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; font-size: 18px; padding-left: 3px; }
.sw-mos-mais { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(9, 29, 62, .62); color: #fff; font-family: var(--f-display); font-size: 26px; font-weight: 700; }
@media (max-width: 600px) {
  .sw-mosaico { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 110px; }
  .sw-mosaico.n2 { grid-auto-rows: 150px; }
  .sw-logo { width: 76px; height: 76px; border-radius: 14px; }
  .sw-logo-vazio svg { width: 34px; height: 34px; }
  .sw-capa { aspect-ratio: 8 / 3; border-radius: 14px; }
}

/* ---------- Grade adaptativa: --cols vem do JS (componente grade) ---------- */
/* --cols (computador), --cols-t (tablet) e --cols-m (celular) são definidos pelo JS para cada lista */
.sw-grade { --larg: 300px; --c: var(--cols, 4); display: grid; grid-template-columns: repeat(var(--c), minmax(0, 1fr)); gap: 16px; max-width: calc(var(--c) * var(--larg) + (var(--c) - 1) * 16px); margin-inline: auto; }
@media (max-width: 860px) { .sw-grade { --c: var(--cols-t, 2); gap: 12px; max-width: none; } }
@media (max-width: 560px) { .sw-grade { --c: var(--cols-m, 1); } }

/* ---------- Cartão de negócio ---------- */
.sw-neg { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; color: inherit; text-decoration: none; min-width: 0; }
.sw-neg-img { position: relative; aspect-ratio: 16 / 10; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.sw-neg-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sw-neg-vazio { background: hsl(var(--h) 55% var(--thumb-l, 88%)); color: hsl(var(--h) 45% var(--thumb-ink-l, 32%)); }
.sw-neg-vazio svg { width: 48px; height: 48px; }
.sw-neg-selo { position: absolute; left: 10px; top: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.sw-neg-corpo { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sw-neg h3 { font-family: var(--f-display); font-size: 17px; line-height: 1.25; margin: 0; }
.sw-neg-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13.5px; color: var(--muted); }
.sw-neg-rodape { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; flex-wrap: wrap; }
.sw-neg-nota { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Cartão de categoria ---------- */
.sw-cat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none; min-width: 0; }
.sw-cat:hover { border-color: var(--accent); }
.sw-cat:hover b { color: var(--accent); }
.sw-cat-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: hsl(var(--h) 55% var(--thumb-l, 88%)); color: hsl(var(--h) 45% var(--thumb-ink-l, 32%)); }
.sw-cat-ic svg { width: 24px; height: 24px; }
.sw-cat-txt { display: grid; min-width: 0; }
.sw-cat-txt b { font-size: 15px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-cat-txt small { color: var(--muted); font-size: 12.5px; }

/* ---------- Cartão de avaliação ---------- */
.sw-av { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: inherit; text-decoration: none; min-width: 0; }
.sw-av-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; }
.sw-av-texto { margin: 0; font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sw-av-quem { margin-top: auto; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.sw-av-quem > span:last-child { display: grid; line-height: 1.3; min-width: 0; }
.sw-av-quem small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-av-lugar { color: var(--accent); font-weight: 600; }

/* ---------- Cartão patrocinado ---------- */
.sw-pat { position: relative; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 4px var(--accent-soft); }
.sw-pat-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.sw-pat-img { position: relative; min-height: 200px; display: grid; place-items: center; }
.sw-pat-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sw-pat-img svg { width: 60px; height: 60px; }
.sw-pat-corpo { padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.sw-pat-tag { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; }
.sw-pat h3 { font-family: var(--f-display); font-size: 22px; margin: 2px 0 0; }
.sw-pat-frase { margin: 2px 0 0; font-weight: 600; color: var(--accent); }
.sw-pat-desc { margin: 0; color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sw-pat-oferta { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 10px; background: var(--oferta-soft, #fff7e3); color: var(--oferta-ink, #8a5a00); font-size: 14px; }
.sw-pat-oferta svg { flex: none; margin-top: 2px; }
.sw-pat-pct { background: #091d3e; color: #fff; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.sw-pat-ver { margin-top: auto; padding-top: 6px; font-weight: 600; color: var(--accent); }
.sw-pat:hover .sw-pat-ver { text-decoration: underline; }
@media (max-width: 640px) {
  .sw-pat { grid-template-columns: minmax(0, 1fr); }
  .sw-pat-img { min-height: 0; aspect-ratio: 16 / 9; }
  .sw-pat-corpo { padding: 16px; }
  .sw-pat h3 { font-size: 19px; }
}

/* ---------- Cartão de classificado ---------- */
.sw-clas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.sw-cla { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: inherit; text-decoration: none; min-width: 0; }
.sw-cla-img { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; background: var(--bg); overflow: hidden; }
.sw-cla-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sw-cla-img svg { width: 44px; height: 44px; }
.sw-cla-cond { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: rgba(9, 29, 62, .72); color: #fff; }
.sw-cla-corpo { padding: 10px 12px 12px; display: grid; gap: 3px; }
.sw-cla-preco { font-family: var(--f-display); font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.sw-cla-preco.combinar { font-size: 15px; color: var(--muted); }
.sw-cla-preco small { font-family: var(--f-body); font-weight: 600; font-size: 11.5px; color: var(--good); }
.sw-cla h3 { font-family: var(--f-body); font-weight: 600; font-size: 14.5px; line-height: 1.3; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sw-cla-meta { font-size: 12.5px; color: var(--muted); }
@media (max-width: 560px) { .sw-clas { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (prefers-reduced-motion: no-preference) { .sw-cla { transition: transform .18s ease, box-shadow .18s ease; } .sw-cla:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(9, 29, 62, .1); } }

/* ---------- Esqueleto de carregamento ---------- */
.sw-esq { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); padding: 14px; display: grid; gap: 10px; align-content: start; }
.sw-esq span { display: block; height: 12px; border-radius: 6px; background: var(--line); }
.sw-esq span:first-child { height: 110px; border-radius: 10px; }
.sw-esq span:last-child { width: 60%; }
.sw-esq-cat span:first-child { height: 44px; width: 44px; }
.sw-esq-av span:first-child { height: 60px; }
@media (prefers-reduced-motion: no-preference) { .sw-esq span { animation: sw-pulsa 1.2s ease-in-out infinite alternate; } @keyframes sw-pulsa { from { opacity: .45; } to { opacity: 1; } } }

/* ---------- Autocompletar ---------- */
.sw-ac { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(9, 29, 62, .16); text-align: left; max-height: min(60vh, 380px); overflow-y: auto; }
.sw-ac li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.sw-ac li[aria-selected="true"], .sw-ac li:hover { background: var(--accent-soft); }
.sw-ac-ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bg); color: var(--accent); }
.sw-ac-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-ac-txt mark { background: none; color: var(--accent); font-weight: 700; }
.sw-ac small { flex: none; color: var(--muted); font-size: 12px; }

/* ---------- Arte discreta de ruas (faixas azuis) ---------- */
.sw-arte { position: absolute; inset: 0; color: #fff; pointer-events: none; overflow: hidden; }

/* ---------- Movimento (só para quem não pediu menos animação) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .sw-serv { transition: transform .18s ease, box-shadow .18s ease; }
  .sw-serv:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(9, 29, 62, .1); }
  .sw-mos-item img, .sw-serv-img img { transition: transform .3s ease; }
  .sw-mos-item:hover img, button.sw-serv-img:hover img { transform: scale(1.04); }
  .sw-neg, .sw-cat, .sw-av, .sw-pat { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
  .sw-neg:hover, .sw-av:hover, .sw-pat:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(9, 29, 62, .1); }
  .sw-cat:hover { transform: translateY(-1px); }
  .sw-neg-img img { transition: transform .3s ease; }
  .sw-neg:hover .sw-neg-img img { transform: scale(1.04); }
}
