:root {
  --mg3d-blue: #0d5a7f;
  --mg3d-orange: #fa803f;
  --mg3d-green: #587755;
  --mg3d-cream: #f7ecda;
  --mg3d-ink: #173247;
}

.mg3d-product-module {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
}

.mg3d-product-card {
  position: relative;
  height: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  padding: 0;
}

.mg3d-open-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  padding: 0;
  min-width: 0;
  min-height: 0;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}

.mg3d-product-card__stage {
  position: relative;
  width: 100%;
  height: 100%;
}

.mg3d-compact-shell {
  position: relative;
  min-height: 420px;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
}

model-viewer.mg3d-model-viewer {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 280px;
}

.mg3d-model-viewer--compact {
  height: 100%;
  border-radius: inherit;
  min-height: 420px;
}

.mg3d-model-viewer--modal {
  min-height: 540px;
  border-radius: 28px;
}

.mg3d-open-modal--corner {
  position: absolute;
  z-index: 6;
  width: 48px;
  height: 48px;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(13, 90, 127, 0.12);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  opacity: 0.5;
  pointer-events: auto;
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.mg3d-compact-controls {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

.mg3d-compact-controls > button {
  pointer-events: auto;
}

.mg3d-open-modal--corner-br {
  right: 0;
  top: 0;
  bottom: auto;
  transform: translateY(-4px);
}

.mg3d-compact-shell:hover .mg3d-open-modal--corner,
.mg3d-compact-shell:focus-within .mg3d-open-modal--corner,
.mg3d-product-card__stage:hover .mg3d-open-modal--corner,
.mg3d-product-card__stage:focus-within .mg3d-open-modal--corner,
.mg3d-open-modal--corner:focus-visible,
.mg3d-open-modal--corner:hover,
.mg3d-mobile-control:hover,
.mg3d-mobile-control:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.mg3d-open-modal--corner:hover {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(13, 90, 127, 0.28);
}

.mg3d-open-modal--corner span,
.mg3d-open-modal--corner span::before,
.mg3d-open-modal--corner span::after {
  position: absolute;
  display: block;
  content: '';
}

.mg3d-open-modal--corner span {
  width: 100%;
  height: 100%;
  inset: 0;
}

.mg3d-open-modal--corner-br span::before {
  top: 14px;
  right: 14px;
  width: 12px;
  height: 12px;
  border-top: 2px solid rgba(23, 50, 71, 0.76);
  border-right: 2px solid rgba(23, 50, 71, 0.76);
}

.mg3d-open-modal--corner-br span::after {
  left: 14px;
  bottom: 14px;
  width: 12px;
  height: 12px;
  border-left: 2px solid rgba(23, 50, 71, 0.76);
  border-bottom: 2px solid rgba(23, 50, 71, 0.76);
}

.mg3d-modal__eyebrow,
.mg3d-hotspot-panel__eyebrow {
  margin: 0 0 10px;
  color: var(--mg3d-blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mg3d-modal__title {
  margin: 0;
  color: var(--mg3d-ink);
  font-size: clamp(1.8rem, 2vw, 2.7rem);
  font-weight: 800;
  line-height: 1.05;
}

.mg3d-modal__description,
.mg3d-modal__intro,
.mg3d-hotspot-panel__description {
  color: rgba(23, 50, 71, 0.82);
  font-size: 1rem;
  line-height: 1.65;
}

.mg3d-modal__price {
  margin-top: 16px;
  color: var(--mg3d-orange);
  font-size: 1.4rem;
  font-weight: 800;
}

.mg3d-hotspot {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  padding: 0 !important;
  margin: 0 !important;
  appearance: none !important;
  background: transparent !important;
  border: 0 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

.mg3d-hotspot--preview-only {
  pointer-events: none !important;
}

.mg3d-hotspot__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(var(--mg3d-hotspot-rgb, 255, 255, 255), 0.92);
  border: 3px solid var(--mg3d-hotspot-color, #ffffff);
  box-shadow: 0 10px 20px rgba(13, 90, 127, 0.18);
}

.mg3d-hotspot__inner::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  border: 2px solid rgba(var(--mg3d-hotspot-rgb, 255, 255, 255), 0.38);
  animation: mg3d-hotspot-pulse 1.8s ease-out infinite;
}

.mg3d-hotspot.is-active .mg3d-hotspot__inner {
  transform: scale(1.18);
}

@keyframes mg3d-hotspot-pulse {
  0% {
    opacity: 0.85;
    transform: scale(0.8);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

.mg3d-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
}

.mg3d-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 26, 39, 0.72);
  backdrop-filter: blur(8px);
}

.mg3d-modal__dialog {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(1380px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  border-radius: 32px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(250, 128, 63, 0.12), transparent 28%),
    linear-gradient(160deg, rgba(247, 236, 218, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.32);
}

.mg3d-modal__layout {
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(420px, 1fr);
  width: 100%;
  min-height: min(820px, calc(100vh - 32px));
}

.mg3d-modal__copy {
  overflow: auto;
  padding: 42px 34px 36px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 236, 218, 0.92)),
    linear-gradient(180deg, rgba(13, 90, 127, 0.04), transparent 24%);
}

.mg3d-modal__description,
.mg3d-modal__intro {
  margin-top: 16px;
}

.mg3d-hotspot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.mg3d-hotspot-tab {
  border: 1px solid rgba(13, 90, 127, 0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--mg3d-blue);
  cursor: pointer;
  font-weight: 700;
  padding: 10px 14px;
}

.mg3d-hotspot-tab.is-active {
  background: var(--mg3d-blue);
  border-color: var(--mg3d-blue);
  color: #fff;
}

.mg3d-hotspot-panels {
  margin-top: 24px;
}

.mg3d-hotspot-panel {
  animation: mg3d-panel-in 180ms ease;
}

.mg3d-hotspot-panel:not(.is-active) {
  display: none !important;
}

@keyframes mg3d-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mg3d-hotspot-panel__logo {
  width: 128px;
  height: 128px;
  margin-bottom: 18px;
  border-radius: 22px;
  background: rgba(13, 90, 127, 0.06);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.mg3d-hotspot-panel__logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mg3d-hotspot-panel__title {
  margin: 0;
  color: var(--mg3d-ink);
  font-size: 1.6rem;
  line-height: 1.15;
}

.mg3d-hotspot-panel__facts {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
}

.mg3d-hotspot-panel__facts div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
}

.mg3d-hotspot-panel__facts dt {
  color: rgba(23, 50, 71, 0.64);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mg3d-hotspot-panel__facts dd {
  margin: 0;
  color: var(--mg3d-ink);
  font-weight: 700;
}

.mg3d-hotspot-panel__section-title {
  margin: 22px 0 10px;
  color: rgba(23, 50, 71, 0.72);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mg3d-swatch-list {
  display: grid;
  gap: 10px;
}

.mg3d-swatch {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: center;
}

.mg3d-swatch__chip {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--mg3d-swatch, #ddd);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.mg3d-swatch__copy {
  display: grid;
  gap: 2px;
}

.mg3d-swatch__copy strong {
  color: var(--mg3d-ink);
  font-size: 0.97rem;
}

.mg3d-swatch__copy span {
  color: rgba(23, 50, 71, 0.62);
  font-size: 0.86rem;
}

.mg3d-hotspot-panel__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mg3d-orange), #ff9e64);
  box-shadow: 0 14px 28px rgba(250, 128, 63, 0.24);
  color: #fff;
  font-weight: 700;
  padding: 13px 18px;
  text-decoration: none;
}

.mg3d-modal__footer-cta {
  margin: 24px 0 0;
}

.mg3d-modal__stage {
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 20%, rgba(13, 90, 127, 0.12), transparent 20%),
    linear-gradient(180deg, rgba(197, 225, 241, 0.55), rgba(255, 255, 255, 0.65));
  padding: 26px;
}

.mg3d-modal__viewer-shell {
  width: 100%;
  height: 100%;
  min-height: min(760px, calc(100vh - 84px));
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(13, 90, 127, 0.12);
  background:
    radial-gradient(circle at bottom left, rgba(13, 90, 127, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 249, 252, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.mg3d-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--mg3d-ink);
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
}

body.mg3d-modal-open {
  overflow: hidden;
}

.mg3d-mobile-control {
  display: none;
  position: relative;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  opacity: 0.5;
  transition: opacity 180ms ease, background 180ms ease;
}

@media (hover: none) and (pointer: coarse) {
  .mg3d-compact-controls {
    inset: auto;
    top: 18px;
    right: 18px;
    gap: 10px;
    pointer-events: auto;
  }

  .mg3d-open-modal--corner {
    position: relative;
    transform: none;
  }

  .mg3d-mobile-control {
    display: block;
  }

  .mg3d-scroll-hotspot span,
  .mg3d-scroll-hotspot span::before,
  .mg3d-ar-hotspot span {
    position: absolute;
    display: block;
  }

  .mg3d-scroll-hotspot span {
    inset: 0;
  }

  .mg3d-scroll-hotspot span::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(0, 0, 0, 0.42);
    border-bottom: 2px solid rgba(0, 0, 0, 0.42);
    transform: translate(-50%, -60%) rotate(45deg);
  }

  .mg3d-ar-hotspot {
    color: var(--mg3d-ink);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.04em;
  }

  .mg3d-ar-hotspot span {
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
  }

  .mg3d-wrap--scroll-strip.mg3d--strip-hidden .mg3d-scroll-hotspot {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 1100px) {
  .mg3d-modal__layout {
    grid-template-columns: 1fr;
  }

  .mg3d-modal__dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    margin: 10px auto;
  }

  .mg3d-modal__copy {
    max-height: 48vh;
    order: 2;
  }

  .mg3d-modal__viewer-shell {
    min-height: 48vh;
  }

  .mg3d-modal__stage {
    order: 1;
  }
}

@media (max-width: 640px) {
  .mg3d-modal__copy {
    padding: 28px 20px 24px;
  }

  .mg3d-modal__stage {
    padding: 14px;
  }

  .mg3d-hotspot-panel__facts div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
