/* Anúncios da casa (lib/portal/casa.js): retângulo 300×250, faixa 728×90 (320×100 no celular) e card na matéria.
   Tamanhos fixos (sem pulo de layout). Animação calma, curta, só quando o banner aparece (classe .vis, casa-v1.js),
   e nenhuma com prefers-reduced-motion. Cores de cada produto em .cs-p-<produto>. */
.casa {
  font-family: var(--sans);
  text-align: left;
  --cs-c: #333;
  --cs-c2: #222;
  --cs-d: #fff;
  --cs-dt: #111;
  --cs-claro: #f4f4f2;
}
.casa .rotulo {
  text-align: center;
}
.cs-p-curriculo { --cs-c: #3b2a8f; --cs-c2: #1f1650; --cs-d: #ff6b57; --cs-dt: #fff; --cs-claro: #f3f0ff; }
.cs-p-crediario { --cs-c: #5b1a33; --cs-c2: #3d0f22; --cs-d: #e9c979; --cs-dt: #3d0f22; --cs-claro: #f8ecea; }
.cs-p-mei { --cs-c: #0f5566; --cs-c2: #0b3c49; --cs-d: #ffc629; --cs-dt: #0b3c49; --cs-claro: #e9f2f4; }
.cs-p-barbearia { --cs-c: #1d3a30; --cs-c2: #14281f; --cs-d: #c69a4a; --cs-dt: #14281f; --cs-claro: #e9efeb; }
.cs-p-tattoo { --cs-c: #2b1714; --cs-c2: #0c0c0e; --cs-d: #d0402f; --cs-dt: #fff; --cs-claro: #f5ecea; }
.cs-p-mensalidade { --cs-c: #155e63; --cs-c2: #0e3b43; --cs-d: #5fe08f; --cs-dt: #0e3b43; --cs-claro: #e8f4ec; }
.cs-p-placa { --cs-c: #1c2410; --cs-c2: #0b0d0c; --cs-d: #c8f169; --cs-dt: #0b0d0c; --cs-claro: #f0f5e2; }

.casa a.cs-in,
.casa a.cs-in:hover {
  text-decoration: none;
}
.cs-in {
  display: block;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  border-radius: 6px;
}
.cs-in:hover .cs-bt {
  filter: brightness(1.06);
}
.cs-in:focus-visible {
  outline: 3px solid var(--cs-d);
  outline-offset: 2px;
}
.cs-marca {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cs-marca::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cs-d);
  flex: none;
}
.cs-tit {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.cs-preco {
  font-size: 12.5px;
  opacity: 0.85;
}
.cs-bt {
  position: relative;
  overflow: hidden;
  display: inline-block;
  background: var(--cs-d);
  color: var(--cs-dt);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  padding: 10px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.cs-bt::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-130%);
}

/* celular com a tela real do produto */
.cs-cel {
  position: absolute;
  background: #111;
  border-radius: 16px;
  padding: 5px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}
.cs-tela {
  display: block;
  overflow: hidden;
  border-radius: 11px;
  background: #fff;
  height: var(--cs-h);
}
.cs-tela img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  aspect-ratio: 1 / 4;
  object-fit: cover;
  object-position: top;
}
.cs-aviso {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  color: #161616;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 8px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  max-width: 112px;
}
.cs-aviso i {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #16a34a;
  position: relative;
}
.cs-aviso i::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 2.5px;
  width: 3.5px;
  height: 6.5px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- retângulo 300×250 ---------- */
.casa.cs-ret a.cs-in,
.casa.cs-faixa a.cs-in {
  color: #fff;
}
.casa.cs-card a.cs-in {
  color: #161616;
}
.cs-ret .cs-in {
  width: 300px;
  height: 250px;
  max-width: 100%;
  margin: 0 auto;
  background: linear-gradient(155deg, var(--cs-c), var(--cs-c2));
}
.cs-ret .cs-txt {
  position: absolute;
  left: 18px;
  top: 18px;
  bottom: 18px;
  width: 158px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.cs-ret .cs-marca {
  color: rgba(255, 255, 255, 0.9);
}
.cs-ret .cs-tit {
  font-size: 19px;
  line-height: 1.2;
  -webkit-line-clamp: 4;
}
.cs-ret .cs-bt {
  margin-top: auto;
  align-self: flex-start;
}
.cs-ret .cs-cel {
  right: 14px;
  top: 24px;
  width: 92px;
  --cs-h: 240px;
}
.cs-ret .cs-aviso {
  right: -6px;
  top: 128px;
}

/* ---------- card nativo dentro da matéria ---------- */
.cs-card {
  margin: 28px 0;
}
.cs-card .cs-in {
  height: 180px;
  background: var(--cs-claro);
  color: #161616;
  border-left: 4px solid var(--cs-c);
  border-radius: 4px;
  padding: 16px 18px 16px 112px;
}
.cs-card .cs-cel {
  left: 26px;
  top: 16px;
  width: 70px;
  padding: 4px;
  border-radius: 13px;
  --cs-h: 190px;
}
.cs-card .cs-tela {
  border-radius: 9px;
}
.cs-card .cs-aviso {
  left: 30px;
  top: 104px;
  max-width: 120px;
  white-space: nowrap;
}
.cs-card .cs-txt {
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 100%;
}
.cs-card .cs-marca {
  color: var(--cs-c);
}
.cs-card .cs-tit {
  font-size: 18.5px;
  line-height: 1.22;
  -webkit-line-clamp: 2;
  color: #111;
}
.cs-card .cs-sub {
  font-size: 14px;
  line-height: 1.4;
  color: #3a3a3a;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.cs-card .cs-rod {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cs-card .cs-preco {
  color: #333;
  opacity: 1;
  font-weight: 600;
}
.cs-card .cs-bt {
  background: var(--cs-c);
  color: #fff;
  padding: 9px 14px;
}

/* ---------- faixa 728×90 (celular 320×100) ---------- */
.cs-faixa {
  margin: 28px auto;
}
.cs-faixa .cs-in {
  max-width: 728px;
  height: 90px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 0 20px 0 16px;
  background: linear-gradient(100deg, var(--cs-c), var(--cs-c2));
}
.cs-icw {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--cs-d);
  display: grid;
  place-items: center;
}
.cs-ic {
  width: 38px;
  height: 38px;
  overflow: visible;
}
.cs-faixa .cs-txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cs-faixa .cs-marca {
  color: rgba(255, 255, 255, 0.85);
}
.cs-faixa .cs-tit {
  font-size: 18px;
  line-height: 1.2;
  -webkit-line-clamp: 1;
}
.cs-bt-c {
  display: none;
}
.cs-faixa .cs-marca {
  white-space: nowrap;
}
.cs-envolve .cs-faixa {
  margin: 8px auto 28px;
}

@media (max-width: 600px) {
  .cs-faixa .cs-in {
    height: 100px;
    max-width: 420px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 12px;
  }
  .cs-icw {
    width: 44px;
    height: 44px;
  }
  .cs-ic {
    width: 30px;
    height: 30px;
  }
  .cs-faixa .cs-tit {
    font-size: 14.5px;
    -webkit-line-clamp: 2;
  }
  .cs-faixa .cs-preco {
    display: none;
  }
  .cs-faixa .cs-bt {
    font-size: 12px;
    padding: 8px 10px;
  }
  .cs-faixa .cs-bt-l {
    display: none;
  }
  .cs-faixa .cs-bt-c {
    display: inline;
  }
  .cs-card .cs-in {
    height: 206px;
    padding: 14px 14px 14px 94px;
  }
  .cs-card .cs-cel {
    left: 16px;
    width: 64px;
    --cs-h: 200px;
  }
  .cs-card .cs-aviso {
    display: none;
  }
  .cs-card .cs-sub {
    -webkit-line-clamp: 3;
  }
  .cs-card .cs-tit {
    font-size: 16.5px;
  }
  .cs-card .cs-sub {
    font-size: 13.5px;
  }
  .cs-card .cs-rod {
    gap: 8px;
  }
  .cs-card .cs-preco {
    font-size: 12px;
  }
}

/* tema escuro (botão do site) */
:root[data-tema='escuro'] .cs-card .cs-in {
  background: #1d1d1d;
  color: #eee;
  border-left-color: var(--cs-d);
}
:root[data-tema='escuro'] .cs-card .cs-tit {
  color: #f2f2f2;
}
:root[data-tema='escuro'] .cs-card .cs-sub,
:root[data-tema='escuro'] .cs-card .cs-preco {
  color: #c9c9c9;
}
:root[data-tema='escuro'] .cs-card .cs-marca {
  color: var(--cs-d);
}

/* prévia no painel */
.cs-previa {
  display: grid;
  gap: 8px;
}

/* ---------- animação (só com movimento liberado) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .cs-espera .cs-txt > *,
  .cs-espera .cs-cel,
  .cs-espera .cs-icw,
  .cs-espera .cs-in > .cs-bt {
    opacity: 0;
  }
  .vis .cs-txt > * {
    animation: cs-entra 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .vis .cs-txt > :nth-child(2) {
    animation-delay: 0.08s;
  }
  .vis .cs-txt > :nth-child(3) {
    animation-delay: 0.16s;
  }
  .vis .cs-txt > :nth-child(4) {
    animation-delay: 0.24s;
  }
  .vis .cs-in > .cs-bt {
    animation: cs-entra 0.6s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .vis .cs-cel {
    animation: cs-sobe 0.9s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .vis .cs-tela img {
    animation: cs-rola 7s 1.4s ease-in-out 2 alternate both;
  }
  .vis .cs-aviso {
    animation: cs-aviso 0.5s 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .vis .cs-bt::after {
    animation: cs-brilho 4.5s 1.2s ease-in-out 3;
  }
  .vis .cs-icw {
    animation: cs-entra 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .vis .cs-ck {
    stroke-dasharray: 32;
    animation: cs-traco 0.9s 0.7s ease-out both;
  }
  .vis .cs-onda {
    animation: cs-onda 1.8s 0.4s ease-in-out 4 both;
  }
  .vis .cs-o2 {
    animation-delay: 0.7s;
  }
  .vis .cs-l1,
  .vis .cs-l2 {
    transform-box: view-box;
    transform-origin: 22px 20px;
  }
  .vis .cs-l1 {
    animation: cs-corta1 1.2s 0.6s ease-in-out 3;
  }
  .vis .cs-l2 {
    animation: cs-corta2 1.2s 0.6s ease-in-out 3;
  }
  .vis .cs-pulso {
    transform-box: fill-box;
    transform-origin: center;
    animation: cs-pulso 1.6s 0.6s ease-in-out 4;
  }
  .vis .cs-lupa {
    animation: cs-lupa 2.4s 0.6s ease-in-out 4 alternate;
  }
}
@keyframes cs-entra {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes cs-sobe {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes cs-rola {
  0%,
  12% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(calc(-100% + var(--cs-h)));
  }
}
@keyframes cs-aviso {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes cs-brilho {
  0% {
    transform: translateX(-130%);
  }
  30%,
  100% {
    transform: translateX(130%);
  }
}
@keyframes cs-traco {
  from {
    stroke-dashoffset: 32;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes cs-onda {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}
@keyframes cs-corta1 {
  0%,
  100% {
    transform: none;
  }
  50% {
    transform: rotate(-9deg);
  }
}
@keyframes cs-corta2 {
  0%,
  100% {
    transform: none;
  }
  50% {
    transform: rotate(9deg);
  }
}
@keyframes cs-pulso {
  0%,
  100% {
    transform: none;
  }
  50% {
    transform: scale(1.25);
  }
}
@keyframes cs-lupa {
  from {
    transform: none;
  }
  to {
    transform: translateX(14px);
  }
}
