/* ── Sobre Cortina Widget ──────────────────────────────────────── */

.inv-sc-wrapper {
  display: block;
}

/* En frontend: overlay fijo sobre toda la pantalla */
.inv-sc-wrapper.inv-sc-live {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

/* En editor: relativo, solo ocupa el espacio de su contenido */
.inv-sc-wrapper.inv-sc-editor-mode {
  position: relative;
}

/* ── Stage ─────────────────────────────────────────────────────── */

.inv-sc-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
}

/* En frontend, el stage llena toda la pantalla vía el wrapper fixed */
.inv-sc-wrapper.inv-sc-live .inv-sc-stage {
  height: 100vh;
}

/* ── Paneles ────────────────────────────────────────────────────── */

.inv-sc-piece {
  position: absolute;
  inset: 0;
  transition: transform var(--inv-sc-transition, 900ms) cubic-bezier(.6, 0, .2, 1);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.inv-sc-solapa {
  background-image: var(--inv-sc-img-left);
  z-index: 2;
}

.inv-sc-cuerpo {
  background-image: var(--inv-sc-img-right);
  z-index: 1;
}

/* Apertura en móvil: deslizamiento horizontal */
.inv-sc-stage.is-open .inv-sc-solapa {
  transform: translateX(-100%);
}
.inv-sc-stage.is-open .inv-sc-cuerpo {
  transform: translateX(100%);
}

/* ── Desktop: técnica de rotación para imágenes verticales ──────── */
/* Las imágenes son portrait; en pantalla landscape se rotan 90°    */

@media (min-width: 768px) {
  .inv-sc-piece {
    background-image: none !important;
    overflow: hidden;
  }

  .inv-sc-piece::before {
    content: '';
    position: absolute;
    width: 100vh;
    height: 100vw;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  .inv-sc-solapa::before {
    background-image: var(--inv-sc-img-left);
  }

  .inv-sc-cuerpo::before {
    background-image: var(--inv-sc-img-right);
  }

  /* Apertura en desktop: deslizamiento vertical */
  .inv-sc-stage.is-open .inv-sc-solapa {
    transform: translateY(-100%);
  }
  .inv-sc-stage.is-open .inv-sc-cuerpo {
    transform: translateY(100%);
  }
}

/* ── Sello ──────────────────────────────────────────────────────── */

.inv-sc-sello {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  width: 130px;
  height: 130px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.inv-sc-sello img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* Desvanecimiento al hacer click */
.inv-sc-sello.is-hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  pointer-events: none;
}

/* ── Animación de pulso ─────────────────────────────────────────── */

@keyframes inv-sc-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
  }
}

.inv-sc-sello--animated {
  animation: inv-sc-pulse 2s ease-in-out infinite;
}

/* Detener animación cuando se oculta para evitar parpadeo */
.inv-sc-sello--animated.is-hidden {
  animation: none;
}

/* ── Sello genérico (sin imagen) ────────────────────────────────── */

.inv-sc-sello-default {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: white;
}

/* ── Botones de editor (solo en modo edición) ───────────────────── */

/* Botón "Ver sobre" dentro del hint */
.inv-sc-editor-show-btn {
  margin-top: 16px;
  padding: 10px 22px;
  background: #3f5bff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-family: sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}

.inv-sc-editor-show-btn:hover {
  background: #2a45e8;
}

/* Botón "✕ Cerrar" (esquina superior derecha, aparece al ver el sobre) */
.inv-sc-editor-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10001;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, background 0.2s;
}

.inv-sc-editor-close-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.inv-sc-editor-close-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* ── Botón de reinicio (solo editor) ───────────────────────────── */

.inv-sc-reset-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-family: sans-serif;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, background 0.2s;
}

.inv-sc-reset-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.inv-sc-reset-btn:hover {
  background: rgba(0, 0, 0, 0.92);
}

/* ── Hint para modo editor ──────────────────────────────────────── */

.inv-sc-editor-hint {
  display: none;
  padding: 40px;
  text-align: center;
  background: #f5f5f5;
  border: 2px dashed #ccc;
  color: #666;
  min-height: 200px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.inv-sc-editor-hint .eicon-image-rollover {
  font-size: 48px;
  color: #aaa;
}

.inv-sc-editor-hint p {
  margin: 0;
  font-size: 13px;
}
