/* Virtual Wig Fitting — all rules are scoped under .vwt-wrap so this
   plugin never restyles the rest of the WordPress theme. */

.vwt-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #7c6ff0, #6357e0);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px #7c6ff055;
}
.vwt-trigger-btn:hover { filter: brightness(1.08); }
.vwt-trigger-icon { font-size: 15px; }

.vwt-modal-overlay {
  position: fixed;
  inset: 0;
  background: #05060ab3;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.vwt-modal-overlay .vwt-wrap {
  position: relative;
  width: 100%;
  margin: auto;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.vwt-wrap .vwt-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 8px;
  color: var(--vwt-text-dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.vwt-wrap .vwt-modal-close:hover { color: var(--vwt-text); border-color: transparent; }

.vwt-wrap .vwt-uploaders.vwt-uploaders--single { grid-template-columns: 1fr; }

.vwt-wrap, .vwt-wrap * { box-sizing: border-box; }

.vwt-wrap {
  --vwt-bg: #10121a;
  --vwt-panel: #1a1d29;
  --vwt-panel-2: #22263699;
  --vwt-border: #2c3040;
  --vwt-text: #eef0f6;
  --vwt-text-dim: #9296a8;
  --vwt-accent: #7c6ff0;
  --vwt-accent-dim: #7c6ff033;
  --vwt-danger: #e5654f;
  --vwt-ok: #4fbf8b;
  --vwt-radius: 12px;

  background: var(--vwt-bg);
  color: var(--vwt-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  padding: 24px;
  border-radius: var(--vwt-radius);
  border: 1px solid var(--vwt-border);
  max-width: 1040px;
  margin: 24px auto;
}

.vwt-wrap header { margin-bottom: 20px; }
.vwt-wrap .vwt-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--vwt-accent-dim);
  color: var(--vwt-accent);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.vwt-wrap h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
.vwt-wrap .vwt-sub { color: var(--vwt-text-dim); font-size: 14px; margin: 0; }

.vwt-wrap .vwt-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 860px) {
  .vwt-wrap .vwt-grid { grid-template-columns: 1fr; }
}

.vwt-wrap .vwt-panel {
  background: var(--vwt-panel);
  border: 1px solid var(--vwt-border);
  border-radius: var(--vwt-radius);
  padding: 18px;
}
.vwt-wrap .vwt-panel h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--vwt-text-dim);
  margin: 0 0 14px;
  font-weight: 600;
}

.vwt-wrap .vwt-uploaders { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.vwt-wrap .vwt-uploader {
  border: 1px dashed var(--vwt-border);
  border-radius: var(--vwt-radius);
  padding: 12px;
  text-align: center;
  position: relative;
}
.vwt-wrap .vwt-uploader img.vwt-thumb {
  width: 100%; height: 90px; object-fit: cover;
  border-radius: 8px; margin-bottom: 8px; display: block;
  background: #00000033;
}
.vwt-wrap .vwt-uploader label { font-size: 12px; color: var(--vwt-text-dim); display: block; margin-bottom: 8px; }
.vwt-wrap .vwt-btn-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

.vwt-wrap button,
.vwt-wrap .vwt-file-btn {
  background: var(--vwt-panel-2);
  color: var(--vwt-text);
  border: 1px solid var(--vwt-border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.vwt-wrap button:hover,
.vwt-wrap .vwt-file-btn:hover { border-color: var(--vwt-accent); }
.vwt-wrap button:disabled { opacity: .4; cursor: not-allowed; }
.vwt-wrap button.vwt-primary { background: var(--vwt-accent); border-color: var(--vwt-accent); color: white; }
.vwt-wrap input[type=file] { display: none; }

.vwt-wrap .vwt-stage {
  position: relative;
  background: #000;
  border-radius: var(--vwt-radius);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 320px;
}
.vwt-wrap .vwt-stage canvas,
.vwt-wrap .vwt-stage video { width: 100%; height: auto; display: block; }
.vwt-wrap .vwt-stage canvas { cursor: grab; touch-action: none; }
.vwt-wrap .vwt-stage canvas:active { cursor: grabbing; }
.vwt-wrap .vwt-stage .vwt-placeholder { color: var(--vwt-text-dim); font-size: 13px; padding: 40px; text-align: center; }

.vwt-wrap .vwt-align-guide {
  position: absolute;
  top: 50%; left: 50%;
  width: 46%; height: 72%;
  transform: translate(-50%, -50%);
  border: 2px dashed #ffffff88;
  border-radius: 50% / 40%;
  pointer-events: none;
}

.vwt-wrap .vwt-upload-hint {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  margin: 10px 0 0;
  line-height: 1.5;
  text-align: center;
  letter-spacing: 0;
}

@media (max-width: 600px) {
  .vwt-wrap .vwt-upload-hint {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    line-height: 1.45;
  }
}
.vwt-wrap .vwt-drag-hint {
  font-size: 11px;
  color: var(--vwt-text-dim);
  text-align: center;
  margin: 8px 0 0;
}

.vwt-wrap .vwt-log {
  margin-top: 12px;
  font-size: 12px;
  color: var(--vwt-text-dim);
  min-height: 18px;
}
.vwt-wrap .vwt-log.vwt-err { color: var(--vwt-danger); }
.vwt-wrap .vwt-log.vwt-ok { color: var(--vwt-ok); }

.vwt-wrap .vwt-slider-row { margin-bottom: 16px; }
.vwt-wrap .vwt-slider-row .vwt-lbl {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--vwt-text-dim); margin-bottom: 6px;
}
.vwt-wrap input[type=range] {
  width: 100%; accent-color: var(--vwt-accent);
}
.vwt-wrap .vwt-footer-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.vwt-wrap .vwt-check-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--vwt-text-dim); margin-top: 14px; }
.vwt-wrap .vwt-note {
  font-size: 11px; color: var(--vwt-text-dim); line-height: 1.5; margin-top: 14px;
  border-top: 1px solid var(--vwt-border); padding-top: 12px;
}


/* Professional interaction / touch behavior */
.vwt-wrap .vwt-stage canvas {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}
.vwt-wrap .vwt-stage canvas:active { cursor: grabbing; }
.vwt-wrap input[type=range] {
  cursor: pointer;
  touch-action: none;
  min-height: 20px;
}
.vwt-wrap input[type=range]::-webkit-slider-thumb { cursor: grab; }
.vwt-wrap input[type=range]::-moz-range-thumb { cursor: grab; }
.vwt-wrap input[type=range]:active::-webkit-slider-thumb { cursor: grabbing; }
.vwt-wrap input[type=range]:active::-moz-range-thumb { cursor: grabbing; }

/* Keep Upload and Camera buttons exactly the same size and padding. */
.vwt-wrap .vwt-btn-row button,
.vwt-wrap .vwt-btn-row .vwt-btn,
.vwt-wrap .vwt-btn-row .vwt-file-btn {
  padding: 10px 18px !important;
  min-height: 42px !important;
  height: 42px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Ensure the Virtual Wig Fitting heading is always pure white. */
.vwt-wrap .vwt-modal-overlay h1,
.vwt-wrap h1 {
  color: #ffffff !important;
}

/* Keep all preview imagery strictly clipped to its own container. */
.vwt-wrap .vwt-stage,
.vwt-wrap .vwt-uploader {
  overflow: hidden !important;
}
.vwt-wrap .vwt-stage canvas,
.vwt-wrap .vwt-stage video {
  max-width: 100% !important;
}

/* Product-page trigger: sits directly below the WooCommerce price. */
.vwt-trigger-btn {
  margin: 0 0 18px !important;
  max-width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .vwt-trigger-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 18px !important;
    min-height: 44px;
    margin: 14px 0 16px !important;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .vwt-trigger-btn {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px !important;
  }
}
