/* =========================================================
   TEMA DE NATAL — só vale quando <html class="tema-natal">
   (ligado em js/config.js → temaNatal.ativo).
   Desenhos em SVG embutido: nada é carregado de terceiros.
   ========================================================= */

.tema-natal {
  --natal-vermelho: #b3262e;
  --natal-vermelho-escuro: #861b22;
  --natal-vermelho-claro: #fbeeee;
  --natal-dourado: #c9a45c;
  --natal-dourado-claro: #f3e2b3;
  --natal-verde: #1f5f43;
}

/* ---------- Faixa do topo em vermelho natalino ---------- */
.tema-natal .faixa-transparencia { background: var(--natal-vermelho-escuro); }
.tema-natal .faixa-transparencia a { color: var(--natal-dourado-claro); }

/* ---------- Gorro de Papai Noel no logo ---------- */
.tema-natal .logo__marca { position: relative; overflow: visible; }
.tema-natal .logo__marca::after {
  content: "";
  position: absolute;
  top: -16px;
  left: -8px;
  width: 36px;
  height: 31px;
  transform: rotate(-16deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 30'%3E%3Cpath d='M6 22C8 12 15 4 24 5c4 1 6 5 5 10l-3-2c-1-3-4-3-6-2-4 2-6 7-7 11z' fill='%23c62828'/%3E%3Crect x='3' y='20.5' width='24' height='7' rx='3.5' fill='%23fff' stroke='%23d9d4cb'/%3E%3Ccircle cx='29' cy='16' r='3.8' fill='%23fff' stroke='%23d9d4cb'/%3E%3C/svg%3E") no-repeat center / contain;
  pointer-events: none;
}

/* ---------- Pisca-pisca pendurado no cabeçalho ---------- */
.luzes-natal {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 16px;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  pointer-events: none;
  z-index: 1;
}
.luz {
  position: relative;
  width: 8px;
  height: 11px;
  margin-top: 3px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  animation: natal-piscar 2.4s ease-in-out infinite;
}
.luz:nth-child(odd) { margin-top: 6px; }
.luz::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 1.5px;
  width: 5px;
  height: 4px;
  border-radius: 1px;
  background: #4a4a46;
}
.luz-0 { background: #e53935; --brilho: rgba(229, 57, 53, 0.75); }
.luz-1 { background: #fbc02d; --brilho: rgba(251, 192, 45, 0.8); animation-delay: 0.6s; }
.luz-2 { background: #43a047; --brilho: rgba(67, 160, 71, 0.75); animation-delay: 1.2s; }
.luz-3 { background: #42a5f5; --brilho: rgba(66, 165, 245, 0.75); animation-delay: 1.8s; }
@keyframes natal-piscar {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px 2px var(--brilho); }
  50% { opacity: 0.4; box-shadow: none; }
}
@media (max-width: 639px) { .luz:nth-child(n + 25) { display: none; } }

/* ---------- Navegação ---------- */
.tema-natal .navegacao .nav-natal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--natal-vermelho);
  font-weight: 700;
}
.tema-natal .navegacao .nav-natal svg { width: 18px; height: 18px; }
.tema-natal .navegacao .nav-natal[aria-current="page"] { border-bottom-color: var(--natal-vermelho); }
.tema-natal .botao-neve[aria-pressed="true"] { color: #2f6db0; }

/* ---------- Banner (página inicial) ---------- */
.tema-natal .hero__caixa { border: 2px solid #ead9ab; }
.tema-natal .hero__texto .sobretitulo { color: var(--natal-vermelho); }
.tema-natal .hero__imagem img { object-position: 62% center; }

.contagem-natal,
.hero__texto .contagem-natal {
  display: flex;
  width: fit-content;
  max-width: none;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--natal-vermelho);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}
.contagem-natal svg { width: 20px; height: 20px; color: var(--natal-dourado-claro); animation: natal-balancar 3s ease-in-out infinite; }

/* Bolas de Natal penduradas no banner */
.enfeites-pendurados { position: absolute; top: 0; left: 0; right: 0; height: 0; pointer-events: none; }
.enfeite {
  position: absolute;
  top: 0;
  width: 2px;
  height: var(--fio, 50px);
  background: rgba(255, 255, 255, 0.75);
  transform-origin: top center;
  animation: natal-balancar 3.6s ease-in-out infinite;
}
.enfeite::before {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 9px;
  height: 6px;
  margin-left: -4.5px;
  border-radius: 2px;
  background: linear-gradient(#ecd089, #a8823a);
}
.enfeite::after {
  content: "";
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  width: var(--bola, 26px);
  height: var(--bola, 26px);
  margin-left: calc(var(--bola, 26px) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.75) 0 12%, transparent 30%), var(--cor, #c62828);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}
.enfeite-1 { left: 7%; --fio: 46px; --cor: #c62828; --bola: 28px; }
.enfeite-2 { left: 19%; --fio: 82px; --cor: #d4a537; --bola: 22px; animation-delay: -1.2s; animation-duration: 4.2s; }
.enfeite-3 { left: 31%; --fio: 34px; --cor: #2e7d4f; --bola: 24px; animation-delay: -2.1s; }
.enfeite-4 { right: 6%; --fio: 60px; --cor: #c62828; --bola: 26px; animation-delay: -0.6s; animation-duration: 3.9s; }

@keyframes natal-balancar {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

/* ---------- Ramo de azevinho nos títulos ---------- */
.tema-natal .secao__topo h2::before,
.tema-natal .cabecalho-pagina h1::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 26px;
  margin-right: 8px;
  vertical-align: -3px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 28'%3E%3Cpath d='M15 15C10 8 4 9 2 4c4 1 5-2 7-3 1 4 4 5 6 8-1 2 0 4 0 6z' fill='%232e7d4f'/%3E%3Cpath d='M17 15c5-7 11-6 13-11-4 1-5-2-7-3-1 4-4 5-6 8 1 2 0 4 0 6z' fill='%231f5f43'/%3E%3Ccircle cx='13' cy='19' r='3.4' fill='%23c62828'/%3E%3Ccircle cx='19' cy='19' r='3.4' fill='%23d32f2f'/%3E%3Ccircle cx='16' cy='24' r='3.4' fill='%23b71c1c'/%3E%3C/svg%3E") no-repeat center / contain;
}
.tema-natal .cabecalho-pagina h1::before { width: 34px; height: 30px; }

/* ---------- Seção "Presentes de Natal" ---------- */
.tema-natal .secao-presentes {
  position: relative;
  margin-block: 24px;
  padding-block: 40px 36px;
  background: var(--natal-vermelho-claro);
  border-bottom: 1px solid #f0d3d3;
}
.tema-natal .secao-presentes::before {
  /* listras de bengala doce */
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: repeating-linear-gradient(-45deg, var(--natal-vermelho) 0 14px, #fff 14px 28px);
}
.tema-natal .secao-presentes .secao__topo p { color: #6b3a3d; }

/* ---------- Categorias viram bolas de Natal ---------- */
.tema-natal .cartao-categoria__icone {
  position: relative;
  overflow: visible;
  margin-top: 8px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--natal-dourado);
  transform-origin: 50% -16px;
}
.tema-natal .cartao-categoria__icone::before {
  /* tampa dourada */
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 14px;
  height: 8px;
  margin-left: -7px;
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(#ecd089, #a8823a);
}
.tema-natal .cartao-categoria__icone::after {
  /* argola */
  content: "";
  position: absolute;
  top: -18px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border: 2px solid #a8823a;
  border-radius: 50%;
}
.tema-natal .cartao-categoria:hover { border-color: var(--natal-vermelho); }
.tema-natal .cartao-categoria:hover .cartao-categoria__icone { animation: natal-balancar-bola 1.2s ease-in-out; }
@keyframes natal-balancar-bola {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(9deg); }
  60% { transform: rotate(-6deg); }
  85% { transform: rotate(2deg); }
}

/* ---------- Produtos ---------- */
.tema-natal .selo-oferta { background: var(--natal-vermelho); }
.tema-natal .cartao-produto:hover { border-color: #e2b8b8; }

.dica-natal {
  display: flex;
  gap: 10px;
  margin: 12px 0 0;
  padding: 12px;
  border-radius: var(--raio-p);
  background: var(--natal-vermelho-claro);
  color: #6f171d;
  font-size: 0.9rem;
}
.dica-natal svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--natal-vermelho); }

/* ---------- Rodapé com neve acumulada ---------- */
.tema-natal .rodape { position: relative; }
.tema-natal .rodape::before {
  content: "";
  position: absolute;
  top: -19px;
  left: 0;
  right: 0;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20V12C10 4 25 4 35 11c10-8 27-9 40-1 13-6 25-5 35 2 12-9 30-8 50 0v8z' fill='%23fff'/%3E%3C/svg%3E") repeat-x bottom / 160px 20px;
  filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.06));
  pointer-events: none;
}
.boas-festas {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--natal-dourado-claro) !important;
  font-size: 0.95rem;
  font-weight: 600;
}
.boas-festas svg { width: 20px; height: 20px; flex: none; }

/* ---------- Neve ---------- */
.neve {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 45; /* passa por trás do cabeçalho e de avisos/janelas */
}
.sem-neve .neve { display: none; }
.floco {
  position: absolute;
  top: -20px;
  border-radius: 50%;
  background: #b4c6dc;
  box-shadow: 0 0 3px rgba(255, 255, 255, 0.9);
  animation-name: natal-cair;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}
.floco-estrela {
  border-radius: 0;
  box-shadow: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239fb6d3' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M3.3 17L20.7 7M9.5 3.5L12 6l2.5-2.5M9.5 20.5L12 18l2.5 2.5'/%3E%3C/svg%3E") no-repeat center / contain;
}
@keyframes natal-cair {
  from { transform: translate3d(0, -20px, 0) rotate(0deg); }
  to { transform: translate3d(var(--deriva, 0px), 105vh, 0) rotate(200deg); }
}

/* Quem pediu menos movimento no aparelho: sem neve e sem balanço */
@media (prefers-reduced-motion: reduce) {
  .neve { display: none; }
}

/* ---------------- Fundos que o visitante escolhe (botão "Fundo") ---------------- */
.tema-natal.fundo-neve { --fundo: #edf3fa; }
.tema-natal.fundo-neve body {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 2px, transparent 2.5px),
    radial-gradient(circle, rgba(159, 182, 211, 0.45) 0 1.5px, transparent 2px);
  background-size: 46px 46px, 31px 31px;
  background-position: 0 0, 15px 20px;
}
.tema-natal.fundo-vermelho { --fundo: #fbeeee; }
.tema-natal.fundo-vermelho body {
  background-image: repeating-linear-gradient(-45deg, rgba(198, 40, 40, 0.06) 0 12px, transparent 12px 24px);
}
.tema-natal.fundo-verde { --fundo: #edf4ef; }
.tema-natal.fundo-verde body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath d='M30 14l7 10h-4l6 9H21l6-9h-4z' fill='%232e7d4f' fill-opacity='.1'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}
.tema-natal.fundo-dourado { --fundo: #fbf6ea; }
.tema-natal.fundo-dourado body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cpath d='M25 17l2 6h6l-5 4 2 6-5-4-5 4 2-6-5-4h6z' fill='%23c9a14a' fill-opacity='.22'/%3E%3C/svg%3E");
  background-size: 50px 50px;
}
.tema-natal .botao-fundo svg { color: var(--natal-vermelho); }
