/*
 * DoVR 3D/AR Model Viewer — stylesheet
 * Version: 3.1.0
 *
 * Hosted on the DoVR CDN. Upload to a versioned path so each theme release
 * pins an immutable file:
 *   https://web-assets.dovrmedia.com/model-viewer/3.1.0/dovr-model-viewer.css
 *
 * Pairs with dovr-model-viewer.js of the same version. Class names are the
 * contract between the two — do not rename one without the other.
 */

/* ---------------------------------------------------------------- Modal */

.dovr-modal-window {
  position: fixed;
  background-color: rgba(0, 0, 0, 0.4);
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5000;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
}

.dovr-modal-window:target {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.dovr-modal-box {
  background: #fbfbfd !important;
  width: 60%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 2em;
  border-radius: 1rem;
}

.dovr-modal-box:not(:last-of-type) {
  margin-bottom: 15px;
}

.dovr-modal-window header {
  font-weight: bold;
}

.dovr-modal-window h1 {
  font-size: 150%;
  margin: 0 0 15px;
}

.mv-brand-link {
  color: #5a31f4 !important;
  text-decoration: none;
  font-weight: bold;
}

.mv-info-wrapper {
  transition:
    visibility 0s,
    opacity 1.5s linear;
}

.dovr-modal-close-box {
  text-align: end;
}

.dovr-modal-close-box > * {
  margin-right: 10px;
}

.dovr-modal-button {
  min-height: 0 !important;
  text-align: center;
  margin-right: 10px;
  padding: 0.4em !important;
  text-transform: uppercase;
  font-size: 16px;
  font-weight: bold;
}

.dovr-modal-close {
  color: #aaa;
  line-height: 50px;
  font-size: 16px;
  text-align: center;
  width: 70px;
  text-decoration: none;
  font-weight: bold;
  border: 1px solid #aaa;
  border-radius: 0.25rem;
}

.dovr-modal-close:hover {
  color: #fff;
  background-color: #aaa !important;
}

.dovr-modal-title {
  margin-bottom: 0;
}

/* -------------------------------------------------- Trigger buttons */

.dovr-container {
  display: block;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 15px 0;
}

.logo {
  max-width: 150px;
  display: block;
}

.dovr-small-text {
  color: #5a31f4;
  font-weight: bold;
}

.dovr-btn {
  background-color: white;
  padding: 0.5em;
  border: 1px solid #5a31f4;
  color: #5a31f4 !important;
  font-weight: bold;
  border-radius: 0.25rem;
  text-decoration: none;
  transition: 0.3s;
  line-height: 1.2;
}

.dovr-btn:hover {
  background-color: #5a31f4 !important;
  color: #fff !important;
}

.dovr-btn i {
  padding-right: 0.3em;
}

.dovr-interior button {
  margin-left: 1rem;
}

/* Smooth fade-in for the View 3D Model / View In Your Space buttons.
   Both carry an inline display:none until the model loads, so a slow
   stylesheet cannot flash them. */
#view-3d-btn,
#qr-code-btn {
  opacity: 0;
  transition: opacity 0.4s ease;
}

#view-3d-btn.dovr-fade-in,
#qr-code-btn.dovr-fade-in {
  opacity: 1;
}

/* ------------------------------------------------------ Share links */

.mv-shareable-link {
  color: #5a31f4;
  font-size: 24px;
  padding: 0 5px;
}

.mv-shareable-link a:hover {
  color: #947af8;
  transition: all 0.3s;
}

.mv-shareable-link a {
  text-decoration: none;
}

/* -------------------------------------------------------- AR button */

.dovr-ar-button {
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-position: 12px 50%;
  background-color: #fff;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  bottom: 0;
  padding: 0 16px;
  font-family: Roboto Regular, Helvetica Neue, sans-serif;
  font-size: 14px;
  color: #4285f4;
  height: 36px;
  line-height: 36px;
  border-radius: 18px;
  border: 1px solid #dadce0;
}

.dovr-ar-button:active {
  background-color: #e8eaed;
}

.dovr-ar-button:focus {
  outline: none;
}

.dovr-ar-button:focus-visible {
  outline: 1px solid #4285f4;
}

.dovr-mv-error-label {
  display: none;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-position: 12px 50%;
  background-color: #fff;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  bottom: 0;
  padding: 0 16px;
  margin: 10px;
  font-family: Roboto Regular, Helvetica Neue, sans-serif;
  font-size: 14px;
  color: red;
  height: 36px;
  line-height: 36px;
  border-radius: 18px;
  border: 1px solid red;
}

/* ------------------------------------------------------- Animations */

@keyframes circle {
  from {
    transform: translateX(-50%) rotate(0deg) translateX(50px) rotate(0deg);
  }
  to {
    transform: translateX(-50%) rotate(360deg) translateX(50px) rotate(-360deg);
  }
}

@keyframes elongate {
  from {
    transform: translateX(100px);
  }
  to {
    transform: translateX(-100px);
  }
}

/* ------------------------------------------------- Model Viewer element */

.dovr-model-viewer-renderer,
.dovr-modal-title,
.dovr-instructions,
.mv-modal-subtitle,
.mv-hide-info-btn {
  background: #fff !important;
  border-radius: 10px;
  margin: 10px 0;
}

.dovr-modal-title,
.dovr-instructions,
.mv-modal-subtitle,
.mv-hide-info-btn {
  padding: 10px;
}

.dovr-model-viewer-renderer {
  width: 100%;
  height: 60vh;
}

.mv-mobile-tip {
  display: none;
}

#mv-hide-info-btn {
  cursor: pointer;
}

model-viewer {
  background-color: #eee;
  overflow-x: hidden;
}

model-viewer > #ar-prompt {
  position: absolute;
  left: 50%;
  bottom: 175px;
  animation: elongate 2s infinite ease-in-out alternate;
  display: none;
}

model-viewer[ar-status='session-started'] > #ar-prompt {
  display: block;
}

model-viewer > #ar-prompt > img {
  animation: circle 4s linear infinite;
}

model-viewer > #ar-failure {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 175px;
  display: none;
}

model-viewer[ar-tracking='not-tracking'] > #ar-failure {
  display: block;
}

/* ---------------------------------------------------- Variant slider */

.dovr-slider {
  width: 100%;
  text-align: center;
  overflow: hidden;
  position: absolute;
  bottom: 16px;
}

.dovr-sliders {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.dovr-slide {
  scroll-snap-align: start;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #fff;
  margin-right: 10px;
  border-radius: 10px;
  border: none;
  display: flex;
}

.dovr-slide.selected {
  border: 2px solid #4285f4;
}

.dovr-slide:focus {
  outline: none;
}

.dovr-slide:focus-visible {
  outline: 1px solid #4285f4;
}

/* ------------------------------------------------------- Responsive */

@media screen and (max-width: 900px) {
  .mv-shareable-links {
    display: block;
    padding: 10px 0;
  }

  .dovr-modal-box {
    width: 100%;
    padding: 0;
    height: 100%;
    border-radius: 0;
  }

  .dovr-modal-title,
  .dovr-instructions,
  .dovr-modal-close {
    padding: 5px;
  }

  .mv-desktop-tip {
    display: none;
  }

  .mv-mobile-tip {
    display: block;
  }

  .mv-powered-by {
    padding: 5px;
    text-align: center;
  }

  .dovr-modal-button {
    font-size: 12px;
  }
}

/* --------------------------------------------------- QR Code dialog
   Namespaced under .dovr-* / #qr-code-dialog. The pre-3.1.0 version styled
   bare `dialog`, `.btn` and `.dialog-*`, which collided with host themes. */

#qr-code-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

#qr-code-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.dovr-dialog-header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid #eee;
}

.dovr-dialog-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #111;
}

.dovr-dialog-body {
  padding: 16px 24px 24px;
  color: #444;
  font-size: 0.95rem;
  line-height: 1.6;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.dovr-dialog-footer {
  padding: 12px 24px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dovr-dialog-btn {
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
  background: #111;
  color: #fff;
}

.dovr-dialog-btn:hover {
  background: #333;
}
