* { box-sizing: border-box; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #fff;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* Empurra o rodapé "Criado com Afiplace" pro fim da tela em páginas com pouco
   conteúdo (ex: produto sem relacionados) — sem isso ele ficava solto no meio. */
#loja-grid-view, #loja-detail-view { flex: 1 0 auto; }
#afiplace-branding { margin-top: auto; }

.store-topbar {
  background: #000;
  color: #fff;
  padding: 14px clamp(1rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}
.store-owner-link {
  position: absolute;
  top: 12px;
  right: clamp(1rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,.12);
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  transition: background .15s ease;
}
.store-owner-link img { display: block; width: 16px; height: 16px; }
.store-owner-link:hover { background: rgba(255,255,255,.22); }
@media (max-width: 640px) {
  .store-owner-link { top: 8px; right: 10px; padding: 5px 10px; font-size: 10.5px; gap: 4px; }
  .store-owner-link img { width: 13px; height: 13px; }
}
.store-home-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.store-topbar .store-logo {
  width: 110px; height: 110px; border-radius: 50%; background: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.store-topbar .store-logo img { width: 100%; height: 100%; object-fit: cover; }
.store-topbar h1 { font-size: 16px; margin: 0; font-weight: 700; }

.loja-loading, .loja-empty, .loja-error {
  padding: 80px 20px; text-align: center; color: #8a93a6; font-size: 14px;
}
.products-grid .loja-empty { grid-column: 1 / -1; }
.loja-error { color: #d9534f; }

/* Rodapé da loja: descrição + redes sociais (antes ficava numa barra no topo). */
.loja-footer {
  padding: 28px clamp(1rem, 3vw, 2rem) 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.store-info-description {
  font-size: 13px;
  color: inherit;
  opacity: 0.85;
  max-width: 640px;
}
.store-info-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.store-info-socials a {
  color: inherit;
  font-size: 22px;
  line-height: 1;
  opacity: 0.85;
  transition: opacity 0.15s, transform 0.15s;
}
.store-info-socials a:hover { opacity: 1; transform: translateY(-2px); }

/* Botões flutuantes de WhatsApp/Telegram — sempre visíveis, canto inferior direito. */
#loja-float-actions {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.loja-float-label {
  background: #fff;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  white-space: nowrap;
  pointer-events: none;
}
.loja-float-row { display: flex; flex-direction: row; gap: 10px; }
.loja-float-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
  transition: transform .15s, box-shadow .15s, bottom .2s;
}
.loja-float-btn:hover { transform: scale(1.07); box-shadow: 0 5px 16px rgba(0,0,0,.3); }
.loja-float-btn:active { transform: scale(.96); }
.loja-float-btn.is-whatsapp { background: #25d366; }
.loja-float-btn.is-telegram { background: #229ed9; }
@media (max-width: 640px) {
  .loja-float-btn { width: 40px; height: 40px; font-size: 19px; }
  /* Na página de produto (mobile) o botão "Comprar agora" fica fixo no rodapé —
     sobe os flutuantes pra não ficar em cima dele. */
  body.is-detail-view #loja-float-actions { bottom: 84px; }
}

.products-container .departments-section { padding-left: 0; padding-right: 0; }
.products-container .departments-container { padding: 0; max-width: 100%; }
.products-container .departments-carousel-wrapper { margin-top: 1rem; }

.banner-templates-slot { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.banner-tpl { width: 100%; border-radius: 0; overflow: hidden; }
.banner-tpl img, .banner-tpl video { display: block; width: 100%; height: 100%; object-fit: cover; }
.banner-tpl a { display: block; height: 100%; }
.banner-tpl-cell { border-radius: 0; overflow: hidden; height: 100%; }

.banner-tpl--full { aspect-ratio: 3 / 1; background: #000; }
.banner-tpl--full .banner-tpl-cell { height: 100%; }
.banner-tpl--full .banner-tpl-cell img, .banner-tpl--full .banner-tpl-cell video { width: 100%; height: 100%; object-fit: cover; }

.banner-tpl--duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; aspect-ratio: 5.5 / 1; }
.banner-tpl--duo .banner-tpl-cell { height: 100%; }

.banner-tpl--triplo { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; aspect-ratio: 3 / 1; }
.banner-tpl--triplo .banner-tpl-cell--big { height: 100%; }
.banner-tpl-cell-stack { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.banner-tpl-cell-stack .banner-tpl-cell { flex: 1; min-height: 0; }

/* Triplo-vertical: full-width, sem espaço entre os banners nem nas laterais. */
.banner-tpl--triplo-vertical { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; aspect-ratio: 3 / 1; }
.banner-tpl--triplo-vertical .banner-tpl-cell { height: 100%; }

.banner-tpl--lateral { aspect-ratio: 1 / 1.4; }
.banner-tpl--lateral .banner-tpl-cell { aspect-ratio: 1 / 1.4; }

.banner-tpl--carousel { position: relative; aspect-ratio: 4 / 1; }
.banner-tpl--carousel .banner-carousel-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
.banner-tpl--carousel .banner-carousel-slide.active { opacity: 1; position: relative; z-index: 1; }
.banner-tpl--carousel .banner-tpl-cell { height: 100%; }

/* Bloco com mais de 1 imagem (ex.: banner duplo) — mini carrossel dentro da própria célula,
   mesma lógica de troca do banner-tpl--carousel, só que por bloco em vez da faixa inteira. */
.banner-tpl-cell-rotating { position: relative; height: 100%; }
.banner-tpl-cell-rotating .banner-carousel-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
.banner-tpl-cell-rotating .banner-carousel-slide.active { opacity: 1; position: relative; z-index: 1; }

@media (max-width: 768px) {
  .store-topbar h1 { font-size: 13px; }
  .store-topbar .store-logo { width: 78px; height: 78px; }
  .banner-tpl--duo, .banner-tpl--triplo { grid-template-columns: 1fr; }
  .banner-tpl--carousel { aspect-ratio: 16 / 9; }
  .banner-tpl--full { aspect-ratio: auto; }
  .banner-tpl--full .banner-tpl-cell { height: auto; }
  .banner-tpl--full { background: transparent; }
  .banner-tpl--full .banner-tpl-cell img, .banner-tpl--full .banner-tpl-cell video { width: 100%; height: auto; max-height: none; object-fit: contain; }
}
