/* DPC product cards: photo-first composition, component badges and animated FPS meter. */

.dpc-pc-card {
  position: relative;
  isolation: isolate;
}

.dpc-pc-card__media {
  position: relative !important;
  aspect-ratio: 4 / 3 !important;
  min-height: 0;
  margin-bottom: 14px !important;
  background:
    radial-gradient(circle at 50% 44%, rgba(34, 211, 238, 0.09), transparent 58%),
    #06070a;
}

.dpc-pc-card--padded > .dpc-pc-card__media {
  border-radius: 16px !important;
}

.dpc-pc-card__media::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 32%;
  pointer-events: none;
  background: linear-gradient(to top, rgba(3, 7, 18, 0.42), transparent);
}

.dpc-pc-card__media .case-img,
.dpc-pc-card__media > img {
  object-fit: cover !important;
  object-position: center !important;
}

.dpc-pc-card__legacy-specs,
.dpc-pc-card__legacy-mini-specs,
.dpc-pc-card__legacy-fps {
  display: none !important;
}

.dpc-component-badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 18px;
}

.dpc-pc-card:not(.dpc-pc-card--padded) > .dpc-component-badges {
  margin-inline: 16px;
}

.dpc-component-badge {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: #dbe6ee;
}

.dpc-component-badge__label {
  flex: 0 0 auto;
  color: #22d3ee;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.12em;
}

.dpc-component-badge strong {
  min-width: 0;
  overflow: hidden;
  color: #e7edf3;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dpc-fps-meter {
  --dpc-fps-angle: -82deg;
  --dpc-fps-progress: 0;
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  width: 98px;
  height: 67px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 13px;
  background: rgba(5, 9, 16, 0.78);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.dpc-fps-meter__dial {
  position: absolute;
  top: 2px;
  left: 9px;
  width: 80px;
  height: 51px;
  overflow: visible;
  fill: none;
}

.dpc-fps-meter__track,
.dpc-fps-meter__progress {
  fill: none;
  stroke-linecap: round;
  stroke-width: 4;
}

.dpc-fps-meter__track {
  stroke: rgba(255, 255, 255, 0.13);
}

.dpc-fps-meter__progress {
  stroke: #22d3ee;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.62));
  transition: stroke-dashoffset 1.05s cubic-bezier(0.16, 1, 0.3, 1);
}

.dpc-fps-meter__needle {
  stroke: #f8fafc;
  stroke-linecap: round;
  stroke-width: 2.2;
  transform: rotate(-82deg);
  transform-box: view-box;
  transform-origin: 44px 47px;
  transition: transform 1.05s cubic-bezier(0.17, 0.89, 0.32, 1.22);
}

.dpc-fps-meter__hub {
  fill: #22d3ee;
  stroke: #dffbff;
  stroke-width: 1.4;
}

.dpc-fps-meter.is-active .dpc-fps-meter__progress {
  stroke-dashoffset: calc(100 - var(--dpc-fps-progress));
}

.dpc-fps-meter.is-active .dpc-fps-meter__needle {
  transform: rotate(var(--dpc-fps-angle));
}

.dpc-fps-meter__value {
  position: absolute;
  z-index: 2;
  top: 28px;
  left: 0;
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.dpc-fps-meter__value strong {
  font-family: 'Unbounded', sans-serif;
  font-size: 15px;
  font-weight: 800;
}

.dpc-fps-meter__value small {
  color: #67e8f9;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.dpc-fps-meter__label {
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  color: #9ba8b6;
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

#full-catalog-grid > .dpc-pc-card {
  padding: 16px !important;
}

@media (min-width: 1024px) {
  #full-catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1536px) {
  #full-catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 639px) {
  .dpc-pc-card__media {
    aspect-ratio: 4 / 3 !important;
    margin-bottom: 12px !important;
  }

  .dpc-component-badges {
    gap: 6px;
    margin-bottom: 16px;
  }

  .dpc-component-badge {
    min-height: 36px;
    padding: 8px 9px;
  }

  .dpc-component-badge strong {
    font-size: 10.5px;
  }

  .dpc-fps-meter {
    top: 9px;
    right: 9px;
    width: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dpc-fps-meter__progress,
  .dpc-fps-meter__needle,
  .dpc-pc-card .case-img,
  .dpc-pc-card__media > img {
    transition: none !important;
  }
}
