/* ==========================================================================
   SPECTICO VIRTUAL TRY-ON (VTO) STYLES
   Minimal, luxury optical atelier aesthetic.
   Palette: Warm Ivory, Charcoal, Sand, Umber.
   ========================================================================== */

.spectico-vto-trigger {
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  min-height: 44px !important;
  padding: 12px 20px !important;
  border: 1px solid #252321 !important;
  border-radius: 2px !important;
  background: #252321 !important;
  color: #faf7f2 !important;
  font: 600 11px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease !important;
}

.spectico-vto-trigger:hover,
.spectico-vto-trigger:focus-visible {
  background: #faf7f2 !important;
  color: #252321 !important;
  border-color: #252321 !important;
  outline: 2px solid #8b7355 !important;
  outline-offset: 2px !important;
}

.svto-modal[hidden] {
  display: none !important;
}

.svto-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2vw, 20px);
  padding-top: max(8px, env(safe-area-inset-top));
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: rgba(18, 17, 16, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #252321;
}

.svto-shell {
  width: min(1080px, 100%);
  max-height: min(92vh, 840px);
  max-height: min(92dvh, 840px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #faf7f2;
  border-radius: 12px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  border: 1px solid #e7ded3;
}

.svto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid #e6ddd1;
  background: #ffffff;
}

.svto-brand {
  font: 700 11px/1.3 -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #252321;
}

.svto-brand span {
  display: block;
  margin-top: 3px;
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #8c7e6f;
}

.svto-title-block {
  text-align: center;
  flex: 1;
}

.svto-header h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(17px, 2.2vw, 24px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #252321;
}

.svto-product-badge {
  display: inline-block;
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a6a58;
}

.svto-close {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid #ddd3c5;
  border-radius: 50%;
  background: transparent;
  color: #252321;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.svto-close:hover {
  background: #f0e9df;
  border-color: #252321;
}

.svto-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 0;
  min-height: 480px;
}

.svto-stage-wrap {
  min-width: 0;
  padding: 20px;
  background: #eee8de;
  display: flex;
  align-items: center;
  justify-content: center;
}

.svto-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 64vh;
  overflow: hidden;
  background: #1c1a18;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(20, 18, 16, 0.22);
  touch-action: manipulation;
}

.svto-video,
.svto-renderer,
.svto-overlay-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.svto-video {
  display: block;
  object-fit: cover;
  transform: scaleX(-1);
  -webkit-transform: translateZ(0) scaleX(-1);
  background: #1c1a18;
}

.svto-renderer {
  display: block;
  pointer-events: none;
}

.svto-overlay-frame {
  z-index: 2;
  object-fit: contain;
  pointer-events: none;
  display: none;
  inset: auto;
  height: auto;
  max-width: none;
  transform-origin: center center;
}

.svto-guide-oval {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48%;
  height: 64%;
  border: 1.5px dashed rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
}

.svto-status {
  position: absolute;
  z-index: 6;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 9px 14px;
  border-radius: 6px;
  background: rgba(22, 21, 20, 0.78);
  color: #ffffff;
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.svto-side {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #faf7f2;
}

.svto-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7a6a58;
  margin: 0 0 10px;
}

.svto-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.svto-chip {
  appearance: none;
  border: 1px solid #dcd2c4;
  background: #ffffff;
  color: #2e2a26;
  border-radius: 3px;
  padding: 9px 12px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  min-height: 38px;
  transition: all 0.16s ease;
}

.svto-chip[aria-pressed="true"],
.svto-chip:hover {
  background: #252321;
  border-color: #252321;
  color: #ffffff;
}

.svto-colour {
  width: 32px;
  height: 32px;
  border: 2px solid #faf7f2;
  outline: 1px solid #c9bfae;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.svto-colour:hover {
  transform: scale(1.1);
}

.svto-colour[aria-pressed="true"] {
  outline: 2px solid #252321;
  outline-offset: 2px;
}

.svto-range {
  width: 100%;
  accent-color: #8c7355;
  min-height: 24px;
  cursor: pointer;
}

.svto-range-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #7a6a58;
  margin-top: 6px;
}

.svto-help {
  font-size: 11.5px;
  line-height: 1.55;
  color: #6e6254;
  margin: 0;
}

.svto-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.svto-primary,
.svto-secondary {
  appearance: none;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid #252321;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.16s ease;
}

.svto-primary {
  background: #252321;
  color: #ffffff;
}

.svto-primary:hover {
  background: #403933;
}

.svto-secondary {
  background: transparent;
  color: #252321;
}

.svto-secondary:hover {
  background: #ede5da;
}

.svto-footnote {
  padding: 12px 24px;
  border-top: 1px solid #e6ddd1;
  font-size: 11px;
  line-height: 1.45;
  color: #7a6a58;
  background: #f5f0e7;
}

.svto-consent[hidden] {
  display: none !important;
}

.svto-consent {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(22, 20, 18, 0.88);
  color: #ffffff;
  text-align: center;
}

.svto-consent-inner {
  max-width: 360px;
}

.svto-consent h3 {
  margin: 0 0 10px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 24px;
  font-weight: 400;
}

.svto-consent p {
  font-size: 12.5px;
  line-height: 1.55;
  color: #e5dfd6;
  margin: 0 0 20px;
}

.svto-consent button {
  border: 1px solid #f7f1e8;
  background: #f7f1e8;
  color: #252321;
  border-radius: 2px;
  padding: 12px 22px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.16s ease;
}

.svto-consent button:hover {
  background: #ffffff;
}

.svto-consent button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.svto-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #c9bfae;
  border-top-color: #252321;
  border-radius: 50%;
  animation: svto-spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}

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

/* ==========================================================================
   RESPONSIVE LAYOUTS (PHONE, TABLET, DESKTOP)
   ========================================================================== */

@media (max-width: 780px) {
  .svto-modal {
    padding: 0;
    align-items: stretch;
  }

  .svto-shell {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .svto-header {
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    gap: 8px;
  }

  .svto-brand {
    font-size: 10px;
  }

  .svto-header h2 {
    font-size: clamp(16px, 4.5vw, 19px);
  }

  .svto-workspace {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    overflow-y: auto;
  }

  .svto-stage-wrap {
    padding: 10px 12px;
  }

  .svto-stage {
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 44vh;
    max-height: 44dvh;
    border-radius: 8px;
  }

  .svto-side {
    padding: 16px;
    gap: 14px;
  }

  .svto-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .svto-footnote {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .svto-header {
    padding-left: 10px;
    padding-right: 10px;
  }

  .svto-stage-wrap {
    padding: 8px;
  }

  .svto-side {
    padding: 12px;
    gap: 12px;
  }

  .svto-chip {
    padding: 8px 10px;
    font-size: 11px;
    min-height: 36px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .svto-modal {
    padding: 0;
  }

  .svto-shell {
    height: 100vh;
    max-height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .svto-header {
    padding: 6px 12px;
  }

  .svto-workspace {
    grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr);
    min-height: 0;
  }

  .svto-stage-wrap {
    padding: 8px;
  }

  .svto-stage {
    aspect-ratio: 4 / 3;
    max-height: 60vh;
    max-height: 60dvh;
  }

  .svto-side {
    padding: 10px;
    gap: 8px;
  }

  .svto-footnote {
    padding: 6px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spectico-vto-trigger,
  .svto-chip,
  .svto-primary,
  .svto-secondary,
  .svto-spinner {
    transition: none !important;
    animation: none !important;
  }
}
