/* ══════════════════════════════════════════════════════════════
   VTO Widget — Redesigned Storefront Modal
   Font: inherits from theme (no forced font-family)
   ══════════════════════════════════════════════════════════════ */

/* ── VTO Button ─────────────────────────────────────────── */
.vto-btn-wrapper {
  margin-top: 8px;
  margin-bottom: 6px;
  width: 100%;
}

.vto-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 50%;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease;
  text-decoration: none;
  background-color: var(--vto-btn-bg, #000);
  color: var(--vto-btn-color, #fff);
  border-radius: var(--vto-btn-radius, 4px);
  padding: var(--vto-btn-padding, 12px 24px);
  font-size: var(--vto-btn-font-size, 16px);
  border-style: var(--vto-btn-border-style, none);
  border-width: var(--vto-btn-border-width, 0);
  border-color: var(--vto-btn-border-color, transparent);
}

.vto-btn:hover { opacity: 0.85; }
.vto-btn--fade:hover { opacity: 0.75; }

.vto-btn--scale { transition: transform 0.2s ease, opacity 0.2s ease; }
.vto-btn--scale:hover { transform: scale(1.05); opacity: 0.95; }

.vto-btn--shine {
  position: relative;
  overflow: hidden;
}
.vto-btn--shine::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
  transition: left 0.5s ease;
}
.vto-btn--shine:hover::after { left: 100%; }

/* Floating button */
.vto-floating {
  position: fixed;
  right: 24px;
  z-index: 9998;
}
.vto-floating--bottom-right, .vto-floating { bottom: 24px; }
.vto-floating--middle-right { bottom: auto; top: 50%; transform: translateY(-50%); }
.vto-floating--top-right { bottom: auto; top: 24px; }

.vto-floating .vto-btn {
  width: auto;
  border-radius: 50px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ── Modal ──────────────────────────────────────────────── */
.vto-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vto-modal div:empty {
  display: block;
}

.vto-modal[hidden] { display: none; }

/* Backdrop animation */
.vto-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--vto-overlay, rgba(0,0,0,0.55));
  backdrop-filter: blur(4px);
  animation: vto-fade-in 0.3s ease both;
}

.vto-modal--closing .vto-modal__backdrop {
  animation: vto-fade-out 0.28s ease both;
}

/* Container animation — desktop: scale+fade */
.vto-modal__container {
  position: relative;
  background: #fff;
  border-radius: var(--vto-modal-radius, 16px);
  width: 90%;
  max-width: var(--vto-modal-max-w, 440px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: vto-scale-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  overflow: hidden;
}

.vto-modal__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: inherit;
}

.vto-modal__container--closing {
  animation: vto-scale-out 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Header — sticky */
.vto-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  flex-shrink: 0;
  min-height: 52px;
}

.vto-modal__header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.vto-modal__back {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #374151;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.vto-modal__back:hover { background: #f3f4f6; }
.vto-modal__back[hidden] { display: none; }

.vto-modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vto-modal__subtitle {
  margin: 1px 0 0;
  font-size: 12px;
  color: #9ca3af;
  font-weight: 400;
}

.vto-modal__header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* History badge (like VibeTry "2 Try-Ons") */
.vto-history-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
  background: #fff;
}
.vto-history-badge:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}
.vto-history-badge[hidden] { display: none; }

.vto-modal__close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #9ca3af;
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  width: 28px;
  height: 28px;
}
.vto-modal__close:hover {
  background: #f3f4f6;
  color: #111;
}

/* ── Product Card ───────────────────────────────────────── */
.vto-product-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.vto-product-card[hidden] {
  display: none;
}

.vto-product-card__img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}

.vto-product-card__info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.vto-product-card__title {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vto-product-card__label {
  font-size: 11px;
  color: #9ca3af;
}

/* ── Steps ──────────────────────────────────────────────── */
.vto-step { padding: 20px 20px 24px; }
.vto-step[hidden] { display: none; }

/* ── Mini Stepper (Upload screen — 1→2 style) ──────────── */
.vto-mini-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 16px;
}

.vto-mini-stepper__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.vto-mini-stepper__dot--active {
  background: #111;
  color: #fff;
}

.vto-mini-stepper__dot--inactive {
  background: transparent;
  color: #9ca3af;
  border: 1.5px solid #d1d5db;
}

.vto-mini-stepper__dot--done {
  background: #10b981;
  color: #fff;
}

.vto-mini-stepper__line {
  width: 40px;
  height: 2px;
  background: #d1d5db;
  margin: 0 6px;
  border-radius: 1px;
  transition: background 0.3s;
}

.vto-mini-stepper__line--done {
  background: #10b981;
}

/* ── Upload Zone ────────────────────────────────────────── */
.vto-upload-heading {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  text-align: center;
}

.vto-upload-subheading {
  margin: 0 0 16px;
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
}

.vto-upload-product-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.vto-upload-product-img {
  width: 180px;
  height: 220px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease;
}

.vto-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.vto-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  background: var(--vto-primary, #111);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.vto-upload-btn:hover { opacity: 0.88; }
.vto-upload-btn:active { transform: scale(0.98); }

.vto-upload-btn--secondary {
  background: #fff;
  color: #374151;
  border: 1.5px solid #d1d5db;
}
.vto-upload-btn--secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* ── Email Capture Form (on upload screen) ──────────────── */
.vto-email-capture {
  width: 100%;
  animation: vto-slide-fade-in 0.3s ease both;
}

.vto-email-capture[hidden] { display: none; }

.vto-email-capture__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: #111;
  text-align: center;
}

.vto-email-capture__subtitle {
  margin: 0 0 14px;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

.vto-email-capture__input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  color: #111;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  margin-bottom: 10px;
}
.vto-email-capture__input:focus {
  border-color: var(--vto-primary, #111);
}
.vto-email-capture__input::placeholder {
  color: #9ca3af;
}

.vto-email-capture__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  cursor: pointer;
}

.vto-email-capture__consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--vto-primary, #111);
  cursor: pointer;
}

.vto-email-capture__consent-label {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.vto-email-capture__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 20px;
  background: var(--vto-primary, #111);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.vto-email-capture__submit:hover { opacity: 0.88; }
.vto-email-capture__submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Terms footer ───────────────────────────────────────── */
.vto-terms {
  margin: 16px 0 0;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  line-height: 1.5;
}

.vto-terms a {
  color: #6366f1;
  text-decoration: none;
}
.vto-terms a:hover {
  text-decoration: underline;
}

/* ── Preview Step ──────────────────────────────────────── */
.vto-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: vto-fade-in 0.3s ease both;
}

.vto-preview__heading {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  text-align: center;
}

.vto-preview__image-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.vto-preview__image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  max-height: 340px;
}

.vto-preview__change {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: none;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
}
.vto-preview__change:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateX(-50%) translateY(-1px);
}

.vto-preview__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.vto-preview__start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 24px;
  background: var(--vto-primary, #111);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.vto-preview__start:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.vto-preview__start:active {
  transform: translateY(0);
}

/* ── Processing V2 (Stepper) ───────────────────────────── */
.vto-processing-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  width: 100%;
  animation: vto-fade-in 0.3s ease both;
}

.vto-processing__heading {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  text-align: center;
}

/* User photo thumbnail in processing — with animated rainbow border */
.vto-processing__photo-wrap {
  position: relative;
  width: 200px;
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  padding: 2px;
  background: conic-gradient(from var(--vto-border-angle, 0deg), #6366f1, #a78bfa, #ec4899, #f59e0b, #10b981, #6366f1) border-box;
  animation: vto-border-rotate 1.2s linear infinite;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

.vto-processing__photo-wrap::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 10px;
  background: #fff;
  z-index: 0;
}

@property --vto-border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes vto-border-rotate {
  to { --vto-border-angle: 360deg; }
}

.vto-processing__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  border-radius: 9px;
}

/* Scan line animation overlay */
.vto-processing__scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  box-shadow: 0 0 15px 3px rgba(255, 255, 255, 0.5);
  animation: vto-scan 2.5s ease-in-out infinite;
  pointer-events: none;
}

/* ── Progress Bar ──────────────────────────────────────── */
.vto-progress {
  width: 100%;
  max-width: 340px;
  height: 5px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.vto-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.vto-progress__pct {
  font-size: 12px;
  font-weight: 600;
  color: #6366f1;
  margin-top: -2px;
}

/* Processing status text */
.vto-processing__status {
  margin: 0;
  font-size: 14px;
  color: #374151;
  font-weight: 600;
}

.vto-processing__hint {
  margin: 0;
  color: #9ca3af;
  font-size: 12px;
}

/* AI tip bubble */
.vto-ai-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: #f8f9fb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  max-width: 340px;
  width: 100%;
  animation: vto-fade-in 0.5s ease 0.5s both;
}

.vto-ai-tip__icon {
  flex-shrink: 0;
  font-size: 14px;
  margin-top: 1px;
}

.vto-ai-tip__text {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

/* Skeleton result placeholder */
.vto-skeleton {
  width: 100%;
  max-width: 260px;
  height: 180px;
  border-radius: 10px;
  background: #f3f4f6;
  overflow: hidden;
  position: relative;
}

.vto-skeleton__inner {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: vto-shimmer 1.5s ease-in-out infinite;
}

/* ── Result ─────────────────────────────────────────────── */
.vto-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
}

.vto-result__heading {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  text-align: center;
}

/* Tab toggle for Before/After */
.vto-result__tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.vto-result__tab {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.vto-result__tab--active {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Single full-width result image area */
.vto-result__image-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  animation: vto-result-appear 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
}

.vto-result__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  cursor: zoom-in;
}

.vto-result__before-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  cursor: zoom-in;
}

.vto-result__before-wrap[hidden],
.vto-result__after-wrap[hidden] {
  display: none;
}

/* ── Cart (ATC + price) ──────────────────────────────────── */
.vto-cart {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: vto-fade-in 0.4s ease 0.2s both;
}

.vto-cart__row {
  display: flex;
  gap: 10px;
  width: 100%;
  align-items: stretch;
}

/* Quantity selector */
.vto-cart__qty {
  display: flex;
  align-items: center;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
}

.vto-cart__qty-btn {
  width: 36px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 16px;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-user-select: none;
  user-select: none;
}
.vto-cart__qty-btn:hover {
  background: #f3f4f6;
  color: #111;
}
.vto-cart__qty-btn:active {
  background: #e5e7eb;
}

.vto-cart__qty-input {
  width: 40px;
  text-align: center;
  border: none;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  font-size: 14px;
  font-weight: 600;
  color: #111;
  background: transparent;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.vto-cart__qty-input::-webkit-outer-spin-button,
.vto-cart__qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Add to Cart button */
.vto-cart__atc-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border: none;
  border-radius: 10px;
  background: var(--vto-primary, #111);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, background 0.3s;
  position: relative;
  overflow: hidden;
}
.vto-cart__atc-btn:hover {
  opacity: 0.9;
}
.vto-cart__atc-btn:active {
  transform: scale(0.97);
}
.vto-cart__atc-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.vto-cart__atc-icon {
  flex-shrink: 0;
}

/* Loading state */
.vto-cart__atc-btn--loading {
  pointer-events: none;
}
.vto-cart__atc-btn--loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vto-spin 0.6s linear infinite;
  right: 16px;
}

/* Success state */
.vto-cart__atc-btn--success {
  background: #10b981 !important;
}

/* Success message */
.vto-cart__success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #065f46;
  animation: vto-fade-in 0.3s ease both;
}

.vto-cart__success[hidden] {
  display: none;
}

/* ── Secondary actions (Share, Save, Try Another) ────────── */
.vto-result__actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.vto-result__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s, background 0.15s;
  background: #fff;
  color: #374151;
  border: 1.5px solid #e5e7eb;
}
.vto-result__btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}
.vto-result__btn:active { transform: scale(0.97); }

.vto-result__btn--primary {
  background: var(--vto-primary, #111);
  color: #fff;
  border-color: transparent;
}
.vto-result__btn--primary:hover {
  opacity: 0.88;
  background: var(--vto-primary, #111);
}

/* Disclaimer text */
.vto-disclaimer {
  margin: 0;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  line-height: 1.4;
}

/* Branding */
.vto-branding {
  color: #9ca3af;
  font-size: 11px;
  text-align: center;
  margin-bottom: 16px;
}
.vto-branding__link {
  color: inherit;
  text-decoration: none;
}
.vto-branding__link:hover {
  text-decoration: underline;
}

/* ── Confetti ──────────────────────────────────────────── */
.vto-confetti {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 10;
}

.vto-confetti__particle {
  position: absolute;
  top: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: vto-confetti-fall linear forwards;
  opacity: 0;
}

/* ── Error ──────────────────────────────────────────────── */
.vto-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 0;
  text-align: center;
}

.vto-error__icon { font-size: 36px; }

.vto-error__text {
  margin: 0;
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
}

/* ── Lightbox ──────────────────────────────────────────── */
.vto-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  animation: vto-fade-in 0.25s ease both;
}

.vto-lightbox[hidden] {
  display: none;
}

.vto-lightbox__img {
  max-width: 96vw;
  max-height: 96vh;
  object-fit: contain;
  border-radius: 4px;
  touch-action: pinch-zoom;
}

.vto-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.vto-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ── History Gallery ──────────────────────────────────── */
.vto-history {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vto-history__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.vto-history__card {
  display: flex;
  gap: 14px;
  border-radius: 12px;
  border: 1.5px solid #e5e7eb;
  padding: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vto-history__card:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.vto-history__card-img-wrap {
  position: relative;
  width: 130px;
  min-height: 160px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
}

.vto-history__card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vto-history__card-expand {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s ease;
}

.vto-history__card-expand:hover {
  background: rgba(0, 0, 0, 0.8);
}

.vto-history__card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.vto-history__card-title {
  font-size: 13px;
  font-weight: 700;
  color: #111;
  text-transform: uppercase;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vto-history__card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vto-history__card-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e5e7eb;
}

.vto-history__card-date {
  font-size: 12px;
  color: #6b7280;
}

.vto-history__card-atc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 14px;
  background: var(--vto-primary, #111);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.vto-history__card-atc:hover {
  opacity: 0.85;
}

.vto-history__card-atc--loading {
  pointer-events: none;
  opacity: 0.7;
}

.vto-history__card-atc--loading svg {
  animation: vto-spin 0.8s linear infinite;
}

.vto-history__card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.vto-history__card-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}

.vto-history__card-action:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.vto-history__card-action--delete {
  color: #9ca3af;
  border-color: #e5e7eb;
}

.vto-history__card-action--delete:hover {
  color: #ef4444;
  border-color: #fca5a5;
  background: #fef2f2;
}

.vto-history__empty {
  text-align: center;
  padding: 40px 0;
  color: #9ca3af;
  font-size: 13px;
}

.vto-history__empty p {
  margin: 0;
}

.vto-history__footer {
  text-align: center;
}

.vto-history__clear-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.vto-history__clear-btn:hover {
  background: #fef2f2;
}

/* ── Animations / Keyframes ────────────────────────────── */
@keyframes vto-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes vto-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes vto-scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes vto-scale-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.92); }
}

@keyframes vto-slide-up {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes vto-slide-down {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(100%); }
}

@keyframes vto-slide-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes vto-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}

@keyframes vto-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes vto-shimmer-line {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes vto-scan {
  0% { top: -3px; }
  50% { top: 100%; }
  100% { top: -3px; }
}

@keyframes vto-result-appear {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes vto-confetti-fall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translateY(180px) rotate(720deg) scale(0.3); }
}

/* ── Responsive (Mobile) ───────────────────────────────── */
@media (max-width: 480px) {
  .vto-modal {
    align-items: flex-end;
  }

  .vto-modal__container {
    width: 100%;
    max-width: 100% !important;
    border-radius: 16px 16px 0 0 !important;
    position: fixed;
    bottom: 0;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: vto-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
    overflow: hidden;
  }

  .vto-modal__container--closing {
    animation: vto-slide-down 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .vto-step {
    padding: 16px 16px 20px;
  }

  .vto-upload-product-img {
    width: 150px;
    height: 190px;
  }

  .vto-upload-heading {
    font-size: 16px;
  }

  .vto-preview__heading,
  .vto-processing__heading,
  .vto-result__heading {
    font-size: 16px;
  }

  .vto-processing__photo-wrap {
    width: 170px;
    height: 210px;
  }

  .vto-cart__row {
    flex-direction: column;
  }

  .vto-cart__qty {
    align-self: center;
  }

  .vto-result__actions {
    flex-wrap: wrap;
  }

  .vto-result__btn {
    min-width: calc(50% - 4px);
  }

  .vto-history {
    padding: 16px;
    gap: 10px;
  }

  .vto-history__card {
    gap: 10px;
    padding: 10px;
  }

  .vto-history__card-img-wrap {
    width: 110px;
    min-height: 140px;
  }

  .vto-history__card-title {
    font-size: 12px;
  }

  .vto-history__card-atc {
    padding: 8px 12px;
    font-size: 12px;
  }

  .vto-history__card-action {
    padding: 4px 8px;
    font-size: 11px;
  }
}
