.mp-page {
  --mp-blue: #0b5ed7;
  --mp-navy: #0b2f6b;
  --mp-ink: #172033;
  --mp-muted: #5d6878;
  --mp-line: #dce4ef;
  display: grid;
  gap: 22px;
  min-width: 0;
}

.mp-hero {
  padding: 2px 0 4px;
  color: var(--mp-ink);
}

.mp-eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .76rem;
  font-weight: 900;
}

.mp-hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(1.65rem, 5vw, 2.5rem);
  line-height: 1.1;
}

.mp-hero > p:not(.mp-eyebrow) {
  max-width: 700px;
  margin: 8px 0 0;
  color: var(--mp-muted);
  font-size: clamp(.92rem, 2vw, 1.05rem);
  line-height: 1.5;
}

.mp-recurring-note {
  margin: -12px 0 0;
  padding: 8px 12px;
  border-left: 3px solid #8fb8ec;
  border-radius: 0 8px 8px 0;
  background: #f5f9ff;
  color: #3f5877;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.35;
}

.mp-filter-panel {
  background: #fff;
  border: 1px solid var(--mp-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(23, 32, 51, .04);
}

.mp-filter-toggle {
  min-height: 52px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--mp-navy);
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.mp-filter-toggle::-webkit-details-marker { display: none; }

.mp-filter-toggle::after {
  content: "+";
  margin-left: auto;
  font-size: 1.35rem;
  line-height: 1;
}

.mp-filter-panel[open] .mp-filter-toggle::after { content: "−"; }

.mp-filter-count {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--mp-blue);
  font-size: .72rem;
}

.mp-filter-content { padding: 14px; }

.mp-detail {
  background: #fff;
  border: 1px solid var(--mp-line);
  border-radius: 16px;
  padding: clamp(16px, 3vw, 22px);
  box-shadow: 0 5px 18px rgba(23, 32, 51, .05);
}

.mp-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.mp-section-heading h2 {
  margin: 0;
  color: var(--mp-navy);
  font-size: clamp(1.15rem, 3vw, 1.5rem);
}

.mp-section-heading > span {
  color: var(--mp-muted);
  font-size: .84rem;
  font-weight: 700;
}

.mp-results-heading .mp-eyebrow { display: none; }

.mp-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.mp-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.mp-field label {
  font-size: .88rem;
  font-weight: 800;
  color: var(--mp-ink);
}

.mp-field input,
.mp-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #bcc9da;
  border-radius: 9px;
  padding: 8px 10px;
  background: #fff;
  color: var(--mp-ink);
  font: inherit;
}

.mp-field input:focus,
.mp-field select:focus {
  outline: 3px solid rgba(13, 110, 253, .22);
  border-color: var(--mp-blue);
}

.mp-filter-actions,
.mp-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mp-button {
  min-height: 44px;
  padding: 9px 13px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 850;
  text-align: center;
  border: 1px solid transparent;
  cursor: pointer;
}

.mp-button-primary {
  background: var(--mp-blue);
  color: #fff;
}

.mp-button-primary:hover { background: #084fb8; }

.mp-button-secondary {
  border-color: #b8c7db;
  background: #fff;
  color: var(--mp-navy);
}

.mp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mp-card {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5eaf1;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(23, 32, 51, .035);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.mp-cover,
.mp-detail-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #e8f1ff, #f5f8fc);
  overflow: hidden;
  color: var(--mp-navy);
  font-weight: 900;
  text-decoration: none;
}

.mp-cover {
  position: relative;
  aspect-ratio: 4 / 3;
}

.mp-cover img,
.mp-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mp-card-body {
  padding: 10px;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.mp-free-badge {
  align-self: flex-start;
  border-radius: 999px;
  padding: 4px 8px;
  background: #daf8e5;
  color: #146c3a;
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.mp-cover .mp-free-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  box-shadow: 0 2px 7px rgba(20, 108, 58, .12);
}

.mp-card h3 {
  min-height: 2.5em;
  margin: 0;
  font-size: .9rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.mp-card h3 a {
  color: var(--mp-ink);
  text-decoration: none;
}

.mp-card-actions {
  gap: 6px;
  margin-top: 9px;
  flex-wrap: nowrap;
}

.mp-card-actions .mp-button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  padding: 7px 4px;
  font-size: .75rem;
  line-height: 1.15;
}

@media (hover: hover) {
  .mp-card:hover {
    transform: translateY(-2px);
    border-color: #ccd7e5;
    box-shadow: 0 8px 22px rgba(23, 32, 51, .09);
  }
}

.mp-quick-view {
  width: min(780px, calc(100% - 32px));
  max-height: min(720px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  color: var(--mp-ink);
  box-shadow: 0 28px 80px rgba(11, 47, 107, .28);
}

.mp-quick-view::backdrop {
  background: rgba(12, 24, 43, .58);
  backdrop-filter: blur(3px);
}

.mp-availability-dialog {
  width: min(520px, calc(100% - 32px));
  max-height: min(620px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  color: var(--mp-ink);
  box-shadow: 0 28px 80px rgba(11, 47, 107, .28);
}

.mp-availability-dialog::backdrop {
  background: rgba(12, 24, 43, .58);
  backdrop-filter: blur(3px);
}

.mp-availability-shell {
  position: relative;
  max-height: inherit;
  padding: 26px;
  overflow-y: auto;
}

.mp-availability-shell h2,
.mp-unavailable-card h1 {
  margin: 6px 44px 12px 0;
  color: var(--mp-navy);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.2;
}

.mp-availability-message {
  margin: 0 0 20px;
  color: var(--mp-muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.mp-unavailable-page {
  min-height: min(560px, 70vh);
  place-items: center;
}

.mp-unavailable-card {
  width: min(620px, 100%);
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--mp-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(23, 32, 51, .08);
}

.mp-unavailable-material {
  margin: 0 0 14px;
  color: var(--mp-ink);
  font-weight: 850;
}

.mp-unavailable-card .mp-button { margin: 4px 8px 0 0; }

.mp-quick-view-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  max-height: inherit;
  overflow: auto;
}

.mp-quick-view-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #d8e0ea;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--mp-navy);
  font: 700 1.5rem/1 sans-serif;
  cursor: pointer;
}

.mp-quick-view-cover {
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(145deg, #e8f1ff, #f5f8fc);
  color: var(--mp-navy);
  font-weight: 900;
}

.mp-quick-view-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mp-quick-view-content {
  min-width: 0;
  padding: 26px;
}

.mp-quick-view-content h2 {
  margin: 10px 44px 8px 0;
  color: var(--mp-navy);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.mp-quick-view-description {
  margin: 0 0 14px;
  color: var(--mp-muted);
  font-size: .92rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.mp-compact-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 12px 0 16px;
  padding: 12px;
  border-radius: 12px;
  background: #f7f9fc;
}

.mp-compact-meta div { min-width: 0; }
.mp-compact-meta div[hidden] { display: none; }

.mp-compact-meta dt {
  margin-bottom: 2px;
  color: var(--mp-muted);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.mp-compact-meta dd {
  margin: 0;
  font-size: .84rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mp-compact-meta .mp-meta-wide { grid-column: 1 / -1; }

.mp-quick-view-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mp-quick-view-actions .mp-button { flex: 1 1 150px; }

.mp-empty {
  grid-column: 1 / -1;
  border: 1px dashed #aab9cc;
  border-radius: 18px;
  padding: 32px;
  text-align: center;
  background: #fff;
}

.mp-empty h3 {
  margin-top: 0;
  color: var(--mp-navy);
}

.mp-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.mp-pagination span {
  font-weight: 800;
  color: var(--mp-muted);
}

.mp-breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--mp-muted);
  font-size: .9rem;
}

.mp-breadcrumb a {
  color: var(--mp-blue);
  font-weight: 800;
}

.mp-breadcrumb span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-detail {
  display: grid;
  gap: 20px;
}

.mp-detail-cover {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
}

.mp-detail-content { min-width: 0; }

.mp-detail h1 {
  margin: 9px 0;
  color: var(--mp-navy);
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.mp-detail-description {
  margin: 0;
  font-size: .96rem;
  line-height: 1.55;
  color: var(--mp-muted);
}

.mp-download { width: 100%; }

.mp-download-note {
  text-align: center;
  color: var(--mp-muted);
  font-size: .88rem;
}

.mp-page img { display: block; }

.mp-page a:focus-visible,
.mp-page button:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 3px;
}

.mp-commercial-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(16px, 3vw, 20px);
  border: 1px solid var(--mp-line);
  border-radius: 14px;
  background: #f7faff;
}

.mp-commercial-cta h2 {
  margin: 0;
  color: var(--mp-navy);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
}

.mp-commercial-cta p:not(.mp-eyebrow) {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--mp-muted);
  font-size: .9rem;
  line-height: 1.45;
}

.mp-commercial-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.mp-download-feedback {
  margin: 12px 0 0;
  padding: 11px 14px;
  border-radius: 10px;
  background: #e8f7ee;
  color: #155f35;
  font-weight: 750;
}

.mp-download-feedback a { color: #0b5ed7; }
.mp-download-feedback[hidden] { display: none; }

@media (min-width: 620px) {
  .mp-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-field-search,
  .mp-filter-actions { grid-column: 1 / -1; }
  .mp-grid { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); }
  .mp-detail {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: start;
  }
  .mp-download {
    width: auto;
    min-width: 220px;
  }
  .mp-download-note { text-align: left; }
}

@media (min-width: 821px) {
  .mp-filter-toggle { display: none; }
  .mp-filter-panel:not([open]) > .mp-filter-content { display: block; }
}

@media (min-width: 900px) {
  .mp-filters { grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); }
  .mp-field-search,
  .mp-filter-actions { grid-column: auto; }
  .mp-filter-actions {
    align-self: end;
    flex-wrap: nowrap;
  }
  .mp-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 820px) {
  .mp-filter-panel:not([open]) > .mp-filter-content { display: none; }
  .mp-filter-content { border-top: 1px solid var(--mp-line); }
  .mp-filter-heading { display: none; }
  .mp-card-actions .mp-button { min-height: 44px; }
  .mp-quick-view {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: 88dvh;
    margin: 0;
    border-radius: 18px 18px 0 0;
  }
  .mp-quick-view-shell { display: block; }
  .mp-quick-view-cover {
    min-height: 0;
    max-height: 180px;
    aspect-ratio: 16 / 7;
  }
  .mp-quick-view-content { padding: 16px; }
  .mp-quick-view-content h2 {
    margin-top: 8px;
    font-size: 1.35rem;
  }
  .mp-availability-dialog {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: 82dvh;
    margin: 0;
    border-radius: 18px 18px 0 0;
  }
  .mp-availability-shell { padding: 20px 16px; }
}

@media (max-width: 700px) {
  .mp-commercial-cta {
    align-items: flex-start;
    flex-direction: column;
  }
  .mp-commercial-actions { width: 100%; }
  .mp-commercial-actions .mp-button { flex: 1 1 150px; }
}

@media (max-width: 419px) {
  .mp-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .mp-card-body { padding: 9px; }
  .mp-card h3 { font-size: .85rem; }
  .mp-card-actions .mp-button {
    padding-inline: 2px;
    font-size: .7rem;
  }
  .mp-filter-actions .mp-button { width: 100%; }
  .mp-commercial-actions .mp-button { width: 100%; }
  .mp-recurring-note {
    font-size: .82rem;
    line-height: 1.3;
  }
  .mp-unavailable-card .mp-button {
    width: 100%;
    margin-right: 0;
  }
}
