/* ═══════════════════════════════════════════════════════════════
   SmartPesca Público — campanhas.css
   Banners de anunciantes (SmartPesca Ads). Visual discreto e
   integrado ao tema do site (usa as variáveis de style.css).
   Os containers só existem no DOM quando há criativo ativo.
════════════════════════════════════════════════════════════════ */

/* ─── Linha que envolve um banner ancorado em uma seção ──────── */
.sp-cmp-row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 24px 16px;
  box-sizing: border-box;
}

/* ─── Container do banner ─────────────────────────────────────── */
.sp-cmp {
  --sp-cmp-w: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: var(--sp-cmp-w);
  max-width: 100%;
  box-sizing: border-box;
}

.sp-cmp__label {
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 0.85;
  user-select: none;
}

.sp-cmp__link {
  display: block;
  width: 100%;
  line-height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: box-shadow var(--transition), transform var(--transition);
}
.sp-cmp__link:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14); }
.sp-cmp__link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.sp-cmp__link[aria-disabled="true"] { cursor: default; }

.sp-cmp__img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ─── Sidebar fixa (apenas desktop largo, controlado também via JS) ── */
.sp-cmp--sidebar {
  position: fixed;
  top: calc(var(--nav-h) + 16px);
  right: 16px;
  z-index: 900;
  margin: 0;
}
.sp-cmp--sidebar.sp-cmp--side-left { right: auto; left: 16px; }
.sp-cmp--sidebar .sp-cmp__link { box-shadow: var(--shadow); }

@media (max-width: 1539px) {
  .sp-cmp--sidebar { display: none !important; }
}

/* ─── Sticky no rodapé (mobile) ───────────────────────────────── */
.sp-cmp--sticky_bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  z-index: 980; /* abaixo de .whatsapp-btn (990) e dos modais */
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 6px 8px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
}
.sp-cmp--sticky_bottom .sp-cmp__label {
  position: absolute;
  top: 2px;
  left: 8px;
  font-size: 8px;
  letter-spacing: 0.08em;
}
.sp-cmp--sticky_bottom .sp-cmp__link {
  width: auto;
  max-width: calc(100% - 16px);
  box-shadow: none;
  border-radius: 6px;
}
.sp-cmp--sticky_bottom .sp-cmp__img {
  width: auto;
  max-width: 100%;
  max-height: 60px;
  border-radius: 6px;
}

.sp-cmp__close {
  position: absolute;
  top: -12px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-bg-card);
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: color var(--transition), transform var(--transition);
}
.sp-cmp__close:hover { color: var(--color-text); transform: scale(1.08); }
.sp-cmp__close:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }

/* Reserva espaço no fim da página e eleva os botões flutuantes
   enquanto o sticky está visível (classe aplicada pelo JS). */
body.sp-cmp-sticky-visible {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
body.sp-cmp-sticky-visible .whatsapp-btn { bottom: calc(28px + 56px); }
body.sp-cmp-sticky-visible .back-top { bottom: calc(100px + 56px); }

@media (max-width: 600px) {
  body.sp-cmp-sticky-visible .whatsapp-btn { bottom: calc(20px + 56px); }
  body.sp-cmp-sticky-visible .back-top { bottom: calc(82px + 56px); }
}

/* ─── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sp-cmp-row { padding: 16px 12px; }
}

@media print {
  .sp-cmp-row, .sp-cmp { display: none !important; }
  body.sp-cmp-sticky-visible { padding-bottom: 0; }
}

/* ─── Aviso de bloqueador de anúncios ─────────────────────────── */
#sp-adblock-notice .sp-abn-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  color: #1a1a1a;
  border-radius: 18px;
  padding: 32px 28px 26px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: sp-abn-in 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes sp-abn-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
#sp-adblock-notice .sp-abn-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(45, 106, 79, 0.12);
  color: #2D6A4F;
}
#sp-adblock-notice h2 {
  font-size: 1.35rem; font-weight: 800; margin: 0 0 10px;
  font-family: var(--font-heading, Georgia, serif); color: #111827;
}
#sp-adblock-notice p {
  font-size: 0.95rem; line-height: 1.55; color: #4b5563; margin: 0 0 22px;
}
#sp-adblock-notice .sp-abn-actions { display: flex; flex-direction: column; gap: 10px; }
#sp-adblock-notice .sp-abn-btn {
  width: 100%; padding: 12px 18px; border-radius: 12px;
  font-size: 0.95rem; font-weight: 700; cursor: pointer; border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
#sp-adblock-notice .sp-abn-primary { background: #2D6A4F; color: #fff; }
#sp-adblock-notice .sp-abn-primary:hover { background: #245a42; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(45, 106, 79, 0.3); }
#sp-adblock-notice .sp-abn-ghost { background: transparent; color: #6b7280; font-weight: 600; }
#sp-adblock-notice .sp-abn-ghost:hover { background: rgba(0, 0, 0, 0.05); color: #374151; }
@media (max-width: 480px) {
  #sp-adblock-notice .sp-abn-card { padding: 26px 20px 20px; border-radius: 16px; }
  #sp-adblock-notice h2 { font-size: 1.2rem; }
}
