/* ======================================================
   AdManager Pro - Frontend Ad Styles v1.2
   ====================================================== */

.amp-ad {
  position: relative;
  display: block;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-sizing: border-box;
  /* Centralizar quando inserido via shortcode inline */
  margin-left: auto;
  margin-right: auto;
}
.amp-ad * { box-sizing: border-box; }

.amp-ad-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.amp-ad-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.amp-ad-label {
  position: absolute;
  top: 4px; right: 6px;
  font-size: 9px;
  color: rgba(0,0,0,.4);
  background: rgba(255,255,255,.75);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .5px;
  text-transform: uppercase;
  font-family: sans-serif;
  pointer-events: none;
  z-index: 10;
  line-height: 1.6;
}

/* ─── IMAGEM ──────────────────────────────────── */
.amp-image-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
  line-height: 0;
  position: absolute;
  inset: 0;
}
.amp-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover; /* preenche o container mantendo proporção */
  object-position: center;
}

/* ─── CARROSSEL ───────────────────────────────── */
.amp-carousel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  line-height: 0;
}
.amp-carousel-track {
  display: flex;
  height: 100%;
  transition: transform .45s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.amp-carousel-item {
  min-width: 100%;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.amp-carousel-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
.amp-carousel-prev,
.amp-carousel-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45); color: #fff; border: none;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 20px; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; line-height: 1; padding: 0;
}
.amp-carousel-prev:hover, .amp-carousel-next:hover { background: rgba(0,0,0,.7); }
.amp-carousel-prev { left: 8px; }
.amp-carousel-next { right: 8px; }
.amp-carousel-dots {
  display: flex; justify-content: center; gap: 6px;
  padding: 8px 0 4px; background: transparent;
}
.amp-carousel-dots span {
  width: 7px; height: 7px;
  background: rgba(0,0,0,.2); border-radius: 50%;
  cursor: pointer; transition: background .2s; display: inline-block;
}
.amp-carousel-dots span.active { background: rgba(0,0,0,.6); }

/* ─── VÍDEO ───────────────────────────────────── */
.amp-video-wrap { position: relative; width: 100%; overflow: hidden; background: #000; }
.amp-video-wrap video { width: 100%; height: auto; display: block; }
.amp-video-wrap.amp-video-embed { padding-bottom: 56.25%; height: 0; }
.amp-video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ─── TEXTO ───────────────────────────────────── */
.amp-text-content {
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.amp-headline    { font-size: 16px; font-weight: 800; line-height: 1.25; margin: 0; }
.amp-subtitle    { font-size: 13px; font-weight: 600; opacity: .75; margin: 0; }
.amp-description { font-size: 12px; line-height: 1.5; opacity: .65; margin: 0; }
.amp-cta-btn {
  display: inline-block; padding: 8px 18px; border-radius: 24px;
  font-size: 13px; font-weight: 700; margin-top: 6px; cursor: pointer;
  align-self: flex-start; transition: opacity .15s, transform .15s;
  text-decoration: none;
}
.amp-ad-link:hover .amp-cta-btn { opacity: .88; transform: translateY(-1px); }

/* ─── LAYOUTS FLEX ROW ────────────────────────── */
.amp-layout-image-left .amp-ad-inner,
.amp-layout-image-right .amp-ad-inner { flex-direction: row; align-items: stretch; }
.amp-flex-row { display: flex; width: 100%; align-items: stretch; }
.amp-flex-row .amp-image-wrap,
.amp-flex-row .amp-carousel { flex: 0 0 45%; max-width: 45%; }
.amp-flex-row .amp-image-wrap img,
.amp-flex-row .amp-carousel-item img { height: 100%; object-fit: contain; }
.amp-flex-row .amp-text-content { flex: 1; min-width: 0; }

/* ─── LAYOUT IMAGEM DE FUNDO ──────────────────── */
.amp-layout-image-background .amp-ad-inner { position: relative; }
.amp-bg-media { position: absolute; inset: 0; z-index: 0; }
.amp-bg-media img,
.amp-bg-media .amp-carousel,
.amp-bg-media .amp-carousel-track,
.amp-bg-media .amp-carousel-item,
.amp-bg-media video { width: 100% !important; height: 100% !important; object-fit: cover; }
.amp-bg-media .amp-image-wrap { height: 100%; }
.amp-bg-media .amp-image-wrap img { height: 100%; object-fit: cover; }
.amp-overlay-text {
  position: relative; z-index: 2;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,.1) 70%, transparent 100%);
  padding: 32px 16px 16px; display: flex; flex-direction: column; justify-content: flex-end;
}
.amp-layout-image-background .amp-overlay-text .amp-headline { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.amp-layout-image-background .amp-overlay-text .amp-subtitle,
.amp-layout-image-background .amp-overlay-text .amp-description { color: rgba(255,255,255,.88); }

/* ─── ANIMAÇÕES ───────────────────────────────── */
.amp-anim-fade      { animation: ampFadeIn .6s ease both; }
.amp-anim-slide-up  { animation: ampSlideUp .5s ease both; }
.amp-anim-slide-down{ animation: ampSlideDown .5s ease both; }
.amp-anim-zoom      { animation: ampZoom .4s ease both; }
.amp-anim-bounce    { animation: ampBounce .7s cubic-bezier(.36,.07,.19,.97) both; }
.amp-anim-flip      { animation: ampFlip .5s ease both; }

@keyframes ampFadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes ampSlideUp  { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }
@keyframes ampSlideDown{ from { opacity:0; transform:translateY(-20px); } to { opacity:1; transform:none; } }
@keyframes ampZoom     { from { opacity:0; transform:scale(.85); } to { opacity:1; transform:none; } }
@keyframes ampBounce {
  0%,100%{transform:translateY(0);}
  20%{transform:translateY(-8px);}
  40%{transform:translateY(4px);}
  60%{transform:translateY(-3px);}
  80%{transform:translateY(1px);}
}
@keyframes ampFlip { from{transform:perspective(400px) rotateY(-90deg);opacity:0;} to{transform:none;opacity:1;} }

/* ─── CTA OVERLAY (sobre imagem) ─────────────────── */
/* Wrapper da mídia com overlay — ocupa todo o espaço disponível */
.amp-media-with-cta {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Overlay absolutamente posicionado sobre a imagem */
.amp-media-with-cta .amp-cta-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.6) 0%, transparent 100%);
  line-height: 1.3;
  flex-wrap: nowrap;
}

/* Texto título/subtítulo dentro do overlay */
.amp-cta-text-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.amp-cta-headline {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
  display: block;
}
.amp-cta-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,.88);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
  display: block;
}

/* Botão CTA dentro do overlay */
.amp-media-with-cta .amp-cta-btn {
  display: inline-block;
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  transition: opacity .15s, transform .15s;
  margin-top: 0;
}
.amp-ad-link:hover .amp-media-with-cta .amp-cta-btn {
  opacity: .9;
  transform: translateY(-1px);
}

/* Caso sem título/subtítulo: só o botão centralizado */
.amp-cta-overlay:not(:has(.amp-cta-text-line)) {
  justify-content: center;
}
