/* ============================================================
   ToolsCraftt Ads — estilos del modal de anuncio patrocinado.
   Se usa en conjunto con assets/ads/ads.js en cualquier
   herramienta. Toma los colores del :root de la página host
   (--accent, --ink, --muted, --line, --bg, --accent-soft) y
   cae en valores por defecto si esa página no los define.
   ============================================================ */

.ad-overlay{
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 15, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  z-index: 9999;
  animation: adOverlayIn .18s ease;
}
.ad-overlay[hidden]{ display: none !important; }

@keyframes adOverlayIn{
  from{ opacity: 0; }
  to{ opacity: 1; }
}

.ad-modal{
  width: min(92vw, 720px);
  height: min(90vh, 680px);
  background: #fff;
  border-radius: 24px;
  padding: 14px 14px 18px;
  box-shadow: 0 40px 80px -20px rgba(20,21,26,0.55);
  color: var(--ink, #14151A);
  animation: adModalIn .22s cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
}

@keyframes adModalIn{
  from{ opacity: 0; transform: translateY(10px) scale(.97); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}

.ad-stage{
  position: relative;
  border: 1px solid var(--line, rgba(20,21,26,0.1));
  border-radius: 16px;
  padding: 16px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--accent-soft, rgba(71,127,255,0.06));
  overflow: hidden;
}

.ad-sponsor-tag{
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent, #477FFF);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
}

.ad-placeholder{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted, #6B7280);
  font-size: 15px;
  line-height: 1.4;
}
.ad-placeholder .icon{ font-size: 46px; line-height: 1; }

.ad-adsense-slot{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-adsense-slot[hidden]{ display: none; }

.ad-body{
  flex-shrink: 0;
  text-align: center;
  margin: 14px 4px 14px;
}
.ad-company{
  font-weight: 800;
  font-size: 19px;
  color: var(--ink, #14151A);
}
.ad-campaign{
  font-size: 14.5px;
  color: var(--muted, #6B7280);
  margin-top: 6px;
  line-height: 1.4;
}

.ad-actions{
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ad-cta{
  flex: 1;
  text-align: center;
  background: var(--ink, #14151A);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  font-family: inherit;
  transition: transform .15s ease, background .15s ease;
}
.ad-cta:hover{ background: #2a2b33; transform: translateY(-1px); }

.ad-skip{
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line, rgba(20,21,26,0.12));
  color: var(--muted, #6B7280);
  border-radius: 999px;
  padding: 16px 18px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: not-allowed;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.ad-skip.ready{
  cursor: pointer;
  color: var(--ink, #14151A);
  border-color: var(--accent, #477FFF);
}
.ad-skip.ready:hover{ background: var(--accent-soft, rgba(71,127,255,0.1)); }

@media (max-width: 480px){
  .ad-overlay{ padding: 0; }
  .ad-modal{
    width: 100vw;
    height: 100dvh;
    max-width: 100%;
    border-radius: 0;
    padding: 12px 12px 16px;
  }
  .ad-stage{ border-radius: 12px; padding: 14px; }
  .ad-actions{ flex-direction: column; }
  .ad-cta, .ad-skip{ width: 100%; }
}