/* CP338: shorten model discovery without hiding any model records or compatibility pages. */
.pg-brand-model-index > .container > .product-lead {
  max-width: 64ch;
  margin-block: 8px 14px;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.55;
}

.pg-brand-model-index .pg-brand-model-summary {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px;
  margin: 10px 0 14px;
}
.pg-brand-model-index .pg-brand-model-summary > div {
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid rgba(91, 154, 193, .24);
  border-radius: 12px;
  background: rgba(5, 16, 28, .68);
}
.pg-brand-model-index .pg-brand-model-summary strong {
  color: #9fc8e5;
  font-size: .75rem;
  line-height: 1.35;
}
.pg-brand-model-index .pg-brand-model-summary span {
  margin-top: 3px;
  color: #f3f6f8;
  font-size: .92rem;
  font-weight: 750;
}

.pg-model-discovery-page .registry-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-block: 14px 10px;
  padding: 12px;
}
.pg-model-discovery-page .registry-search { min-width: 0; }
.pg-model-discovery-page .registry-clear { min-height: 44px; }
.pg-model-discovery-page .registry-count { white-space: nowrap; }
.pg-brand-model-index .pg-model-quick-brand { display: none; }
.pg-model-discovery-page .registry-grid[data-pg-registry] {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-auto-rows: minmax(132px, auto) !important;
  align-content: start;
  align-items: stretch;
  gap: 12px;
  max-height: none !important;
  height: auto !important;
  margin-block: 12px;
  overflow: visible !important;
}
.pg-model-discovery-page .registry-grid[data-pg-registry][hidden],
.pg-model-discovery-page .registry-grid[data-pg-registry] > [data-pg-registry-card][hidden] {
  display: none !important;
}
.pg-model-discovery-page .registry-grid[data-pg-registry] > .pg-model-quick-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  align-items: start;
  gap: 7px;
  min-width: 0;
  min-height: 132px;
  padding: 13px !important;
  border: 1px solid rgba(91, 154, 193, .28) !important;
  border-radius: 13px !important;
  background: linear-gradient(145deg, rgba(7, 20, 34, .98), rgba(3, 10, 18, .98)) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(243, 246, 248, .05) !important;
  color: #f3f6f8;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.pg-model-discovery-page .registry-grid[data-pg-registry] > .pg-model-quick-card:hover,
.pg-model-discovery-page .registry-grid[data-pg-registry] > .pg-model-quick-card:focus-visible {
  border-color: rgba(255, 22, 60, .68) !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .28), 0 0 0 1px rgba(255, 22, 60, .16) !important;
  transform: translateY(-2px);
}
.pg-model-quick-brand {
  color: #66beff;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.pg-model-quick-card h2 {
  margin: 0 !important;
  padding-inline-start: 0 !important;
  border-inline-start: 0 !important;
  color: #f3f6f8;
  font-size: clamp(.88rem, 1vw, 1rem) !important;
  line-height: 1.28;
  overflow-wrap: anywhere;
}
.pg-model-quick-status {
  align-self: start;
  color: #b4c5d5;
  font-size: .72rem;
  line-height: 1.3;
}
.pg-model-quick-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 34px;
  padding-top: 5px;
  border-top: 1px solid rgba(91, 154, 193, .16);
  color: #ff163c;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.25;
}
.pg-model-quick-action > span { color: #f3f6f8; font-size: 1.05rem; }
.pg-model-discovery-page .pg-registry-pagination { margin-block: 12px 20px; }
.pg-model-discovery-page .pg-registry-pagination-count { font-size: .82rem; }

@media (min-width: 769px) and (max-width: 1100px) {
  .pg-model-discovery-page .registry-grid[data-pg-registry] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 768px) {
  .pg-model-discovery-page .registry-tools {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-block: 12px 8px;
    padding: 10px;
  }
  .pg-model-discovery-page .registry-tools > .registry-search { grid-column: 1 / -1; width: 100%; }
  .pg-model-discovery-page .registry-tools > .registry-brand-source { display: none !important; }
  .pg-model-discovery-page .registry-tools > .registry-clear { grid-column: 1; justify-self: start; }
  .pg-model-discovery-page .registry-tools > .registry-count { grid-column: 2; justify-self: end; max-width: 100%; white-space: normal; text-align: right; font-size: .75rem; }
  .pg-model-discovery-page .registry-grid[data-pg-registry] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(126px, auto) !important;
    gap: 9px;
  }
  .pg-model-discovery-page .registry-grid[data-pg-registry] > .pg-model-quick-card {
    min-height: 126px;
    padding: 11px !important;
    gap: 6px;
  }
  .pg-brand-model-index .pg-brand-model-summary { gap: 6px; margin-block: 8px 12px; }
  .pg-brand-model-index .pg-brand-model-summary > div { padding: 8px; }
  .pg-brand-model-index .pg-brand-model-summary strong { font-size: .68rem; }
  .pg-brand-model-index .pg-brand-model-summary span { font-size: .82rem; overflow-wrap: anywhere; }
}

/* A hidden filter backdrop must not become a blank grey tile through broad button rules. */
.pg-filter-backdrop[hidden] { display: none !important; visibility: hidden !important; }
@media (max-width: 359px) {
  .pg-model-discovery-page .registry-grid[data-pg-registry] { gap: 7px; }
  .pg-model-discovery-page .registry-grid[data-pg-registry] > .pg-model-quick-card { padding: 9px !important; }
  .pg-model-quick-action { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-model-discovery-page .registry-grid[data-pg-registry] > .pg-model-quick-card { transition: none; }
  .pg-model-discovery-page .registry-grid[data-pg-registry] > .pg-model-quick-card:hover,
  .pg-model-discovery-page .registry-grid[data-pg-registry] > .pg-model-quick-card:focus-visible { transform: none; }
}

/* Product cards keep the approved red/blue shield legible behind real photos on phones. */
@media (max-width: 900px) {
  .pg-category-items .pg-catalogue-card {
    grid-template-columns: clamp(82px, 22vw, 98px) minmax(0, 1fr) !important;
  }
  .pg-category-items .pg-catalogue-card > .pg-catalogue-card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-color: rgba(255, 22, 60, .38);
    box-shadow: inset 0 0 0 1px rgba(16, 156, 255, .22), 0 5px 14px rgba(0, 0, 0, .3);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
  }
  .pg-category-items .pg-catalogue-card > .pg-catalogue-card-image img {
    object-fit: contain;
    filter: drop-shadow(0 5px 7px rgba(0, 0, 0, .44));
  }
}
