/* PC configurator page. Builds on the site variables from styles.css.
   The page runs full screen inside the scaled 1720x1024 stage, without the site header. */

.configurator-page {
  --cfg-panel: rgba(10, 14, 18, 0.92);
  --cfg-card: rgba(255, 255, 255, 0.035);
  --cfg-border: rgba(255, 255, 255, 0.1);
  --cfg-orange: #ff8a1f;
  --cfg-green: #8fe23a;
  --cfg-blue: #2f9bff;
  --cfg-red: #ff4d4d;
}

/* The stage keeps its 1024px height but grows sideways to the window's shape (see fitWideStage). */
.configurator-page .site-stage {
  left: 50%;
}

.configurator-page .section-shell {
  width: calc(100% - 32px);
}

.cfg-main {
  display: flex;
  height: 100%;
  flex-direction: column;
  padding: 14px 0;
  overflow-x: hidden;
  overflow-y: auto;
  letter-spacing: 0.01em;
  background:
    radial-gradient(circle at 70% 35%, rgba(255, 138, 31, 0.1), transparent 30rem),
    radial-gradient(circle at 15% 60%, rgba(0, 214, 223, 0.06), transparent 26rem);
  scrollbar-color: var(--cyan) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.cfg-main h1,
.cfg-main h2,
.cfg-main h3,
.cfg-modal h2,
.cfg-modal h3 {
  margin: 0;
  font-family: "Barlow Condensed", "Nunito", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cfg-icon {
  width: 24px;
  height: 24px;
  flex: none;
  color: var(--muted);
}

.cfg-demo {
  padding: 4px 12px;
  border: 2px solid var(--cfg-yellow, #ffc22f);
  border-radius: 999px;
  color: var(--cfg-yellow, #ffc22f);
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cfg-badge-icon,
.cfg-perks svg,
.cfg-btn svg,
.cfg-gear {
  width: 30px;
  height: 30px;
  flex: none;
  fill: none;
  stroke: var(--cfg-orange);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Top bar ---------- */

.cfg-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 70px;
  margin-bottom: 14px;
}

.cfg-topbar h1 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-right: auto;
  color: var(--text);
  font-size: 60px;
  font-weight: 900;
  line-height: 1;
}

.cfg-gear {
  width: 46px;
  height: 46px;
  stroke: var(--cyan);
  animation: cfg-spin 9s linear infinite;
}

.cfg-badges {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cfg-badges li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border: 1px solid var(--cfg-border);
  border-radius: 8px;
  background: var(--cfg-card);
  color: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-transform: uppercase;
}

.cfg-back {
  min-height: 56px;
  margin-left: 8px;
  font-size: 1.35rem;
}

.cfg-loading {
  padding: 80px 0;
  color: var(--muted);
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

/* ---------- Layout ---------- */

.cfg-version {
  margin: 6px 0 -6px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-align: center;
  opacity: 0.7;
}

.cfg-grid {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(560px, 32%) 1fr;
  gap: 18px;
}

.cfg-panel {
  min-width: 0;
  min-height: 0;
  padding: 16px 18px;
  border: 1px solid var(--cfg-border);
  border-radius: 12px;
  background: var(--cfg-panel);
  box-shadow: var(--shadow);
}

.cfg-quick {
  display: flex;
  flex-direction: column;
  border-color: rgba(255, 138, 31, 0.45);
}

.cfg-detail {
  display: grid;
  grid-template-areas:
    "title title side"
    "slots preview side";
  grid-template-columns: minmax(340px, 26%) 1fr minmax(290px, 23%);
  grid-template-rows: auto 1fr;
  gap: 14px 16px;
  border-color: rgba(0, 214, 223, 0.4);
}

.cfg-panel-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--cfg-border);
  font-size: 30px;
  font-weight: 800;
}

.cfg-panel-title small {
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
}

.cfg-title-orange {
  color: var(--cfg-orange);
}

.cfg-title-cyan {
  grid-area: title;
  color: var(--cyan);
}

.cfg-subtitle {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

/* ---------- Buttons ---------- */

.cfg-btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 2px solid transparent;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.cfg-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.cfg-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.cfg-btn small {
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.cfg-btn:focus-visible,
.cfg-slot:focus-visible,
.cfg-pick:focus-visible,
.cfg-comp-card:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.cfg-btn-wide {
  width: 100%;
}

.cfg-btn-cyan {
  border-color: var(--cyan);
  color: #031012;
  background: var(--cyan);
}

.cfg-btn-cyan-outline {
  border-color: var(--cyan);
  color: var(--cyan);
}

.cfg-btn-cyan-outline:hover {
  color: #031012;
  background: var(--cyan);
}

.cfg-btn-orange {
  border-color: var(--cfg-orange);
  color: #120800;
  background: var(--cfg-orange);
}

.cfg-btn-orange-outline {
  border-color: var(--cfg-orange);
  color: var(--cfg-orange);
}

.cfg-btn-orange-outline:hover {
  color: #120800;
  background: var(--cfg-orange);
}

.cfg-btn-orange-glow {
  border-color: var(--cfg-orange);
  color: var(--cfg-orange);
  box-shadow: 0 0 18px rgba(255, 138, 31, 0.35), inset 0 0 12px rgba(255, 138, 31, 0.15);
}

.cfg-btn-orange-glow svg {
  width: 22px;
  height: 22px;
}

.cfg-btn-orange-glow:hover:not(:disabled) {
  color: #120800;
  background: var(--cfg-orange);
}

.cfg-btn-orange-glow:hover:not(:disabled) svg {
  stroke: #120800;
}

.cfg-btn-ghost {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--muted);
}

.cfg-btn-ghost:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ---------- PC render ---------- */

.cfg-pc {
  display: block;
  width: 100%;
  height: 100%;
}

.cfg-spin {
  animation: cfg-spin 1.6s linear infinite;
}

.cfg-spin.is-slow {
  animation-duration: 2.6s;
}

@keyframes cfg-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Case photo + animated overlay. Black photo background is blended away. */
.cfg-pcv {
  position: relative;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  animation: cfg-sway 10s ease-in-out infinite;
  transform-origin: 50% 60%;
}

.cfg-pcv::before {
  position: absolute;
  z-index: 0;
  right: 12%;
  bottom: 4%;
  left: 12%;
  height: 10%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--pc), transparent);
  content: "";
  filter: blur(8px);
  opacity: 0.45;
  animation: cfg-glow 4s ease-in-out infinite;
}

.cfg-pcv img,
.cfg-pcv svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cfg-pcv img {
  z-index: 1;
  object-fit: contain;
  mix-blend-mode: lighten;
}

.cfg-pcv svg {
  z-index: 2;
  overflow: visible;
}

.cfg-pcv text {
  font-family: "Barlow Condensed", sans-serif;
}

/* A slow light sweep across the glass, like a product shot. */
.cfg-pcv::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.07) 48%, transparent 56%) no-repeat;
  background-size: 250% 100%;
  content: "";
  mix-blend-mode: screen;
  pointer-events: none;
  animation: cfg-sheen 7s ease-in-out infinite;
}

@keyframes cfg-sway {
  0%,
  100% {
    transform: perspective(1200px) rotateY(-7deg) translateY(0);
  }
  50% {
    transform: perspective(1200px) rotateY(7deg) translateY(-6px);
  }
}

@keyframes cfg-glow {
  50% {
    opacity: 0.8;
  }
}

@keyframes cfg-sheen {
  0% {
    background-position: 120% 0;
  }
  60%,
  100% {
    background-position: -120% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cfg-spin,
  .cfg-gear,
  .cfg-pcv,
  .cfg-pcv::before,
  .cfg-pcv::after {
    animation: none;
  }
}

/* ---------- Picker filters ---------- */

.cfg-picker-filters {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--cfg-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.cfg-filter {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 10px;
}

.cfg-filter > span {
  color: var(--muted);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cfg-filter > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.cfg-chip {
  min-width: 0;
  min-height: 32px;
  white-space: nowrap;
  padding: 4px 12px;
  border: 1px solid var(--cfg-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.cfg-chip:hover {
  border-color: rgba(255, 138, 31, 0.6);
}

.cfg-chip.is-active {
  border-color: #ff8a1f;
  background: rgba(255, 138, 31, 0.18);
  color: #ffb066;
}

/* Second RAM kit toggle on the RAM row. */
.cfg-slots li {
  position: relative;
}

.cfg-qty {
  position: absolute;
  top: 50%;
  right: 34px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 138, 31, 0.55);
  border-radius: 999px;
  background: #0c0e11;
  color: #ffb066;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transform: translateY(-50%);
}

.cfg-slot.has-qty {
  padding-right: 104px;
}

.cfg-qty:hover {
  background: rgba(255, 138, 31, 0.18);
}

/* ---------- Carousel of ready-made PCs ---------- */

.cfg-carousel {
  position: relative;
  min-height: 0;
  flex: 1;
}

.cfg-car-viewport {
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.cfg-car-viewport::-webkit-scrollbar {
  display: none;
}

.cfg-car-track {
  display: grid;
  height: 100%;
  grid-auto-columns: calc((100% - 20px) / 3);
  grid-auto-flow: column;
  gap: 10px;
}

.cfg-car-arrow {
  position: absolute;
  top: 34%;
  z-index: 2;
  width: 34px;
  height: 52px;
  border: 1px solid var(--cfg-border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(5, 7, 8, 0.85);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.cfg-car-arrow:first-child {
  left: -14px;
}

.cfg-car-arrow:last-child {
  right: -14px;
}

.cfg-car-arrow:hover {
  border-color: var(--cfg-orange);
  color: var(--cfg-orange);
}

.cfg-car-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.cfg-car-dots button {
  width: 22px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.cfg-car-dots button.is-active {
  background: var(--cfg-orange);
}

.cfg-tier {
  --tier: var(--cfg-orange);
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  padding: 26px 10px 12px;
  border: 1px solid color-mix(in srgb, var(--tier) 35%, transparent);
  border-radius: 10px;
  background: var(--cfg-card);
  text-align: center;
  scroll-snap-align: start;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.cfg-tier.is-active {
  border-color: var(--tier);
  box-shadow: 0 0 22px color-mix(in srgb, var(--tier) 35%, transparent);
}

.cfg-tier-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  padding: 2px 8px;
  border-radius: 999px;
  color: #050708;
  background: var(--tier);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
}

.cfg-tier-del {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.cfg-tier-del:hover {
  color: var(--cfg-red);
}

.cfg-tier h3 {
  display: grid;
  min-height: 52px;
  place-items: center;
  margin-top: 6px;
  color: var(--tier);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.05;
}

.cfg-tier-img {
  width: 100%;
  height: 200px;
  margin: 4px 0 8px;
}

.cfg-tier p {
  min-height: 54px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
}

.cfg-tier-specs {
  display: grid;
  width: 100%;
  gap: 4px;
  margin: 0 0 8px;
  padding: 8px 0 0;
  border-top: 1px solid var(--cfg-border);
  list-style: none;
}

.cfg-tier-specs li {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.cfg-tier-specs .cfg-icon {
  width: 17px;
  height: 17px;
}

.cfg-tier-specs span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfg-tier strong {
  margin-top: auto;
  margin-bottom: 8px;
  color: var(--tier);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 28px;
  font-weight: 800;
}

.cfg-btn-tier {
  width: 100%;
  border-color: var(--tier);
  color: var(--tier);
}

.cfg-btn-tier:hover,
.cfg-tier.is-active .cfg-btn-tier {
  color: #050708;
  background: var(--tier);
}

/* ---------- Budget + perks ---------- */

.cfg-budget {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid var(--cfg-border);
  border-radius: 10px;
}

.cfg-budget label {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.cfg-budget input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--cfg-orange);
}

.cfg-budget .cfg-btn {
  min-height: 36px;
  padding: 4px 12px;
  font-size: 17px;
}

.cfg-budget-field {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.cfg-budget-field input {
  width: 84px;
  padding: 6px 8px;
  border: 1px solid var(--cfg-border);
  border-radius: 6px;
  color: var(--text);
  background: #05080a;
  font: inherit;
  font-size: 16px;
}

.cfg-perks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.cfg-perks li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--cfg-border);
  border-radius: 8px;
  color: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.15;
  text-transform: uppercase;
}

/* ---------- Detailed builder ---------- */

.cfg-slots {
  display: flex;
  grid-area: slots;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cfg-slots li {
  flex: 1;
  min-height: 0;
}

.cfg-slot {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border: 1px solid var(--cfg-border);
  border-radius: 8px;
  color: var(--text);
  background: var(--cfg-card);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.cfg-slot:hover {
  border-color: var(--cyan);
  background: rgba(0, 214, 223, 0.06);
}

.cfg-slot.has-conflict {
  border-color: var(--cfg-red);
}

.cfg-slot-img,
.cfg-pick-img,
.cfg-comp-img {
  display: grid;
  width: 56px;
  height: 48px;
  flex: none;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
}

.cfg-slot-img img,
.cfg-pick-img img,
.cfg-comp-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cfg-slot-img .cfg-img-fallback,
.cfg-pick-img .cfg-img-fallback,
.cfg-comp-img .cfg-img-fallback {
  background: #0a0d10;
}

.cfg-img-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
}

.cfg-img-fallback .cfg-icon {
  width: 50%;
  height: 50%;
  max-width: 48px;
  max-height: 48px;
}

.cfg-slot-text {
  flex: 1;
  min-width: 0;
}

.cfg-slot small,
.cfg-pick-text small,
.cfg-comp-text small {
  display: block;
  color: var(--muted);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cfg-slot strong,
.cfg-slot em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfg-slot strong {
  font-size: 15px;
  font-weight: 800;
}

.cfg-slot em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.cfg-chevron {
  color: var(--muted);
  font-size: 26px;
}

.cfg-preview {
  display: flex;
  grid-area: preview;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
}

.cfg-preview-figure {
  min-height: 0;
  flex: 1;
  margin: 0;
  padding: 16px 20px 6px;
  border: 1px solid var(--cfg-border);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 45%, rgba(255, 138, 31, 0.14), transparent 70%), #07090b;
}

.cfg-comp {
  padding: 10px 12px;
  border: 1px solid var(--cfg-border);
  border-radius: 10px;
  background: var(--cfg-card);
}

.cfg-comp h3,
.cfg-card h3 {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.cfg-comp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cfg-comp-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.cfg-comp-nav button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--cfg-border);
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.cfg-comp-nav button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.cfg-comp-card {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  animation: cfg-fade 300ms ease;
}

.cfg-comp-img {
  width: 92px;
  height: 72px;
}

.cfg-comp-text {
  min-width: 0;
  flex: 1;
}

.cfg-comp-text strong,
.cfg-comp-text em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfg-comp-text strong {
  font-size: 16px;
  font-weight: 800;
}

.cfg-comp-text em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.cfg-comp-text b {
  color: var(--cfg-orange);
  font-size: 15px;
}

.cfg-comp-text b i {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

@keyframes cfg-fade {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
}

.cfg-checks ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cfg-checks li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
}

.cfg-checks li::before {
  position: absolute;
  left: 0;
  font-weight: 900;
  content: "\2713";
}

.cfg-checks li.is-ok::before {
  color: var(--cfg-green);
}

.cfg-checks li.is-warn::before {
  left: 5px;
  color: var(--yellow);
  content: "!";
}

.cfg-checks li.is-info::before {
  left: 4px;
  color: #6fb7ff;
  content: "i";
}

.cfg-checks li.is-error {
  color: #ffb3b3;
}

.cfg-checks li.is-error::before {
  color: var(--cfg-red);
  content: "\2715";
}

.cfg-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cfg-actions .cfg-btn {
  min-height: 48px;
}

/* ---------- Side column ---------- */

.cfg-side {
  display: flex;
  grid-area: side;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
}

.cfg-card {
  padding: 12px 14px;
  border: 1px solid var(--cfg-border);
  border-radius: 10px;
  background: var(--cfg-card);
}

.cfg-card-grow {
  flex: 1;
}

.cfg-total p {
  margin: 0;
  color: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cfg-total strong {
  display: block;
  margin: 2px 0 8px;
  color: var(--cfg-orange);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}

.cfg-total small,
.cfg-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
}

.cfg-stats,
.cfg-fps {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.cfg-stats li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 4px 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.cfg-stats .cfg-icon {
  width: 20px;
  height: 20px;
}

.cfg-icon-text {
  color: var(--cfg-green);
  text-align: center;
}

.cfg-stats i {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.cfg-stats b {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--cfg-green);
  transition: width 260ms ease;
}

.cfg-stats em {
  color: var(--cfg-green);
  font-style: normal;
}

.cfg-stats small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cfg-stat-compat.is-low b {
  background: var(--yellow);
}

.cfg-stat-compat.is-low em {
  color: var(--yellow);
}

.cfg-fps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cfg-fps-head h3 {
  white-space: nowrap;
}

.cfg-res {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--cfg-border);
  border-radius: 6px;
}

.cfg-res button {
  padding: 3px 8px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.cfg-res button.is-active {
  color: #031012;
  background: var(--cyan);
}

.cfg-fps li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 800;
}

.cfg-fps strong {
  color: var(--cfg-green);
  white-space: nowrap;
}

.cfg-empty {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.cfg-save-box {
  width: min(480px, 100%);
}

.cfg-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.cfg-export-list {
  display: grid;
  gap: 8px;
}

.cfg-export-list .cfg-btn {
  min-height: 48px;
}

/* Clickable PC cards and the large PC view. */
.cfg-tier[data-view] {
  cursor: pointer;
}

.cfg-tier[data-view]:hover {
  border-color: var(--tier);
}

.cfg-img-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  opacity: 0.8;
}

.cfg-tier .cfg-img-note {
  margin: -6px 0 4px;
  font-size: 11px;
  line-height: 1.2;
}

.cfg-preview-figure {
  display: flex;
  flex-direction: column;
}

.cfg-preview-figure .cfg-pcv {
  min-height: 0;
  flex: 1;
}

.cfg-preview-figure .cfg-img-note,
.cfg-pc-img .cfg-img-note {
  text-align: center;
}

.cfg-modal-box.cfg-pc-box {
  width: min(1180px, 100%);
}

.cfg-pc-body {
  display: grid;
  grid-template-columns: minmax(0, 38%) 1fr;
  gap: 18px;
  min-height: 0;
  flex: 1;
}

.cfg-pc-img {
  height: 360px;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.cfg-pc-img .cfg-pcv {
  min-height: 0;
  flex: 1;
}

.cfg-pc-parts {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.cfg-cheap {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(143, 226, 58, 0.16);
  color: #a9f05a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Modals ---------- */

body.cfg-modal-active {
  overflow: hidden;
}

.cfg-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.cfg-modal[hidden] {
  display: none;
}

.cfg-modal-box {
  display: flex;
  width: min(760px, 100%);
  max-height: min(860px, calc(100vh - 32px));
  flex-direction: column;
  padding: 18px 20px;
  border: 1px solid rgba(0, 214, 223, 0.4);
  border-radius: 12px;
  color: var(--text);
  background: #0a0e12;
  box-shadow: var(--shadow);
}

.cfg-picker-box {
  width: min(900px, 100%);
  height: min(860px, calc(100vh - 32px));
}

.cfg-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cfg-modal-head h2 {
  color: var(--cyan);
  font-size: 28px;
  font-weight: 800;
}

.cfg-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--cfg-border);
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.cfg-picker-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.cfg-picker-tools input[type="search"],
.cfg-picker-tools select,
.cfg-form input,
.cfg-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--cfg-border);
  border-radius: 6px;
  color: var(--text);
  background: #05080a;
  font: inherit;
  font-size: 15px;
}

.cfg-picker-tools input[type="search"] {
  flex: 1 1 260px;
}

.cfg-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.cfg-check input {
  accent-color: var(--cyan);
}

.cfg-picker-count {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.cfg-picker-list,
.cfg-buy-list {
  display: grid;
  gap: 6px;
  min-height: 0;
  margin: 0;
  padding: 0 4px 0 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: var(--cyan) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.cfg-picker-list {
  flex: 1;
  align-content: start;
}

.cfg-pick,
.cfg-buy-list li {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--cfg-border);
  border-radius: 8px;
  color: var(--text);
  background: var(--cfg-card);
  font: inherit;
  text-align: left;
}

.cfg-pick {
  cursor: pointer;
}

.cfg-pick:hover {
  border-color: var(--cyan);
}

.cfg-pick.is-current {
  border-color: var(--cfg-orange);
}

.cfg-pick.has-conflict {
  opacity: 0.6;
}

.cfg-pick.has-conflict em {
  color: #ffb3b3;
}

.cfg-pick-img {
  display: grid;
  width: 56px;
  height: 48px;
  flex: none;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
}

.cfg-pick-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cfg-pick-img .cfg-img-fallback {
  background: #0a0d10;
}

.cfg-pick-text {
  flex: 1;
  min-width: 0;
}

.cfg-pick-text strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.cfg-pick-text em {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.cfg-pick-text small {
  letter-spacing: 0.02em;
  text-transform: none;
}

.cfg-pick-price {
  flex: none;
  color: var(--cfg-orange);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
}

.cfg-buy-list .cfg-btn {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 16px;
}

.cfg-buy-total {
  margin: 14px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.cfg-buy-total strong {
  color: var(--cfg-orange);
  font-size: 24px;
}

.cfg-modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.cfg-modal-foot .form-status {
  flex: 1;
  font-size: 15px;
}

.cfg-form {
  display: grid;
  gap: 10px;
  overflow-y: auto;
}

.cfg-form .cfg-note {
  margin: 0;
}

.cfg-form label > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.cfg-form input,
.cfg-form textarea {
  width: 100%;
}

.cfg-form textarea[readonly] {
  color: var(--muted);
  font-size: 13px;
  resize: vertical;
}

.cfg-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cfg-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 120;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border: 1px solid var(--cyan);
  border-radius: 8px;
  color: var(--text);
  background: #0a0e12;
  box-shadow: var(--shadow);
  font-weight: 800;
  transform: translateX(-50%);
}

.cfg-toast[hidden] {
  display: none;
}

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
  .configurator-page .section-shell {
    width: min(100% - 28px, 720px);
  }

  .cfg-main {
    display: block;
    height: auto;
    overflow: visible;
  }

  .cfg-topbar {
    flex-wrap: wrap;
    height: auto;
  }

  .cfg-topbar h1 {
    font-size: 40px;
  }

  .cfg-gear {
    width: 34px;
    height: 34px;
  }

  .cfg-back {
    order: -1;
    width: 100%;
    min-height: 44px;
    margin: 0;
  }

  .cfg-badges {
    flex-wrap: wrap;
    gap: 8px;
  }

  .cfg-badges li {
    padding: 6px 10px;
    font-size: 14px;
  }

  .cfg-badge-icon {
    width: 22px;
    height: 22px;
  }

  .cfg-grid,
  .cfg-detail {
    display: flex;
    height: auto;
    flex: none;
    flex-direction: column;
  }

  .cfg-panel {
    padding: 14px;
  }

  .cfg-panel-title {
    flex-wrap: wrap;
    font-size: 24px;
  }

  .cfg-panel-title small {
    font-size: 20px;
  }

  .cfg-carousel {
    height: 560px;
    flex: none;
  }

  .cfg-car-track {
    grid-auto-columns: calc((100% - 10px) / 1.6);
  }

  .cfg-car-arrow {
    display: none;
  }

  .cfg-budget {
    flex-wrap: wrap;
  }

  .cfg-budget input[type="range"] {
    flex-basis: 100%;
    order: 3;
  }

  .cfg-budget .cfg-btn {
    margin-left: auto;
  }

  .cfg-perks {
    grid-template-columns: 1fr;
  }

  .cfg-slot {
    min-height: 62px;
  }

  .cfg-preview-figure {
    height: 300px;
    flex: none;
  }

  .cfg-actions .cfg-btn {
    font-size: 16px;
  }

  .cfg-form-row {
    grid-template-columns: 1fr;
  }

  .cfg-filter {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .cfg-filter > div {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cfg-pc-body {
    display: block;
    overflow-y: auto;
  }

  .cfg-pc-img {
    height: 260px;
  }

  .cfg-pick-price {
    font-size: 18px;
  }

  .cfg-buy-list li {
    flex-wrap: wrap;
  }

  .cfg-buy-list .cfg-pick-text {
    flex-basis: calc(100% - 70px);
  }

  .cfg-buy-list .cfg-pick-price {
    margin-left: 68px;
  }

  .cfg-buy-list .cfg-btn {
    margin-left: auto;
  }
}
