/* The card a Catalog row in the search dropdown opens (app/catalog-card.tsx).
   A centred dialog; at 640px and under a bottom sheet with a sticky button.
   Tokens are the site's v3 palette (home.css / parts.css :root), scoped to the
   card so nothing leaks into page styles. */
.catalog-scrim,
.catalog-block {
  --pl-ink: #0e1a2b;
  --pl-slate: #3d5166;
  --pl-muted: #4a6e82;
  --pl-royal: #2843a7;
  --pl-royal-lt: #3a58c4;
  --pl-white: #ffffff;
  --pl-snow2: #eef4f8;
  --pl-border: rgba(90, 138, 167, 0.18);
  --pl-border2: rgba(90, 138, 167, 0.1);
  --pl-catalog: #0e7490;
  --pl-danger: #b00020;
  --pl-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.catalog-scrim {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(14, 26, 43, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
}
/* Pages pin their own font with `* { ... !important }`, so the card pins its
   own the same way (as the dropdown does). */
.catalog-scrim,
.catalog-scrim *,
.catalog-block,
.catalog-block * {
  box-sizing: border-box;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
}
.catalog-scrim .catalog-pn,
.catalog-block .catalog-pn {
  font-family: "Libre Baskerville", Georgia, serif !important;
}
.catalog-dialog {
  position: relative;
  width: min(600px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--pl-white);
  color: var(--pl-ink);
  border-radius: 14px;
  box-shadow:
    0 24px 64px rgba(14, 26, 43, 0.35),
    0 2px 8px rgba(14, 26, 43, 0.12);
  padding: 28px 28px 24px;
  text-align: left;
  animation: pl-pop 0.18s var(--pl-ease);
}
.catalog-dialog:focus {
  outline: none;
}
@keyframes pl-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.catalog-handle {
  display: none;
}

.catalog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--pl-border);
  background: var(--pl-snow2);
  color: var(--pl-slate);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.catalog-close:hover {
  background: var(--pl-royal);
  border-color: var(--pl-royal);
  color: #fff;
}
.catalog-close svg {
  width: 16px;
  height: 16px;
}

.catalog-head {
  padding-right: 48px;
}
.catalog-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.catalog-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--pl-catalog);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-transform: capitalize;
  white-space: nowrap;
}
.catalog-pn {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--pl-ink);
  overflow-wrap: anywhere;
}
.catalog-name {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--pl-slate);
}

.catalog-specs {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  margin: 20px 0 0;
  border-top: 1px solid var(--pl-border2);
}
.catalog-specs dt {
  padding: 13px 12px 12px 0;
  border-bottom: 1px solid var(--pl-border2);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pl-muted);
}
.catalog-specs dd {
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--pl-border2);
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--pl-ink);
}
.catalog-nsn {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.catalog-dash {
  color: var(--pl-muted);
}
.catalog-cage {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 6px;
  vertical-align: 1px;
  background: var(--pl-snow2);
  border: 1px solid var(--pl-border);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: 0.04em;
  color: var(--pl-slate);
  font-variant-numeric: tabular-nums;
}
.catalog-mfr {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.catalog-more,
.catalog-retry {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--pl-royal);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: left;
}
.catalog-more {
  margin-top: 4px;
}
.catalog-retry {
  font-size: 13px;
}
.catalog-sellers {
  font-weight: 600;
  color: var(--pl-royal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.catalog-sellers:focus-visible {
  outline: 3px solid var(--pl-royal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* The #189 bubble: 14px radius, soft gradient, 1px edge in the same hue, a
   round white icon chip. No accent line. */
.catalog-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(40, 67, 167, 0.07),
    rgba(90, 138, 167, 0.1)
  );
  border: 1px solid rgba(40, 67, 167, 0.16);
}
.catalog-note-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pl-white);
  color: var(--pl-royal);
  box-shadow: 0 1px 4px rgba(40, 67, 167, 0.18);
}
.catalog-note-icon svg {
  width: 18px;
  height: 18px;
}
.catalog-note-body {
  min-width: 0;
  padding-top: 4px;
}
.catalog-note strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--pl-ink);
}
.catalog-note p {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--pl-slate);
}
.catalog-note--error {
  background: linear-gradient(
    135deg,
    rgba(176, 0, 32, 0.06),
    rgba(176, 0, 32, 0.1)
  );
  border-color: rgba(176, 0, 32, 0.18);
}
.catalog-note--error .catalog-note-icon {
  color: var(--pl-danger);
  box-shadow: 0 1px 4px rgba(176, 0, 32, 0.18);
}
.catalog-note--skel {
  align-items: center;
}

.catalog-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}
.catalog-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(
    135deg,
    var(--pl-royal) 0%,
    var(--pl-royal-lt) 100%
  );
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(40, 67, 167, 0.28);
  transition:
    box-shadow 0.25s ease,
    transform 0.2s ease;
}
.catalog-cta svg {
  width: 14px;
  height: 14px;
}
.catalog-cta:hover {
  box-shadow: 0 7px 20px rgba(40, 67, 167, 0.4);
  transform: translateY(-2px);
}
.catalog-cta:focus-visible,
.catalog-close:focus-visible,
.catalog-more:focus-visible,
.catalog-retry:focus-visible {
  outline: 3px solid var(--pl-royal);
  outline-offset: 3px;
}

/* Skeleton while the details load. */
.pl-skel {
  display: inline-block;
  height: 12px;
  border-radius: 6px;
  vertical-align: middle;
  background: linear-gradient(90deg, #e3ebf1 25%, #f1f5f8 50%, #e3ebf1 75%);
  background-size: 200% 100%;
  animation: pl-shimmer 1.2s linear infinite;
}
@keyframes pl-shimmer {
  to {
    background-position: -200% 0;
  }
}

/* 640px and under: a bottom sheet, the button sticky and full width. */
@media (max-width: 640px) {
  .catalog-scrim {
    padding: 0;
    place-items: end stretch;
  }
  .catalog-dialog {
    width: 100%;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 40px rgba(14, 26, 43, 0.3);
    padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
    animation-name: pl-rise;
    animation-duration: 0.22s;
  }
  .catalog-handle {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #cbd5e1;
    margin: 0 auto 16px;
  }
  .catalog-close {
    top: 22px;
  }
  .catalog-pn {
    font-size: 24px;
  }
  .catalog-specs {
    grid-template-columns: minmax(0, 1fr);
  }
  .catalog-specs dt {
    padding: 12px 0 0;
    border: 0;
  }
  .catalog-specs dd {
    padding: 2px 0 12px;
  }
  .catalog-actions {
    position: sticky;
    bottom: 0;
    margin-top: 16px;
    padding: 14px 0 0;
    background: var(--pl-white);
  }
  .catalog-cta {
    width: 100%;
    padding: 16px 26px;
  }
}
@keyframes pl-rise {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-dialog,
  .pl-skel {
    animation: none;
  }
  .catalog-cta {
    transition: none;
  }
  .catalog-cta:hover {
    transform: none;
  }
}

/* The catalog part a /parts?pn= search matched (app/parts/catalog-block.tsx),
   under the results. Same surface as .v3-listing-card and .listing-empty. */
.listing-empty-cta {
  white-space: nowrap;
}
.listing-empty-cta svg {
  width: 14px;
  height: 14px;
}
.listing-empty-link {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: #2843a7;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.catalog-block {
  grid-column: 1 / -1;
  margin-top: 16px;
  padding: 22px 24px;
  background: var(--pl-white);
  border: 1px solid var(--pl-border2);
  border-radius: 12px;
  box-shadow:
    0 4px 32px rgba(40, 67, 167, 0.08),
    0 1px 4px rgba(14, 26, 43, 0.06);
  display: grid;
  grid-template-columns: minmax(240px, 1.05fr) 2fr;
  gap: 18px 36px;
  align-items: start;
  color: var(--pl-ink);
}
.catalog-block .catalog-eyebrow {
  margin-bottom: 10px;
}
.catalog-block .catalog-pn {
  font-size: 22px;
}
.catalog-block .catalog-name {
  font-size: 14px;
}
.catalog-block-specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 0;
}
.catalog-block-specs dt {
  margin: 0 0 3px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pl-muted);
}
.catalog-block-specs dd {
  margin: 0;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--pl-ink);
}
.catalog-block-specs .catalog-mfr {
  gap: 2px;
}
.catalog-more-details > summary {
  cursor: pointer;
  list-style: none;
}
.catalog-more-details > summary::-webkit-details-marker {
  display: none;
}
.catalog-more-details > summary:focus-visible {
  outline: 3px solid var(--pl-royal);
  outline-offset: 3px;
  border-radius: 2px;
}
.catalog-more-details[open] > summary {
  display: none;
}
.catalog-block--compact {
  padding: 18px 24px;
  align-items: center;
}
.catalog-block--compact .catalog-pn {
  font-size: 20px;
  margin-bottom: 2px;
}
.catalog-block--compact .catalog-block-specs {
  gap: 10px 20px;
}
@media (max-width: 900px) {
  .catalog-block,
  .catalog-block--compact {
    grid-template-columns: minmax(0, 1fr);
  }
  .catalog-block-specs {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .catalog-block {
    padding: 20px 18px;
  }
  .catalog-block-specs {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
