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

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

.modal.hidden {
  display: none;
}


/* Contenedor principal */
.modal-content {
  width: min(96vw, 900px);
  max-height: 92vh;
  background: #020617;
  border-radius: 16px;
  padding: 16px;
  box-sizing: border-box;

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


/* 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 {
  width: 100%;
  height: 100%;

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

  padding: 16px;
  box-sizing: border-box;
}


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


/* 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;
  }
}

.photo-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}


.photo-actions a,
.photo-actions button {
  width: 80%;
  max-width: 300px;
  padding: 14px;
  font-size: 16px;
  border-radius: 999px;
  font-weight: 700;
  text-align: center;
}


.thanks-text {
  text-align: center;
  font-weight: 600;
  margin-bottom: 12px;
}


#photoZone {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#adZone .thanks-text,
#adZone .ad-text {
  display: none !important;
}

/* Overlay */
#photoModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

/* Fondo oscuro centrador */
#photoModal .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Contenido */
#photoModal .modal-content {
  width: 100%;
  max-width: 920px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}


@media (max-width: 768px) {
  #photoModal {
    padding: 12px;
  }

  #photoModal .modal-content {
    max-width: 100%;
  }
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

#photoModal .modal-overlay {
  width: 100%;
  max-width: 100%;
}

