/* ===================================================
   HEADER TIKTOK SHOP - PÁGINA INICIAL APENAS
   Injetado apenas em window.location.pathname === "/"
   =================================================== */

@font-face {
  font-family: "Sagona Book";
  src: url("/fonts/SAGONABOOK.TTF") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* Ocultar header original na página inicial */
body.home-tiktok-active .header {
  display: none !important;
}

/* Ocultar store-section original na página inicial */
body.home-tiktok-active .store-section {
  display: none !important;
}

/* Remover padding/gap entre header e conteúdo */
body.home-tiktok-active .container {
  padding-top: 0 !important;
  gap: 0 !important;
}

/* Coupons container: ocultar os dois coupon-cards na home (substituído por Ofertas de boas-vindas) */
body.home-tiktok-active .coupons-container {
  display: none !important;
}

/* Remover margin-top do conteúdo */
body.home-tiktok-active .main-content,
body.home-tiktok-active [class*="main-"],
body.home-tiktok-active .container > div:not(.tiktok-header-wrapper) {
  margin-top: 0 !important;
}

/* Fundo da loja inicial: claro; faixa do topo (atrás do header + ofertas) com gradient marrom */
body.home-tiktok-active,
body.home-tiktok-active .container {
  background: #f1f3f5 !important;
}

/* Ao abrir: overlay branco sobre tudo até o conteúdo estar pronto (evita marrom em tela cheia) */
body.home-tiktok-active::before {
  content: '';
  position: fixed;
  inset: 0;
  background: #f1f3f5;
  z-index: 9999;
  pointer-events: none;
}
body.home-tiktok-active.home-tiktok-ready::before {
  display: none;
}

/* Ícone de carregamento do app deve ficar acima do overlay branco */
body.home-tiktok-active:not(.home-tiktok-ready) .loading-container {
  position: fixed !important;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

/* Container: fundo claro; sem faixa marrom – banner é só a imagem */
body.home-tiktok-active .container {
  position: relative !important;
}

body.home-tiktok-active .container > * {
  position: relative;
  z-index: 1;
}

/* Filtros da aba Produtos: ficar no fluxo no espaço acima da lista (não sticky, não sobrepor) */
body.home-tiktok-active .filter-chips {
  position: relative !important;
  top: auto !important;
}

/* Não exibir faixa marrom abaixo do nav-tabs em nenhuma aba (igual Página Inicial) */
body.home-tiktok-active .nav-tabs::before {
  display: none !important;
}

/* ===================================================
   WRAPPER PRINCIPAL - altura definida pela imagem do banner (sem gradient)
   =================================================== */
.tiktok-header-wrapper {
  width: 100%;
  position: relative;
  padding-bottom: 0;
  margin-bottom: 0.5cm;
  box-sizing: border-box;
}

/* Picture do banner (preferir WebP para carregamento mais rápido, sem "frames") */
.tiktok-banner-picture {
  display: block;
  width: 100%;
  line-height: 0;
}

/* Banner como img no fluxo: define a altura do wrapper; imagem inteira, 100% largura, conteúdo abaixo desce */
.tiktok-banner-img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* ===================================================
   BARRA DE NAVEGAÇÃO SUPERIOR - 100% responsiva
   Centro com scroll horizontal; LIVE e Carrinho fixos, sem sobreposição
   =================================================== */
.tiktok-nav-bar {
  display: flex;
  align-items: center;
  padding: 10px 6px 8px 6px;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  z-index: 1;
}

/* LIVE - fixo à esquerda, não encolhe */
.tiktok-live-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
}

.tiktok-live-img {
  width: 48px;
  height: 31px;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
}

/* Links: área central mais larga, agrupada e próxima aos ícones (LIVE e carrinho) */
.tiktok-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex: 1 1 0;
  min-width: 0;
  height: 32px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 4px;
  margin: 0;
}

.tiktok-nav-links::-webkit-scrollbar {
  display: none;
}

.tiktok-nav-link {
  font-size: 14px;
  font-weight: 400;
  line-height: 32px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  padding: 0 2px;
  border-bottom: 2.5px solid transparent;
  font-family: "TikTok Sans", sans-serif;
  background: none;
  outline: none;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  margin: 0;
  box-sizing: border-box;
  position: relative;
}

/* Efeito fade no primeiro link (Explorar) - gradiente suave da esquerda */
.tiktok-nav-link:first-child {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.2) 12%, rgba(0,0,0,0.5) 25%, rgba(0,0,0,0.75) 40%, rgba(0,0,0,1) 55%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.2) 12%, rgba(0,0,0,0.5) 25%, rgba(0,0,0,0.75) 40%, rgba(0,0,0,1) 55%);
}

/* Links inativos normais (2o em diante, exceto .active) */
.tiktok-nav-link:nth-child(n+2):not(.active) {
  color: rgba(255, 255, 255, 0.6); /* Branco com opacidade */
}

/* Loja ativo: texto branco e sublinhado branco em largura total (::after para não cortar) */
.tiktok-nav-link.active {
  font-weight: 700;
  color: #fff;
  border-bottom-color: transparent;
  font-size: 14px;
  letter-spacing: 0.2px;
  line-height: 32px;
}
.tiktok-nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  background: #fff;
  border-radius: 0;
}

.tiktok-nav-link.location {
  color: rgba(255, 255, 255, 0.6); /* Branco com opacidade */
}

/* Carrinho: fixo à direita, nunca encolhe e não sobrepõe os links */
.tiktok-cart-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin: 0 0 0 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
}

.tiktok-cart-svg {
  width: 26px;
  height: 26px;
  stroke: #fff;
  stroke-width: 2;
}

.tiktok-cart-badge {
  position: absolute;
  top: 3px;
  right: 2px;
  background: #5C2818;
  color: #fff;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  font-family: "TikTok Sans", sans-serif;
  border: 2px solid #fff;
  padding: 0;
  min-width: 16px;
}

/* Ajuste fino em telas muito estreitas; layout (scroll) e alinhamento mantidos */
@media (max-width: 360px) {
  .tiktok-nav-bar { padding: 8px 4px 6px 4px; gap: 4px; }
  .tiktok-nav-links { gap: 10px; height: 30px; padding: 0 4px; }
  .tiktok-nav-link { font-size: 13px; line-height: 30px; }
  .tiktok-nav-link.active { font-size: 13px; line-height: 30px; }
  .tiktok-live-img { width: 42px; height: 28px; }
  .tiktok-cart-svg { width: 24px; height: 24px; }
  .tiktok-cart-btn { padding: 4px; margin-left: 2px; }
}

/* Padrão responsivo: telas médias (entre 361px e 480px) – links mais esticados, perto dos ícones */
@media (min-width: 361px) and (max-width: 480px) {
  .tiktok-nav-links { gap: 12px; padding: 0 4px; }
  .tiktok-nav-link { font-size: 13px; }
  .tiktok-nav-link.active { font-size: 13px; }
}

/* ===================================================
   BARRA DE BUSCA TIKTOK
   Grande, borda preta grossa, botão preto à direita
   =================================================== */
.tiktok-search-bar {
  display: flex;
  align-items: center;
  margin: 0 12px 14px 12px;
  background: #fff;
  border: 2.5px solid #111;
  border-radius: 10px;
  overflow: visible;
  padding: 0 8px 0 14px;
  gap: 8px;
  height: 40px;
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  z-index: 1;
}

.tiktok-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tiktok-search-icon svg {
  width: 22px;
  height: 22px;
}

.tiktok-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-size: 15px;
  color: #333;
  font-family: "TikTok Sans", sans-serif;
  min-width: 0;
}

.tiktok-search-input::placeholder {
  color: #999;
  font-size: 15px;
}

.tiktok-search-btn {
  background: #3D2012;
  color: #fff;
  border: none;
  padding: 0 16px;
  height: 31px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: "TikTok Sans", sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.2px;
  border-radius: 6px;
  margin: -3px;
  transition: background 0.15s;
}

.tiktok-search-btn:hover {
  background: #4A2818; /* Marrom um pouco mais claro no hover */
}

/* ===================================================
   OFERTAS DE BOAS-VINDAS - container (popup/card) com margens laterais e rosinha+branco
   Cupons novos clientes: backup do bloco 4 produtos em backup-ofertas-4produtos-ORIGINAL.md
   =================================================== */
.ofertas-boas-vindas {
  margin-top: -226px;
  margin-left: 12px;
  margin-right: 12px;
  border-radius: 24px 24px 0 0;
  position: relative;
  z-index: 2;
  padding: 12px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  background-color: #fff;
}

/* Versão Cupons novos clientes: só posição em camada para ficar por cima da imagem do banner */
.ofertas-boas-vindas.cupons-novos-clientes {
  background: #fff;
  box-shadow: none;
  padding: 10px;
  border-radius: 24px;
  overflow: visible;
  margin-bottom: 22px;
  position: relative;
  z-index: 3;
}

/* Container dos cupons novos clientes – padding uniforme L/R/topo para alinhar título e tickets; mínimo embaixo */
.cupons-novos-clientes-inner {
  background: linear-gradient(135deg, #5C2818 0%, #7D3520 40%, #9B4A30 70%, #7D3520 100%);
  border-radius: 14px;
  padding: 8px 8px 2px 8px;
  width: 100%;
  font-family: "TikTok Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  position: relative;
  overflow: hidden;
  user-select: none;
  box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(125, 53, 32, 0.4);
}

/* Título "Cupons novos clientes": fonte branca (fundo marrom), sobrescreve .page-inicial h2 */
.page-inicial .cupons-novos-clientes-inner .cupons-titulo,
.cupons-novos-clientes-inner .cupons-titulo {
  color: #fff !important;
  font-family: "Sagona Book", sans-serif;
  font-size: 15px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: visible !important;
  text-overflow: clip !important;
  min-width: 0;
  flex: 1 1 auto;
  position: relative;
  z-index: 1;
}

/* Botão "Resgatar tudo": fonte marrom e um pouco maior */
.cupons-resgatar-btn {
  font-family: "Sagona Book", sans-serif;
  color: #5C2818 !important;
  font-size: 13px !important;
}

/* Cupons da home: ticket SVG com recorte lateral (estilo Gemini), tema Cacau Show */
.cupons-scroll {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 5px !important;
}
.cupom-ticket-wrap {
  line-height: 0;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}
.cupom-ticket-svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  vertical-align: top;
}
.cupons-novos-clientes-inner .coupon-card::before,
.cupons-novos-clientes-inner .coupon-card::after {
  display: none !important;
}
.cupons-novos-clientes-inner .cupom-ticket-wrap.coupon-card {
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.cupons-novos-clientes-inner .coupon-title,
.cupons-novos-clientes-inner .coupon-subtitle {
  color: #5C2818 !important;
}

/* Ícone TikTok de fundo no header dos cupons: maior, não encosta no topo, posição 64%, máscara no rodapé */
.cupons-header-row .cupons-tiktok-logo-bg {
  position: absolute;
  left: 64%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  opacity: 0.42;
  fill: #fff;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 79%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 79%);
}

.ofertas-boas-vindas-title-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  margin-bottom: 0;
  border-radius: 15px 20px 0 0;
}

.ofertas-cards-row {
  display: flex;
  gap: 8px;
  padding: 0;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.oferta-card {
  flex: 1 1 0;
  min-width: 0;
  /* background: #f5f5f5; */
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); */
  border: none;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s, box-shadow 0.15s;
}

.oferta-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.oferta-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ebebeb;
  overflow: hidden;
  border-radius: 13px 13px 18px 18px;
}

.oferta-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.oferta-card-badge {
  position: absolute;
  bottom: 0px;
  left: -15px;
  background: #ff2b56;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 32px;
  border-radius: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.oferta-card-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: #fff;
  display: block;
  margin: 0;
}

.oferta-card-info {
  padding: 8px 10px 10px;
}

.oferta-card-price {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin: 0 0 2px 0;
  padding: 0;
  line-height: 1.2;
  display: block;
  text-align: left;
  letter-spacing: -2px;
}

.oferta-card-old-price {
  font-size: 12px;
  color: #888;
  text-decoration: line-through;
  line-height: 1.2;
  margin: 0;
  padding: 0;
  display: block;
  text-align: left;
  letter-spacing: -1px;
}
