/* Glasses Virtual Try-On styles */

.gvto-open-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 12px 28px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}
.gvto-open-btn:hover { background: #000; }

/* "Try On" button placed below the product gallery, in normal flow. */
.gvto-below-wrap {
  margin: 14px 0 4px;
  text-align: center;
}
.gvto-open-btn--below {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 13px 22px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease;
}
.gvto-open-btn--below:hover { background: #000; }
.gvto-open-btn--below .gvto-btn-icon { display: block; }

.gvto-modal { display: none; position: fixed; inset: 0; z-index: 99999; }
.gvto-modal.is-open { display: block; }

.gvto-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
}

.gvto-modal__dialog {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(960px, 94vw);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0;
}
@media (max-width: 720px) {
  .gvto-modal__dialog { grid-template-columns: 1fr; }
}

.gvto-modal__close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none;
  font-size: 28px; line-height: 1; cursor: pointer;
  color: #333; z-index: 2;
}

/* Stage (left) */
.gvto-stage { padding: 20px; }

.gvto-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #eee;
  border-radius: 8px;
  overflow: hidden;
}
.gvto-photo, .gvto-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
}
.gvto-video { transform: scaleX(-1); } /* mirror selfie view */
.gvto-overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; /* crop identically to the photo/video so glasses align */
  pointer-events: none;
}
/* When in camera (selfie) mode, mirror both video and overlay together so
   the glasses line up. Still photos use the unmirrored default. */
.gvto-canvas-wrap.gvto-mirror .gvto-overlay { transform: scaleX(-1); }
.gvto-canvas-wrap:not(.gvto-mirror) .gvto-video { transform: none; }

.gvto-hint {
  position: absolute; left: 0; right: 0; bottom: 12px;
  text-align: center; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
  font-size: 13px; line-height: 1.4;
  padding: 0 12px;
}
/* Error state: readable panel instead of overlay-on-image text. */
.gvto-hint--error {
  top: 50%; bottom: auto;
  transform: translateY(-50%);
  background: rgba(20,20,20,.92);
  color: #fff; text-shadow: none;
  max-width: 86%; margin: 0 auto;
  padding: 16px 18px; border-radius: 10px;
  font-size: 14px; line-height: 1.6;
}
.gvto-hint--error .gvto-err-sub {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  opacity: .7;
}

.gvto-samples {
  display: flex; gap: 8px; margin-top: 12px; overflow-x: auto;
}
.gvto-sample {
  flex: 0 0 auto; width: 56px; height: 56px;
  border: 2px solid transparent; border-radius: 8px;
  padding: 0; overflow: hidden; cursor: pointer; background: none;
}
.gvto-sample img { width: 100%; height: 100%; object-fit: cover; }

.gvto-frames {
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
.gvto-frame {
  width: 70px; height: 40px;
  border: 2px solid #ddd; border-radius: 8px;
  background: #fff; cursor: pointer; padding: 4px;
}
.gvto-frame.is-active { border-color: #1a1a1a; }
.gvto-frame img { width: 100%; height: 100%; object-fit: contain; }

/* Controls (right) */
.gvto-controls {
  padding: 40px 28px 24px;
  display: flex; flex-direction: column; justify-content: center;
  border-left: 1px solid #f0f0f0;
}
.gvto-upload-line { font-size: 18px; color: #222; margin: 0 0 18px; }
.gvto-upload-btn {
  display: inline-block; text-align: center;
  background: #1a1a1a; color: #fff;
  padding: 16px; border-radius: 8px; font-size: 16px; cursor: pointer;
}
.gvto-upload-btn:hover { background: #000; }
.gvto-upload-sub {
  margin: 10px 2px 0;
  font-size: 12px; color: #777; line-height: 1.4;
}

.gvto-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  margin-top: 28px; border-radius: 8px; overflow: hidden;
}
.gvto-tab {
  padding: 16px; border: none; cursor: pointer;
  background: #ece9ff; color: #333; font-size: 16px; font-weight: 600;
}
.gvto-tab.is-active { background: #4b32d6; color: #fff; }
/* Camera tab gets a small warning dot when camera likely won't work. */
.gvto-tab--warn { position: relative; }
.gvto-tab--warn::after {
  content: ''; position: absolute; top: 8px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ffb020;
}
