/* =========================================================================
   Fisiolight — página "Serviços" (/servicos)
   Usa o visual de style.css; aqui ficam o topo da página, os filtros com a
   pílula animada, os cards de serviço e a janela de detalhes.
   ========================================================================= */

.so-leitor {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Página atual no menu */
.nav > a[aria-current="page"] { color: #936039; }
.nav > a[aria-current="page"] .sublinhado-mao path { stroke-dashoffset: 0; }

/* ---------- Topo ---------- */
.servicos-topo.hero {
  display: block;
  min-height: 0;
  padding: 36px 0 26px;
}

.servicos-topo .hero-copy { max-width: 820px; }
.servicos-topo h1 { font-size: clamp(3.4rem, 6.2vw, 6.2rem); }
.servicos-topo .intro { max-width: 520px; font-size: 16px; }

.migalhas {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
  color: #6b4430;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.migalhas a { transition: color .2s ease; }
.migalhas svg { color: #c99562; }
.migalhas [aria-current] { color: #3b2418; }

/* ---------- Filtros com pílula animada ---------- */
.servicos-lista {
  position: relative;
  isolation: isolate;
  padding-top: 26px;
}

.servicos-barra { margin-bottom: 36px; }

.servicos-filtros {
  position: relative;
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  padding: 6px;
  overflow-x: auto;
  background: #fcf8feb3;
  border: 1px solid #e8d5e8;
  border-radius: 100px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 25px #65517b0d;
  scrollbar-width: none;
}

.servicos-filtros::-webkit-scrollbar { display: none; }

.servicos-filtros button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  color: #65517b;
  background: transparent;
  border: 0;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: color .35s ease, scale .2s var(--ease-out), background-color .2s ease;
}

.servicos-filtros button > span {
  font-size: 10px;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
  opacity: .55;
}

.servicos-filtros button[aria-pressed="true"] { color: #fbf7f1; }

/* Sem a pílula (animações desligadas), o próprio botão ativo ganha o fundo */
.servicos-filtros:not(.com-indicador) button[aria-pressed="true"] { background: #65517b; }

.servicos-indicador {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  z-index: 0;
  width: 0;
  background: #65517b;
  border-radius: 100px;
  box-shadow: 0 6px 16px #65517b40;
  pointer-events: none;
}

.servicos-filtros:not(.com-indicador) .servicos-indicador { display: none; }

/* ---------- Cards ---------- */
.servicos-grade {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  counter-reset: servico;
}

.servico {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 30px 30px 26px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid #e8d5e8;
  border-radius: 24px;
  box-shadow: 0 10px 25px #65517b0d;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  counter-increment: servico;
  cursor: pointer;
  transition: transform .45s var(--anim-ease, cubic-bezier(.22, 1, .36, 1)), box-shadow .45s ease, border-color .3s ease;
}

.servico[hidden] { display: none; }

.servico-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  color: #936039;
}

.servico-icone,
.servico-modal-icone {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #936039;
  background: #f1e7f8;
  border: 1px solid #e8d5e8;
  border-radius: 50%;
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}

.servico-numero {
  font-size: 11px;
  letter-spacing: .13em;
}

.servico-numero::before { content: counter(servico, decimal-leading-zero); }

.servico-categoria,
.servico-modal-categoria {
  color: #6b4430;
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.servico h3 {
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.08;
}

.servico-desc {
  display: -webkit-box;
  margin: 12px 0 24px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.7;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.servico-abrir {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 0 0 4px;
  color: #3b2418;
  background: none;
  border: 0;
  border-bottom: 1px solid #b99a7c;
  font-size: 12.5px;
  transition: color .2s ease, scale .2s var(--ease-out);
}

.servico-abrir svg { transition: transform .3s ease; }

/* ---------- Janela de detalhes ---------- */
.servico-modal {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(32, 22, 43, .55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.servico-modal[hidden] { display: none; }

.servico-modal-caixa {
  position: relative;
  width: min(100%, 560px);
  max-height: 88svh;
  padding: 48px 44px 40px;
  overflow: auto;
  background: #fff;
  border-radius: 32px;
  box-shadow: 0 30px 80px #20162b40;
  overscroll-behavior: contain;
}

.servico-modal-fechar {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #3b2418;
  background: #fcf8fe;
  border: 1px solid #e8d5e8;
  border-radius: 50%;
  transition: scale .2s var(--ease-out), background-color .2s ease;
}

.servico-modal-icone {
  width: 64px;
  height: 64px;
}

.servico-modal-categoria {
  display: block;
  margin-top: 26px;
}

.servico-modal h2 {
  margin-top: 10px;
  font-size: clamp(2.3rem, 4.2vw, 3.2rem);
}

.servico-modal-desc {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.8;
}

.servico-modal-acao { margin-top: 30px; }

.servico-modal-nota {
  margin-top: 16px;
  color: #6b4430;
  font-size: 11px;
}

/* Rodapé da lista */
.servicos-lista .gallery-footer { margin-top: 40px; }

/* ---------- Interação ---------- */
@media (hover: hover) and (pointer: fine) {
  .servico:hover {
    border-color: #c9a9d6;
    box-shadow: 0 24px 50px #65517b24, 0 2px 6px #65517b10;
    transform: translateY(-6px);
  }
  .servico:hover .servico-icone {
    color: #fbf7f1;
    background: #65517b;
    border-color: #65517b;
  }
  .servico:hover .servico-abrir { color: #936039; }
  .servico:hover .servico-abrir svg { transform: translate(2px, -2px); }
  .servicos-filtros button:hover:not([aria-pressed="true"]) { background: #e9ddf3; }
  .migalhas a:hover { color: #936039; }
  /* botões crescem levemente no hover */
  .servicos-filtros button:hover,
  .servico-modal .button:hover,
  .servico-modal-fechar:hover,
  .servicos-lista .gallery-footer .text-link:hover { scale: 1.02; }
  .servico-modal-fechar:hover { background: #e9ddf3; }
}

.servico:focus-within { border-color: #c9a9d6; }

/* ---------- Telas menores ---------- */
@media (width <= 1100px) {
  .servicos-grade { gap: 20px; }
  .servico { padding: 26px 24px 22px; }
  .servico h3 { font-size: 26px; }
}

@media (width <= 820px) {
  .servicos-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .servicos-topo.hero { padding-top: 24px; }
}

@media (width <= 540px) {
  .servicos-grade {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .servicos-filtros { display: flex; }
  .servicos-filtros button {
    min-height: 40px;
    padding: 9px 14px;
    font-size: 12px;
  }
  .servico-modal-caixa {
    padding: 44px 24px 28px;
    border-radius: 28px;
  }
  .servicos-lista .gallery-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .servicos-lista .gallery-footer > span { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .servico:hover { transform: none; }
}
