.yolka-process-host {
  position: relative !important;
}

.yolka-process-host.is-yolka-processing {
  overflow: hidden !important;
  border-color: #f59e0b !important;
  background: #fffbeb !important;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .14), 0 16px 40px rgba(146, 64, 14, .16) !important;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.yolka-process-host.is-yolka-uploading > :not(.yolka-process-overlay),
.yolka-process-host.is-yolka-saving-lots > :not(.yolka-process-overlay) {
  opacity: .28;
  pointer-events: none;
  user-select: none;
}

.yolka-process-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(255, 251, 235, .82);
  backdrop-filter: blur(2px);
}

.yolka-process-host.is-yolka-uploading .yolka-process-overlay[data-process="uploading"],
.yolka-process-host.is-yolka-saving-lots .yolka-process-overlay[data-process="saving-lots"] {
  display: flex;
}

/*
 * Al guardar lotes el modal se oculta y Yolka vuelve a la parte superior.
 * El aviso se fija al viewport para que nunca quede debajo de la pantalla.
 */
#detailPage .sar-paste-card.yolka-process-host.is-yolka-saving-lots > .yolka-process-overlay[data-process="saving-lots"] {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10150 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: clamp(72px, 9vh, 100px) 18px 24px !important;
  background: rgba(6, 20, 38, .48) !important;
  backdrop-filter: blur(2px) !important;
}

/* Evita mostrar un segundo aviso dentro del cuadro de Lotes extraidos. */
#sarPreviewSection.yolka-process-host.is-yolka-saving-lots > .yolka-process-overlay[data-process="saving-lots"] {
  display: none !important;
}

.yolka-process-message {
  width: min(430px, 92%);
  min-height: 190px;
  padding: 24px 28px;
  border: 2px solid #f59e0b;
  border-radius: 18px;
  color: #78350f;
  text-align: center;
  background: #fff7d6;
  box-shadow: 0 12px 30px rgba(120, 53, 15, .18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#detailPage .sar-paste-card.is-yolka-saving-lots .yolka-process-message {
  width: min(520px, calc(100vw - 36px));
  min-height: 170px;
  box-shadow: 0 24px 70px rgba(4, 25, 52, .34);
}

.yolka-process-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border: 5px solid #fde68a;
  border-top-color: #d97706;
  border-radius: 50%;
  animation: yolka-process-spin .85s linear infinite;
}

.yolka-process-message strong {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(21px, 2vw, 29px);
}

.yolka-process-message span {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

@keyframes yolka-process-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
  #detailPage .sar-paste-card.yolka-process-host.is-yolka-saving-lots > .yolka-process-overlay[data-process="saving-lots"] {
    padding-top: 54px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .yolka-process-spinner { animation-duration: 1.8s; }
}
