/* =====================================================
   MODAL PUBLICIDAD + FOTO
   ===================================================== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Contenedor principal */
.modal-content {
  width: 90%;
  max-width: 960px;
  max-height: 90%;

  background: #020617;
  border-radius: 16px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  position: relative;
  overflow: hidden;
}


/* Ocultar */
.hidden {
  display: none !important;
}

/* Botón cerrar */
.close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 22px;
  font-weight: 700;
  color: #9ca3af;
  cursor: pointer;
  transition: color .2s ease;
}

.close:hover {
  color: #f9fafb;
}

#adZone {
  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
}


#adImage {
  max-width: 100%;
  max-height: 80%;

  width: auto;
  height: auto;

  object-fit: contain;
}


#adZone #countdown {
  font-size: 28px;
  font-weight: 700;
}

#countdown {
  position: absolute;
  bottom: 16px;
  right: 16px;

  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
}


.ad-text {
  font-size: 14px;
  opacity: 0.75;
}


/* Zona de la foto limpia */
#photoZone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Imagen limpia */
#cleanPhoto {
  max-width: 100%;
  max-height: 70%;
  border-radius: 10px;
  object-fit: contain;
}

/* Botón descargar */
#downloadBtn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #020617;
  font-weight: 800;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}

#downloadBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(56,189,248,.4);
}

/* Responsive */
@media (max-width: 768px) {

  .modal {
    padding: 0;
  }

  .modal-content {
    width: 100vw;
    height: calc(var(--vh, 1vh) * 100);
    max-width: none;
    max-height: none;
    border-radius: 0;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  #adZone {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #adImage {
    max-width: 100%;
    max-height: calc(var(--vh, 1vh) * 80);
    object-fit: contain;
  }
}


#cleanPhoto {
  max-width: 100%;
  max-height: 80%;
  object-fit: contain;
}
