/* ============================================================
   VTO Public Page — Commerce/Editorial UI
   Tighter layout, sharper corners, stronger brand identity
   ============================================================ */

.page {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #ffffff;
  color: #000000;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.shell {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  max-width: 448px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  min-height: 0;
}

/* ---- Top bar ---- */
.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.topbarLink {
  background: transparent;
  border: 1px solid #e5e7eb;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #000000;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbarLink:hover {
  border-color: #000000;
  background: #fafafa;
}

.closeBtn {
  background: transparent;
  border: 1px solid #e5e7eb;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #000000;
  cursor: pointer;
  transition: all 0.2s ease;
}

.closeBtn:hover {
  background: #fafafa;
  border-color: #000000;
}

/* ---- Main Content ---- */
.card {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  position: relative;
  min-height: 0;
}

.headerBlock {
  margin-bottom: 16px;
  text-align: left;
  flex-shrink: 0;
}

.headline {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: #000000;
  text-align: left;
}

.subhead {
  font-size: 14px;
  color: #64748b;
  text-align: left;
  margin: 0;
  font-weight: 400;
  line-height: 1.5;
}

/* ---- Product Row ---- */
.productRow {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.thumb {
  width: 64px;
  height: 86px;
  border-radius: 2px;
  object-fit: cover;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.productMeta {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.productTitle {
  font-size: 16px;
  font-weight: 500;
  color: #000000;
  margin: 0;
  line-height: 1.2;
}

.productPrice {
  font-size: 15px;
  font-weight: 500;
  color: #000000;
  margin: 0 0 4px;
}

.productSub {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

/* ---- Drop Zone ---- */
.drop {
  flex: 1;
  border: 1px dashed #ced4da;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 16px;
  position: relative;
  min-height: 120px;
}

.drop:hover {
  border-color: #000000;
  background: #fafafa;
}

.dropInner {
  text-align: center;
  width: 100%;
}

.dropIcon {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  transition: transform 0.2s ease;
}

.drop:hover .dropIcon {
  transform: scale(1.05);
}

.dropCta {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 8px;
  color: #000000;
}

.dropHint {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 16px;
}

/* ---- Buttons ---- */
.primaryBtn {
  background: #000000;
  color: #ffffff;
  border: 1px solid #000000;
  border-radius: 0;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
}

.primaryBtn:hover {
  background: #333333;
  border-color: #333333;
}

.primaryBtn:active {
  background: #1a1a1a;
  transform: scale(0.98);
}

.secondaryBtn {
  background: #ffffff;
  color: #000000;
  border: 1px solid #000000;
  border-radius: 0;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
}

.secondaryBtn:hover {
  background: #fafafa;
}

.secondaryBtn:active {
  background: #f0f0f0;
  transform: scale(0.98);
}

.fileInput {
  display: inline-block;
  position: relative;
  width: 100%;
  max-width: 220px;
}

.fileInput input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.secondaryCard {
  margin-top: 16px;
  width: 100%;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  font-weight: 500;
  color: #000000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
}

.secondaryCard:hover {
  background: #fafafa;
  border-color: #000000;
}

.secondaryCard:active {
  background: #f0f0f0;
  transform: scale(0.98);
}

/* ---- Preview Mode ---- */
.previewWrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  align-items: center;
}

.previewImg {
  width: 100%;
  max-width: 320px;
  object-fit: contain;
  background: #ffffff;
  min-height: 0;
  max-height: 40vh;
  border: 1px solid #e5e7eb;
}

.previewActions {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  flex-shrink: 0;
  padding-bottom: 8px;
}

.tryOnBtn {
  background: #000000;
  color: #ffffff;
}

.tryOnBtn:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

/* ---- Progress Bar ---- */
.progressContainer {
  margin-top: 16px;
  width: 100%;
}

.progressBarTrack {
  width: 100%;
  height: 2px;
  background-color: #f1f5f9;
  position: relative;
  overflow: hidden;
}

.progressBarFill {
  height: 100%;
  background-color: #000000;
  transition: width 0.3s ease;
}

.progressText {
  text-align: center;
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Footer ---- */
.footer {
  margin-top: 24px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
  padding-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.footerLink {
  background: none;
  border: none;
  padding: 0;
  color: #64748b;
  text-decoration: underline;
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
}

/* ---- History Panel (Full-Screen Drawer) ---- */
.historyPanel {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  animation: slideInUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.historyPanelHeader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
  background: #fff;
}

.historyPanelBack {
  background: none;
  border: 1px solid #e5e7eb;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #000;
  flex-shrink: 0;
  transition: all 0.2s;
}

.historyPanelBack:hover {
  background: #f8fafc;
  border-color: #000;
}

.historyPanelTitle {
  font-size: 15px;
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: 1;
}

.historyPanelCount {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: auto;
}

.historyPanelBody {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.historyGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.historyCard {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: 1px solid #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  background: #fafafa;
}

.historyCard:hover {
  border-color: #000;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.historyCardImg {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f8fafc;
  display: block;
}

.historyCardImgPlaceholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
}

.historyCardMeta {
  padding: 8px 10px 10px;
  border-top: 1px solid #f1f5f9;
  background: #fff;
}

.historyCardTitle {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.historyCardDate {
  font-size: 11px;
  color: #94a3b8;
  margin: 0 0 6px;
}

.historyCardViewBadge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: #000;
  border-radius: 2px;
  padding: 3px 8px;
  display: inline-block;
}

/* Shimmer loading */
.historyShimmer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.historyShimmerCard {
  border: 1px solid #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.historyShimmerImg {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.historyShimmerText {
  height: 12px;
  margin: 8px 10px 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.historyShimmerTextSm {
  height: 10px;
  width: 60%;
  margin: 0 10px 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

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

.historyEmpty {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  padding: 64px 24px;
  line-height: 1.8;
}

/* keep old row-style classes unused but non-breaking */
.historyList { display: none; }
.historyItem { display: none; }
.historyThumb { display: none; }
.historyItemTitle { display: none; }
.historyItemDate { display: none; }
.historyHeader { display: none; }
.historyTitle { display: none; }
.historyClearBtn { display: none; }

/* ---- Modals ---- */
.cameraOverlay,
.legalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cameraModal,
.legalModal {
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.cameraHeader,
.legalHeader {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}

.cameraTitle,
.legalHeader h2 {
  font-size: 15px;
  font-weight: 600;
  color: #000000;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cameraBody,
.legalBody {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.cameraVideo {
  flex: 1;
  width: 100%;
  object-fit: cover;
  background: #f8fafc;
  min-height: 340px;
  border: 1px solid #e5e7eb;
}

.cameraActions {
  padding: 24px 0 0;
  display: flex;
  justify-content: center;
}

.captureBtn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid #000000;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.captureBtn:hover {
  opacity: 0.7;
}

.captureBtnInner {
  width: 52px;
  height: 52px;
  background: #000000;
  border-radius: 50%;
}

.legalBody h3 {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  margin: 24px 0 8px;
}

.legalBody p {
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  margin: 0;
}

/* ---- User Information Form ---- */
.vtoFormGroup {
  margin-bottom: 20px;
}

.vtoRow {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.vtoRow>* {
  flex: 1;
}

.vtoLabel {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  margin-bottom: 8px;
}

.vtoInput,
.vtoSelect {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
  color: #0f172a;
  background: #ffffff;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.vtoInput:focus,
.vtoSelect:focus {
  outline: none;
  border-color: #000000;
}

.vtoRangeContainer {
  position: relative;
  padding: 0 0 30px;
  margin-top: 10px;
}

.vtoRange {
  width: 100%;
  height: 24px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  outline: none;
  position: relative;
  z-index: 2;
}

.vtoRange::-webkit-slider-runnable-track {
  width: 100%;
  height: 2px;
  background: transparent;
  border-radius: 1px;
}

.vtoRange::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid #000000;
  margin-top: -7px;
  cursor: pointer;
  box-shadow: 0 0 0 2px #ffffff;
}

/* Dots underneath track to indicate stops visually */
.vtoRangeTrackBg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}

.vtoRangeTrackBg::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: #e2e8f0;
  transform: translateY(-50%);
  z-index: -1;
}

.vtoRangeDot {
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  box-sizing: border-box;
}

.vtoRangeLabels {
  display: flex;
  justify-content: space-between;
  position: absolute;
  width: 100%;
  bottom: 0;
  font-size: 12px;
  color: #0f172a;
  font-weight: 500;
}

.vtoTrashBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-top: 24px;
}

.vtoTrashBtn:hover {
  color: #000000;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {

  body,
  .page {
    background: #ffffff;
  }

  .shell {
    padding: 12px;
    border: none;
    max-width: 100%;
  }

  .topbar {
    margin-bottom: 12px;
    gap: 8px;
  }

  .topbarLink {
    padding: 5px 10px;
    font-size: 12px;
  }

  .closeBtn {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .headline {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .subhead {
    font-size: 13px;
  }

  .productRow {
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 10px;
  }

  .thumb {
    width: 56px;
    height: 75px;
  }

  .productTitle {
    font-size: 14px;
  }

  .productPrice {
    font-size: 14px;
  }

  .productSub {
    font-size: 12px;
  }

  .drop {
    min-height: 100px;
    padding: 12px;
  }

  .dropIcon {
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
  }

  .dropCta {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .dropHint {
    font-size: 12px;
    margin-bottom: 12px;
  }

  .primaryBtn,
  .secondaryBtn {
    padding: 10px 20px;
    font-size: 13px;
  }

  .secondaryCard {
    padding: 12px;
    font-size: 13px;
  }

  .previewImg {
    max-height: 35vh;
  }

  .previewActions {
    gap: 10px;
    flex-direction: column;
  }

  .previewActions button {
    width: 100%;
  }

  .footer {
    margin-top: 16px;
    padding-bottom: 16px;
    font-size: 10px;
  }

  .historyPanelHeader {
    padding: 12px 16px;
  }

  .historyPanelBack {
    width: 32px;
    height: 32px;
  }

  .historyPanelTitle {
    font-size: 14px;
  }

  .historyPanelBody {
    padding: 12px;
  }

  .historyGrid {
    gap: 10px;
  }

  .cameraModal,
  .legalModal {
    max-width: 100%;
    max-height: 100vh;
    border: none;
  }

  .cameraHeader,
  .legalHeader {
    padding: 16px 20px;
  }

  .cameraTitle,
  .legalHeader h2 {
    font-size: 14px;
  }

  .cameraBody,
  .legalBody {
    padding: 20px;
  }

  .cameraVideo {
    min-height: 280px;
  }

  .captureBtn {
    width: 56px;
    height: 56px;
  }

  .captureBtnInner {
    width: 46px;
    height: 46px;
  }

  .vtoFormGroup {
    margin-bottom: 16px;
  }

  .vtoRow {
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
  }

  .vtoLabel {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .vtoInput,
  .vtoSelect {
    padding: 9px 11px;
    font-size: 13px;
  }

  .vtoRangeContainer {
    padding-bottom: 25px;
  }

  .vtoRangeLabels {
    font-size: 11px;
  }

  .vtoTrashBtn {
    font-size: 12px;
    margin-top: 20px;
  }
}

/* Tablet breakpoint */
@media (min-width: 481px) and (max-width: 768px) {
  .shell {
    max-width: 520px;
    padding: 20px;
  }

  .historyGrid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop breakpoint */
@media (min-width: 769px) {
  .historyGrid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Utilities */
@media (min-width: 769px) {
  #vtoTakeMirrorSelfieBtn {
    display: none !important;
  }
}

/* Step transition animation */
@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer link accessibility */
.footerLink {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}