.amaly-ar-product-viewer {
  position: relative;
  margin-bottom: 32px;
  box-sizing: border-box;
}

.amaly-ar-product-viewer *,
.amaly-ar-product-viewer *::before,
.amaly-ar-product-viewer *::after {
  box-sizing: border-box;
}

.amaly-ar-switcher {
  position: absolute;
  z-index: 10050;
  top: auto !important;
  right: auto !important;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  overflow: hidden;
  min-width: 224px;
  border: 1px solid rgba(18, 18, 18, 0.24);
  border-radius: 8px;
  background: rgba(246, 246, 246, 0.88);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.amaly-ar-switcher-button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-right: 1px solid rgba(18, 18, 18, 0.16);
  background: transparent;
  color: #111;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.amaly-ar-switcher-button:last-child {
  border-right: 0;
}

.amaly-ar-switcher-button.is-active {
  margin: 3px;
  border-radius: 6px;
  background: #fff;
  color: #111;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.amaly-ar-info-button {
  position: absolute;
  right: 38px;
  bottom: 30px;
  z-index: 10051;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid #111;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: #111;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: default;
}

.amaly-ar-panels {
  position: relative;
  overflow: hidden;
  height: 520px;
  min-height: 520px;
  background: #fff;
}

.amaly-ar-panel {
  height: 100%;
  min-height: 0;
}

.amaly-ar-panel[hidden] {
  display: none !important;
}

.amaly-ar-photo-stage,
.amaly-ar-panel[data-amaly-panel="3d"],
.amaly-ar-panel[data-amaly-panel="ar"] {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
}

.amaly-ar-photo-stage {
  padding: 0;
  background: #fff;
}

.amaly-ar-photo-main {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

.amaly-ar-photo-thumbs {
  position: absolute;
  top: 14px;
  left: 50%;
  bottom: auto;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 8px;
  max-width: calc(100% - 28px);
  overflow-x: auto;
  padding: 4px;
}

.amaly-ar-thumb {
  width: 62px;
  height: 62px;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.amaly-ar-thumb.is-active {
  border-color: #111;
}

.amaly-ar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.amaly-ar-model {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #f4f4f4;
}

.amaly-ar-model-ar-button,
.amaly-ar-launch-button {
  min-height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 4px;
  background: #111;
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.amaly-ar-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 420px;
  padding: 32px 32px 80px;
  text-align: center;
}

.amaly-ar-card p {
  margin: 0;
  color: #333;
  font-size: 15px;
  line-height: 1.45;
}

.amaly-ar-qr {
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
  padding: 10px;
  border: 1px solid #dedede;
  border-radius: 6px;
  background: #fff;
}

.amaly-ar-qr canvas {
  max-width: 100%;
  height: auto;
}

.amaly-ar-qr-fallback {
  color: #111;
  text-decoration: underline;
}

.amaly-ar-product-viewer.is-mobile-like .amaly-ar-qr,
.amaly-ar-product-viewer:not(.is-mobile-like) .amaly-ar-launch-button {
  display: none;
}

@media (max-width: 768px) {
  .amaly-ar-switcher {
    top: auto !important;
    right: auto !important;
    bottom: 18px;
    left: 50%;
    grid-template-columns: repeat(3, 1fr);
    min-width: min(218px, calc(100vw - 120px));
  }

  .amaly-ar-switcher-button {
    min-width: 0;
    min-height: 36px;
    padding: 0 14px;
    font-size: 15px;
  }

  .amaly-ar-info-button {
    right: 28px;
    bottom: 22px;
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .amaly-ar-panels,
  .amaly-ar-panel {
    height: 390px;
    min-height: 390px;
  }

  .amaly-ar-photo-stage,
  .amaly-ar-panel[data-amaly-panel="3d"],
  .amaly-ar-panel[data-amaly-panel="ar"],
  .amaly-ar-model {
    min-height: 0;
  }

  .amaly-ar-photo-stage {
    padding: 0;
  }

  .amaly-ar-photo-thumbs {
    top: 10px;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
  }

  .amaly-ar-thumb {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
  }

  .amaly-ar-card {
    padding: 32px 20px 80px;
  }

  .amaly-ar-qr {
    width: 180px;
    height: 180px;
  }
}
