/* Draggable 3D phone in the TempaCare banner (see phone3d.js). */
.case-banner__stage.has-p3d > .stage {
  display: none;
}

.p3d {
  position: relative;
  width: 100%;
  height: 440px;
  display: grid;
  place-items: center;
  overflow: hidden;
  user-select: none;
}

.p3d__scene {
  position: relative;
  width: 180px;
  height: 390px;
  perspective: 1400px;
  perspective-origin: 50% 40%;
}

.p3d__phone {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  cursor: grab;
  touch-action: none;
  will-change: transform;
}

.p3d.is-dragging .p3d__phone {
  cursor: grabbing;
}

.p3d__layer,
.p3d__back,
.p3d__front {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  backface-visibility: hidden;
}

/* Stacked body layers give the phone its thickness. */
.p3d__layer {
  background: #2b3440;
  backface-visibility: visible;
  box-shadow: inset 0 0 0 1.5px #56606d;
}

.p3d__back {
  background: linear-gradient(160deg, #3a4452, #1d242d);
}

.p3d__cam {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #11161c;
  box-shadow: inset 0 0 0 2px #4a5462;
}

.p3d__front {
  background: #0c1116;
  padding: 7px;
  box-shadow: inset 0 0 0 2px #6b7684;
}

.p3d__front img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  pointer-events: none;
}

.p3d__island {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 56px;
  height: 16px;
  margin-left: -28px;
  border-radius: 10px;
  background: #05080b;
}

.p3d__glare {
  position: absolute;
  inset: 7px;
  border-radius: 24px;
  pointer-events: none;
  background: radial-gradient(120% 70% at 50% 50%, rgba(255, 255, 255, .18), transparent 55%) no-repeat;
  background-size: 220% 220%;
  mix-blend-mode: screen;
}

.p3d__shadow {
  position: absolute;
  left: 50%;
  top: 62%;
  width: 260px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .45), transparent);
  filter: blur(6px);
  pointer-events: none;
}

.p3d__hint {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  transition: opacity .6s;
  pointer-events: none;
}

.p3d.was-dragged .p3d__hint {
  opacity: 0;
}

@media (max-width: 767px) {
  .p3d {
    height: 340px;
  }

  .p3d__scene {
    transform: scale(.62);
  }
}
