/* Rich mini-UI previews for mega menu tool cards */
.mega-tool-preview {
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border2, #243346);
  background: linear-gradient(155deg, #141c28 0%, #0e141c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}
.mega-tool-card:hover .mega-tool-preview {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 16px rgba(0, 0, 0, 0.35);
}

.mega-preview {
  width: 100%;
  height: 100%;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 0.5rem;
  line-height: 1.2;
  color: #8fa0b4;
  user-select: none;
  pointer-events: none;
}

/* ── Calculator ── */
.mega-preview--calc { gap: 5px; }
.mp-calc-screen {
  flex-shrink: 0;
  padding: 4px 6px;
  border-radius: 4px;
  background: #0a0e14;
  border: 1px solid #1a2533;
  text-align: right;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e4eaf4;
  font-variant-numeric: tabular-nums;
}
.mp-calc-keys {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  min-height: 0;
}
.mp-calc-keys b {
  display: block;
  border-radius: 3px;
  background: #1e2a3a;
  border: 1px solid #2a3848;
  min-height: 0;
}
.mp-calc-keys b.op {
  background: rgba(201, 162, 39, 0.22);
  border-color: rgba(201, 162, 39, 0.35);
}
.mp-calc-keys b.eq {
  grid-column: span 2;
  background: linear-gradient(135deg, #c9a227 0%, #a88720 100%);
  border-color: transparent;
}

/* ── NDS ── */
.mega-preview--nds { gap: 3px; }
.mp-tabs {
  display: flex;
  gap: 3px;
}
.mp-tabs i {
  flex: 1;
  font-style: normal;
  text-align: center;
  padding: 2px 0;
  border-radius: 4px;
  font-size: 0.46rem;
  font-weight: 700;
  background: #1a2432;
  color: #6d8098;
  border: 1px solid #243346;
}
.mp-tabs i.on {
  background: rgba(201, 162, 39, 0.18);
  color: #e8c96a;
  border-color: rgba(201, 162, 39, 0.35);
}
.mp-input {
  padding: 3px 5px;
  border-radius: 4px;
  background: #0a0e14;
  border: 1px solid #243346;
  font-size: 0.54rem;
  font-weight: 600;
  color: #c8d4e4;
  font-variant-numeric: tabular-nums;
}
.mp-result {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(45, 212, 163, 0.1);
  border: 1px solid rgba(45, 212, 163, 0.28);
}
.mp-result small {
  font-size: 0.44rem;
  font-weight: 700;
  color: #5ec9a8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.mp-result strong {
  font-size: 0.58rem;
  font-weight: 800;
  color: #2dd4a3;
  font-variant-numeric: tabular-nums;
}

/* ── Percent ── */
.mega-preview--pct {
  justify-content: center;
  gap: 6px;
  padding-top: 10px;
}
.mp-badge {
  align-self: flex-start;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.52rem;
  font-weight: 800;
  color: #ffb4b4;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.mp-price-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.mp-price-row .old {
  font-size: 0.5rem;
  color: #5a6a7e;
  text-decoration: line-through;
}
.mp-price-row .arrow {
  font-size: 0.46rem;
  color: #3d4f63;
}
.mp-price-row .new {
  font-size: 0.62rem;
  font-weight: 800;
  color: #c9a227;
}

/* ── Area ── */
.mega-preview--area {
  align-items: center;
  justify-content: center;
  padding: 6px;
}
.mp-room {
  position: relative;
  width: 72%;
  height: 70%;
  border: 2px solid rgba(201, 162, 39, 0.55);
  border-radius: 3px;
  background: rgba(201, 162, 39, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mp-room .mp-area-val {
  font-size: 0.58rem;
  font-weight: 800;
  color: #2dd4a3;
}
.mp-dim {
  position: absolute;
  font-size: 0.42rem;
  font-weight: 700;
  color: #8fa0b4;
  white-space: nowrap;
}
.mp-dim.w { bottom: -10px; left: 50%; transform: translateX(-50%); }
.mp-dim.h { right: -20px; top: 50%; margin-top: -3px; }

/* ── Material icons (SVG sprite) ── */
.mega-tool-preview--mat {
  height: 96px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(201, 162, 39, 0.14), transparent 55%),
    linear-gradient(165deg, rgba(44, 58, 80, 0.65) 0%, rgba(28, 38, 54, 0.5) 100%);
}
.mega-preview--mat {
  padding: 0;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.mp-mat-img,
.mp-mat-svg {
  width: 76px;
  height: 76px;
  display: block;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
  transition: transform 0.2s ease;
}
.mega-tool-card:hover .mp-mat-img,
.mega-tool-card:hover .mp-mat-svg {
  transform: scale(1.06);
}
.mega-preview--mat-glass .mp-mat-img,
.mega-preview--mat-glass .mp-mat-svg {
  filter: drop-shadow(0 4px 12px rgba(126, 200, 232, 0.25));
}
.mega-preview--mat-paint .mp-mat-img,
.mega-preview--mat-paint .mp-mat-svg,
.mega-preview--mat-tile .mp-mat-img,
.mega-preview--mat-tile .mp-mat-svg,
.mega-preview--mat-laminate .mp-mat-img,
.mega-preview--mat-laminate .mp-mat-svg,
.mega-preview--mat-boards .mp-mat-img,
.mega-preview--mat-boards .mp-mat-svg,
.mega-preview--mat-wallpaper .mp-mat-img,
.mega-preview--mat-wallpaper .mp-mat-svg {
  filter: drop-shadow(0 4px 10px rgba(201, 162, 39, 0.2));
}

@media (max-width: 420px) {
  .mega-tool-preview { height: 80px; }
  .mega-tool-preview--mat { height: 88px; }
  .mp-mat-img,
  .mp-mat-svg { width: 68px; height: 68px; }
  .mega-preview { font-size: 0.46rem; }
}
