* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: transparent;
}

.ads-widget {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  pointer-events: auto;
}

.ads-container {
  position: relative;
  width: 320px;
  max-width: 90vw;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  background: #000;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ads-container.fade-out {
  opacity: 0;
  transform: scale(0.95);
}

.ads-container.fade-in {
  opacity: 1;
  transform: scale(1);
}

.ads-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ads-media.video {
  background: #000;
}

.ads-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 10;
}

.ads-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 20;
}

.ads-widget:hover .ads-close {
  opacity: 1;
}

.ads-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Indicador de progresso */
.ads-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bcb77);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 15;
}

.ads-progress.active {
  animation: progressFill var(--duration, 10s) linear forwards;
}

@keyframes progressFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Responsivo */
@media (max-width: 768px) {
  .ads-widget {
    top: 10px;
    right: 10px;
  }

  .ads-container {
    width: 280px;
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 480px) {
  .ads-container {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    top: 0;
    right: 0;
  }

  .ads-widget {
    top: 0;
    right: 0;
  }
}