/* AV Product 3D / AR */
.av3d-slide {
  position: relative;
}

.av3d-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: inherit;
  background: #eef2f2 center / contain no-repeat;
  color: #0f2f35;
  font-family: inherit;
}

.av3d-ico {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

/* "3D · AR" chip */
.av3d-badge {
  position: absolute;
  z-index: 3;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: #0f2f35;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  pointer-events: none;
}

.av3d-badge .av3d-ico {
  width: 16px;
  height: 16px;
}

/* Start button over the poster */
.av3d-start {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 26px;
  height: 54px;
  border: 0;
  border-radius: 999px;
  background: var(--tb-theme-color, #ddcb44);
  color: #0f2f35;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(15, 47, 53, .22);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}

.av3d-start:hover {
  box-shadow: 0 14px 36px rgba(15, 47, 53, .3);
  transform: translate(-50%, -50%) scale(1.04);
}

/* QR button (desktop only) */
.av3d-qr-open {
  position: absolute;
  z-index: 4;
  right: 16px;
  bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 42px;
  border: 1px solid rgba(15, 47, 53, .12);
  border-radius: 999px;
  background: #fff;
  color: #0f2f35;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(15, 47, 53, .1);
  cursor: pointer;
}

.av3d-qr-open:hover {
  background: #0f2f35;
  color: #fff;
}

.av3d-desktop .av3d-qr-open {
  display: inline-flex;
}

/* Loading / error message */
.av3d-stage[data-status]::after {
  content: attr(data-status);
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 22px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  font-size: 13px;
  font-weight: 600;
  transform: translateX(-50%);
  white-space: nowrap;
}

.av3d-desktop .av3d-stage[data-status]::after {
  bottom: 74px;
}

.av3d-stage.is-loading .av3d-start {
  opacity: .6;
  pointer-events: none;
}

.av3d-stage.is-active .av3d-start {
  display: none;
}

/* Poster is only a placeholder: once the model is shown it would ghost behind it */
.av3d-stage.is-ready {
  background-image: none !important;
}

/* Viewer */
.av3d-viewer {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  background: transparent;
  --poster-color: transparent;
  --progress-bar-color: transparent;
}

.av3d-viewer:focus {
  outline: none;
}

.av3d-progress {
  position: absolute;
  left: 20%;
  right: 20%;
  top: 50%;
  height: 4px;
  border-radius: 4px;
  background: rgba(15, 47, 53, .12);
  overflow: hidden;
  transition: opacity .3s;
}

.av3d-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: #1f6f78;
  transition: width .2s;
}

.av3d-progress.is-done {
  opacity: 0;
}

/* AR button: model-viewer shows it only on devices that can open AR */
.av3d-ar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  height: 50px;
  border: 0;
  border-radius: 999px;
  background: #0f2f35;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(15, 47, 53, .28);
  transform: translateX(-50%);
  cursor: pointer;
}

.from-qr .av3d-ar {
  animation: av3d-pulse 1.6s ease-in-out 3;
}

@keyframes av3d-pulse {
  50% { box-shadow: 0 0 0 10px rgba(221, 203, 68, .45), 0 10px 28px rgba(15, 47, 53, .28); }
}

.av3d-hint {
  position: absolute;
  left: 50%;
  top: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: #3d5a5f;
  font-size: 12px;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s;
}

.av3d-stage.is-ready .av3d-hint {
  opacity: 1;
}

.av3d-stage.was-touched .av3d-hint {
  opacity: 0;
}

.av3d-stage.is-ready.can-ar .av3d-hint {
  top: 56px;
}

.av3d-stage.is-ready .av3d-badge {
  opacity: 0;
}

/* Thumbnail of the 3D slide */
.av3d-thumb {
  position: relative;
}

.av3d-thumb::after {
  content: "3D";
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #0f2f35;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: .03em;
  pointer-events: none;
}

/* QR dialog */
.av3d-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 47, 53, .55);
}

.av3d-modal.is-open {
  display: flex;
}

.av3d-modal__box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 640px;
  padding: 32px;
  border-radius: 20px;
  background: #fff;
  color: #0f2f35;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}

.av3d-modal__qr {
  flex: 0 0 220px;
  width: 220px;
  padding: 10px;
  border: 1px solid #e3ebec;
  border-radius: 14px;
}

.av3d-modal__qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.av3d-modal__text strong {
  display: block;
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.25;
}

.av3d-modal__text p {
  margin: 0;
  color: #3d5a5f;
  font-size: 15px;
  line-height: 1.55;
}

.av3d-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef2f2;
  color: #0f2f35;
  cursor: pointer;
}

@media (max-width: 767px) {
  .av3d-badge {
    top: 12px;
    left: 12px;
  }

  .av3d-start {
    height: 48px;
    padding: 0 20px;
    font-size: 15px;
  }

  .av3d-ar {
    height: 46px;
    font-size: 14px;
  }

  .av3d-modal__box {
    flex-direction: column;
    text-align: center;
  }
}

/* Phone/tablet that opens AR itself: no need for the QR code */
.av3d-stage.can-ar .av3d-qr-open {
  display: none !important;
}
