html,
body,
.main {
  width: 100%;
  height: 100vh; /* Fallback */
  height: 100dvh; /* Will override if supported */
  --progress-bar-color: transparent;
}

body {
  min-width: 1440px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: "Manrope", sans-serif;
}

body.error,
body.mobile {
  min-width: auto;
}

.main {
  display: none;
  padding: 25px;
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
  gap: 25px;
}

.main.show {
  display: flex;
}

.qr_wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex: 1;
}

.qr_container {
  width: 100%;
  max-width: 360px;
  min-height: 470px;
  box-sizing: border-box;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding-top: 20px;
  /*flex-grow: 1;*/
}

#qr {
  width: 100%;
  max-width: 330px;
  height: 330px;
}

#qr canvas {
  display: block;
  height: 100%;
}

.qr_container p {
  color: #171717;
  width: 100%;
  font-weight: 400;
  max-width: 280px;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.0015em;
  text-align: center;
}

.qr_container .download {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #171717;
  cursor: pointer;
  border: 1px solid #d4d4d4;
  padding: 0 20px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 500;
  background: white;
}

.qr_container .download:hover {
  border: 1px solid #9f9f9f;
}

.viewer_wrapper {
  background: #f5f5f5;
  border-radius: 15px;
  overflow: hidden;
  flex: 1;
}

.viewer_container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.viewer_container > model-viewer {
  width: 100%;
  height: 10px;
}

body.mobile .viewer_container .loading {
  width: 80px;
  height: 80px;
}

.viewer_container .loading {
  width: 110px;
  height: 110px;
}

.viewer_container.loaded .loading {
  display: none;
}

.viewer_container .product_title {
  opacity: 0;
  transition: opacity 1s ease;
  font-size: 24px;
  line-height: 28px;
  color: #171717;
  font-weight: 600;
  margin-left: 25px;
}

.viewer_container.loaded .viewer_helper {
  display: flex;
}

.viewer_container.loaded model-viewer {
  height: 100%;
}

.viewer_helper {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  align-items: center;
  font-size: 18px;
  line-height: 28px;
  letter-spacing: 0.0015em;
  /*background-color: rgba(255, 255, 255, 0.68);*/
  color: #81869b;
  font-weight: 100;
  margin: 10px;
  z-index: 2;
  border-radius: 10px;
  padding: 7px 10px;
}

.viewer_helper img {
  margin-right: 15px;
  width: 45px;
}

.viewer_container.loaded .product_title {
  opacity: 1;
  align-self: flex-start;
}

.loading_placeholder {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.loading_placeholder.show {
  display: flex;
}

.loading_placeholder .placeholder {
  width: 90%;
  max-width: 600px;
  max-height: 100%;
  margin-top: -100px;
}

.loading_placeholder .loading {
  display: none;
  width: 80px;
  height: 80px;
}

.loading_placeholder .loading.show {
  display: block;
}

.loading_placeholder .logo {
  width: 100px;
  position: absolute;
  bottom: 10px;
}

.loading_placeholder button.refresh {
  all: unset;
  --ar-butoon-backgound: #5744e2;
  --ar-butoon-color: #fcfcfd;
  --ar-butoon-icon-size: 24px;
  --ar-butoon-height: 48px;

  background: var(--ar-butoon-backgound);
  color: var(--ar-butoon-color);
  height: var(--ar-butoon-height);
  border-radius: 100px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  cursor: pointer;
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
    "Noto Color Emoji";
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.02em;
  user-select: none;
  text-decoration: none;
  display: none;
}

.loading_placeholder button.refresh svg {
  width: var(--ar-butoon-icon-size);
  height: var(--ar-butoon-icon-size);
  color: inherit;
  vertical-align: middle;
}

.loading_placeholder button.refresh.show {
  display: flex;
}

.inapp_open_helper {
  background-color: #04a9b333;
  padding: 10px 20px 20px;
  border-radius: 10px;
  z-index: 3;
  margin: 15px;
  display: none;
  width: 100%;
  max-width: 320px;
}

.inapp_open_helper.show {
  display: block;
}

.inapp_open_helper h3 {
  color: #0f3b68;
}

.copyright {
  position: fixed;
  bottom: 0;
  width: 240px;
  padding: 5px 10px 10px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copyright a {
  color: rgb(128, 128, 128);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.copyright img {
  height: 32px;
}

.global_error {
  display: none;
  text-align: center;
  color: #5744e2;
}

.global_error.show {
  display: block;
}

.global_error h2 {
  margin: 7px;
}

.global_error img {
  width: 200px;
  height: 200px;
}

.global_error span {
  color: gray;
}

.dimension_control {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 10px;
  bottom: 10px;
  cursor: pointer;
  padding: 11px;
  border: 1px dashed #c4bef5;
  background-color: white;
}

.dimension_control.active {
  border: 1px solid #5744e2;
}

.dimension_control:hover {
  box-shadow: 0 0 7px 2px rgba(196, 190, 245, 0.76);
}

.dimension_control img {
  height: 27px;
}

model-viewer button.dim {
  background: rgb(87 68 226 / 87%);
  color: white;
  border-radius: 5px;
  padding: 2px 5px;
  border: none;
}

.fallback_error {
  display: none;
  position: fixed;
  top: 0;
  width: 100%;
  height: 50px;
  align-items: center;
  justify-content: center;
  background-color: antiquewhite;
  z-index: 9;
}

body.fallback .loading_placeholder,
body.fallback .qr_wrapper {
  display: none;
}

body.fallback .fallback_error {
  display: flex;
}

body.fallback .viewer_helper {
  top: auto;
  bottom: 0;
}
