/* ===== Reset e Container ===== */
.vton-container {
  display: inline-block;
  position: relative;
  margin: 10px 0;
}

.vton-container button.vton-open-modal {
  padding: 10px 20px;
  background-color: #0073aa;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 14px;
}

.vton-container button.vton-open-modal:hover {
  background-color: #005177;
}

/* ===== Modal Base ===== */
.vton-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  align-items: center; justify-content: center;
  overflow: auto;
}

.vton-modal.vton-sidebar { justify-content: flex-end; }

.vton-modal-content {
  position: relative;
  background-color: #fff;
  padding: 18px;
  border-radius: 10px;
  max-width: 96%;
  max-height: 92%;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== Close Button ===== */
.vton-close {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  color: #333;
}
.vton-close:hover { color: #0073aa; }

/* ===== Stage Wrapper ===== */
.vton-stage {
  position: relative;
  width: 100%;
  max-width: 750px; /* aumentado ligeiramente para desktop */
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
}

/* video e canvas ocupam exatamente o mesmo espaço dentro do stage */
.vton-stage .vton-video,
.vton-stage .vton-canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

/* overlay dos óculos centralizado por padrão */
.vton-stage .vton-overlay-img-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: move;
  touch-action: none;
  z-index: 10;
  transition: transform 0.05s linear, width 0.05s linear, height 0.05s linear;
  transform-origin: 50% 50%; /* adição para rotacionar em centro */
}

.vton-overlay-img {
  display: block;
  max-width: 100%;
  height: auto;
  pointer-events: none;
}

/* Handles */
.scale-handle {
  position: absolute;
  width: 15px;
  height: 15px;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  cursor: nwse-resize;
  z-index: 20;
}

.rotate-handle {
  position: absolute;
  width: 15px;
  height: 15px;
  right: 0;
  top: 0;
  background: rgba(255,0,0,0.5);
  border-radius: 50%;
  cursor: grab;
  z-index: 20;
}

/* Footer */
.vton-footer {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #555;
}

.vton-footer a { color: #0073aa; text-decoration: none; }
.vton-footer a:hover { text-decoration: underline; }

/* Responsividade */
@media screen and (max-width: 1024px) {
  .vton-stage { max-width: 640px; }
}

@media screen and (max-width: 768px) {
  .vton-modal-content { width: 95%; padding: 12px; }
  .vton-stage { max-width: 100%; aspect-ratio: 3 / 4; }
  .vton-overlay-img-wrapper { transform: translate(-50%, -50%) scale(0.98); }
}

@media screen and (max-width: 420px) {
  .vton-stage { aspect-ratio: 3 / 4; }
  .vton-overlay-img-wrapper { transform: translate(-50%, -50%) scale(0.9); }
}
