/* Phase 4.3.46.14 — AR model-viewer loading overlay, desktop fullscreen, and darker viewer center gradient.
   Scoped to AR detail pages only. */
body.dim-public .listing-page--ar-detail {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

body.dim-public .ar-detail-hero {
  align-items: center;
}

body.dim-public .ar-viewer-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(420px, 68vh, 760px);
  border: 1px solid rgba(38, 68, 51, .14);
  border-radius: clamp(1.2rem, 2vw, 2rem);
  background:
    radial-gradient(circle at 18% 14%, rgba(240, 200, 115, .24), transparent 24rem),
    radial-gradient(circle at 88% 8%, rgba(31, 111, 122, .18), transparent 22rem),
    linear-gradient(135deg, #17110b, #2e2116 58%, #62451f);
  box-shadow: 0 28px 78px rgba(21, 32, 25, .18);
}

body.dim-public .ar-model-viewer {
  display: block;
  width: 100%;
  height: clamp(420px, 68vh, 760px);
  min-height: inherit;
  background:
    radial-gradient(circle at 48% 46%, rgba(246, 232, 203, .94), rgba(221, 196, 151, .82) 35%, rgba(139, 93, 37, .44) 68%, rgba(21, 32, 25, .92) 100%);
}

body.dim-public .ar-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 250, 241, .22), transparent 22rem),
    linear-gradient(180deg, rgba(21, 32, 25, .18), rgba(21, 32, 25, .58));
  opacity: 1;
  visibility: visible;
  transition: opacity .26s ease, visibility .26s ease;
}

body.dim-public .ar-viewer-shell.is-loaded .ar-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.dim-public .ar-loader__panel {
  width: min(370px, 88vw);
  padding: clamp(1.15rem, 3vw, 1.55rem);
  border: 1px solid rgba(255, 250, 241, .56);
  border-radius: 1.25rem;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, .98), rgba(246, 239, 227, .94));
  color: var(--dim-ink, #152019);
  text-align: center;
  box-shadow: 0 22px 58px rgba(0, 0, 0, .26);
}

body.dim-public .ar-loader__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto .8rem;
  border-radius: 999px;
  background: rgba(184, 134, 59, .14);
}

body.dim-public .ar-loader__mark::before {
  content: "";
  position: absolute;
  inset: .25rem;
  border: .2rem solid rgba(38, 68, 51, .18);
  border-top-color: var(--dim-gold, #b8863b);
  border-radius: inherit;
  animation: arLoaderSpin 1s linear infinite;
}

body.dim-public .ar-loader__mark span {
  width: .7rem;
  height: .7rem;
  border-radius: 999px;
  background: var(--dim-forest, #264433);
  box-shadow: 0 0 0 .45rem rgba(38, 68, 51, .08);
}

body.dim-public .ar-loader__title {
  font-family: var(--dim-font-serif, Georgia, serif);
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -.025em;
}

body.dim-public .ar-loader__hint,
body.dim-public .ar-loader__percent,
body.dim-public .ar-viewer-meta p {
  color: var(--dim-muted, #667066);
}

body.dim-public .ar-loader__hint {
  margin-top: .25rem;
  font-size: .94rem;
  line-height: 1.45;
}

body.dim-public .ar-loader__bar {
  height: .55rem;
  margin-top: 1rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 68, 51, .14);
}

body.dim-public .ar-loader__bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--dim-gold, #b8863b), var(--dim-forest, #264433));
  transition: width .18s ease;
}

body.dim-public .ar-loader__percent {
  margin-top: .45rem;
  font-size: .88rem;
  font-weight: 750;
}

body.dim-public .ar-fullscreen-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  max-width: calc(100% - 2rem);
  padding: .58rem .86rem;
  border: 1px solid rgba(255, 250, 241, .46);
  border-radius: 999px;
  background: rgba(21, 32, 25, .76);
  color: #fffaf1;
  font-weight: 800;
  line-height: 1.1;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
  backdrop-filter: blur(10px);
}

body.dim-public .ar-fullscreen-btn:hover,
body.dim-public .ar-fullscreen-btn:focus-visible {
  background: rgba(38, 68, 51, .94);
  color: #fff;
}

body.dim-public .ar-fullscreen-btn[hidden] {
  display: none !important;
}

body.dim-public .ar-fullscreen-btn__icon {
  font-size: 1.05rem;
  line-height: 1;
}

body.dim-public .ar-error-panel {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 8;
  width: min(520px, calc(100% - 2rem));
  transform: translateX(-50%);
  padding: .95rem 1rem;
  border: 1px solid rgba(122, 38, 31, .22);
  border-radius: 1rem;
  background: rgba(255, 250, 241, .97);
  color: #672018;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .22);
}

body.dim-public .ar-error-panel strong,
body.dim-public .ar-error-panel span {
  display: block;
}

body.dim-public .ar-error-panel span {
  margin-top: .25rem;
}

body.dim-public .ar-viewer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

body.dim-public .ar-viewer-meta p {
  margin: 0;
  font-size: .96rem;
}

body.dim-public .ar-viewer-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  background: #17110b;
}

body.dim-public .ar-viewer-shell:fullscreen .ar-model-viewer {
  height: 100vh;
}

body.dim-public .ar-viewer-shell:fullscreen .ar-fullscreen-btn {
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
}

@keyframes arLoaderSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 899.98px), (pointer: coarse) {
  body.dim-public .listing-page--ar-detail {
    width: min(100% - 1rem, 1180px);
  }

  body.dim-public .ar-fullscreen-btn {
    display: none !important;
  }

  body.dim-public .ar-viewer-shell,
  body.dim-public .ar-model-viewer {
    min-height: 62vh;
    height: 62vh;
  }

  body.dim-public .ar-viewer-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.dim-public .ar-loader,
  body.dim-public .ar-loader__bar span {
    transition: none !important;
  }

  body.dim-public .ar-loader__mark::before {
    animation: none !important;
  }
}
