/**
 * ScaleReady Product Catalog — front end
 *
 * Design tokens are taken from the live G-Rex catalog so the combined page
 * matches the existing product pages.
 *
 * The theme and Elementor push base styles onto button/a/label (font-weight,
 * padding, hover background). Rules below therefore declare their states
 * explicitly, with !important where the theme actively competes. Removing those
 * makes the cards render bold and the buttons oversized.
 */

.srpc {
  --srpc-ink: #333;
  --srpc-ink-soft: #666;
  --srpc-ink-mute: #888;
  --srpc-navy: #0f3d5e;
  --srpc-blue: #004876;
  --srpc-blue-dark: #02395f;
  --srpc-accent: #f78426;
  --srpc-accent-soft: #ffeedf;
  --srpc-line: #eef0f3;
  --srpc-line-strong: #e8e8e8;
  --srpc-surface: #fff;
  --srpc-surface-alt: #f3f5f8;
  --srpc-tag-bg: #e8f6ff;
  --srpc-radius-card: 22px;
  --srpc-radius-panel: 14px;
  --srpc-radius-pill: 999px;
  --srpc-shadow-sm: 0 6px 18px rgba(0, 0, 0, .05);
  --srpc-shadow-md: 0 10px 30px rgba(0, 0, 0, .06);
  --srpc-shadow-lg: 0 10px 40px rgba(0, 0, 0, .12);

  /* The theme forces font-weight:700 on the content wrapper. Without this
     reset every card renders bold. */
  font-family: "Proxima Nova", sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: var(--srpc-ink) !important;
  -webkit-font-smoothing: antialiased;
}

.srpc p,
.srpc span,
.srpc li,
.srpc div {
  font-weight: inherit;
}

.srpc *,
.srpc *::before,
.srpc *::after {
  box-sizing: border-box;
}

/* Author display rules win over the user-agent display:none for [hidden],
   so the attribute needs help to actually hide anything. */
.srpc [hidden] {
  display: none !important;
}

.srpc button,
.srpc input,
.srpc label,
.srpc a {
  font-family: inherit;
}

/* ------------------------------------------------------------------ *
 * Step 1 — catalog selector
 * ------------------------------------------------------------------ */

.srpc-chooser {
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--srpc-line);
  margin-bottom: 16px;
}

.srpc-chooser__prompt {
  margin: 0 0 12px !important;
  font-size: .95rem !important;
  font-weight: 600 !important;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--srpc-ink-mute) !important;
}

.srpc-chooser__options {
  display: grid;
  /* minmax(0,1fr) keeps a long tagline from stretching the column. */
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 14px;
}

.srpc .srpc-choice,
.srpc .srpc-choice:focus,
.srpc .srpc-choice:active {
  --srpc-choice-accent: var(--srpc-blue);

  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 18px 20px;
  text-align: left;
  background: var(--srpc-surface);
  border: 2px solid var(--srpc-line);
  border-radius: var(--srpc-radius-panel);
  box-shadow: var(--srpc-shadow-sm);
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .18s;
  white-space: normal;
  min-height: 0;
  height: auto;
  color: var(--srpc-navy);
}

.srpc .srpc-choice:hover,
.srpc .srpc-choice:focus-visible {
  background: var(--srpc-surface);
  border-color: var(--srpc-choice-accent);
  box-shadow: var(--srpc-shadow-md);
  transform: translateY(-2px);
  color: var(--srpc-navy);
}

/* Selected state: a tinted stroke rather than a solid accent one. A full
   strength 2px border around a whole card reads as an alert, not a choice. */
.srpc .srpc-choice.is-active {
  border-color: color-mix(in srgb, var(--srpc-choice-accent) 42%, #fff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--srpc-choice-accent) 9%, transparent);
}

/* Brand mark. Fixed box so both logos line up whatever their aspect ratio.
   Wide enough for the horizontal R&D Systems lockup to read at a glance. */
.srpc-choice__logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 116px;
  height: 50px;
  padding-right: 16px;
  margin-right: 2px;
  border-right: 1px solid var(--srpc-line);
}

/* width/height 100% + object-fit gives the image a box before it downloads,
   so it never collapses to zero while loading. */
.srpc-choice__logo img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.srpc-choice__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
}

/* The theme paints spans inside buttons white, which made this label
   invisible. Colour has to be explicit. */
.srpc-choice__label {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  line-height: 1.2;
  color: var(--srpc-navy) !important;
}

.srpc-choice__tagline {
  font-size: .88rem !important;
  font-weight: 400 !important;
  line-height: 1.35;
  color: var(--srpc-ink-mute) !important;
}

.srpc-choice__count {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 5px 12px;
  border-radius: var(--srpc-radius-pill);
  background: var(--srpc-surface-alt);
  color: var(--srpc-navy) !important;
  font-size: .9rem !important;
  font-weight: 700 !important;
  text-align: center;
}

/* Tint plus dark text instead of white on a saturated fill: the count is a
   number people actually read, and white on the G-Rex orange failed contrast.
   The !important is needed to beat the base rule's own !important colour. */
.srpc .srpc-choice.is-active .srpc-choice__count {
  background: color-mix(in srgb, var(--srpc-choice-accent) 15%, #fff);
  color: var(--srpc-ink) !important;
}

.srpc-choice__check {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--srpc-line);
  color: transparent;
  transition: background .18s, border-color .18s, color .18s;
}

.srpc-choice__check svg {
  width: 13px;
  height: 13px;
}

/* The tick is the one place the accent stays solid, so the selection is
   unmistakable. Slightly deepened so the white glyph holds up on light accents. */
.srpc .srpc-choice.is-active .srpc-choice__check {
  background: color-mix(in srgb, var(--srpc-choice-accent) 92%, #000);
  border-color: color-mix(in srgb, var(--srpc-choice-accent) 92%, #000);
  color: #fff;
}

/* "Show all" reset: deliberately secondary to the two catalog cards. */
.srpc .srpc-showall,
.srpc .srpc-showall:focus,
.srpc .srpc-showall:active {
  display: inline-flex !important;
  align-items: center;
  margin: 12px 0 0 !important;
  padding: 7px 16px !important;
  background: none !important;
  border: 1px solid var(--srpc-line) !important;
  border-radius: var(--srpc-radius-pill) !important;
  color: var(--srpc-ink-mute) !important;
  font-size: .88rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  min-height: 0 !important;
  height: auto !important;
  box-shadow: none !important;
}

.srpc .srpc-showall:hover,
.srpc .srpc-showall:focus-visible {
  background: none !important;
  border-color: var(--srpc-blue) !important;
  color: var(--srpc-blue) !important;
}

.srpc .srpc-showall.is-active {
  background: var(--srpc-surface-alt) !important;
  border-color: transparent !important;
  color: var(--srpc-navy) !important;
}

/* ------------------------------------------------------------------ *
 * Step 2 — filter bar
 * ------------------------------------------------------------------ */

.srpc-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 4px 0 16px;
  border-bottom: 1px solid var(--srpc-line);
  margin-bottom: 14px;
  animation: srpc-slide-in .22s ease;
}

.srpc-filters[hidden] {
  display: none;
}

@keyframes srpc-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.srpc-dropdown {
  position: relative;
}

/* Values copied from the live G-Rex filter button: 16px/600, #0F3D5E,
   60px radius, 10px 18px padding. */
.srpc .srpc-dropdown__btn,
.srpc .srpc-dropdown__btn:focus,
.srpc .srpc-dropdown__btn:active {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 10px 18px !important;
  background: var(--srpc-surface) !important;
  border: 1px solid var(--srpc-line) !important;
  border-radius: 60px !important;
  box-shadow: var(--srpc-shadow-sm);
  color: var(--srpc-navy) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
  min-height: 0 !important;
  height: auto !important;
}

.srpc .srpc-dropdown__btn:hover,
.srpc .srpc-dropdown__btn:focus-visible {
  background: var(--srpc-surface) !important;
  color: var(--srpc-navy) !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
}

.srpc .srpc-dropdown__btn.has-selection,
.srpc .srpc-dropdown__btn.has-selection:hover {
  background: var(--srpc-blue) !important;
  border-color: var(--srpc-blue) !important;
  color: #fff !important;
}

.srpc .srpc-dropdown__btn svg {
  width: 14px;
  height: 14px;
  transition: transform .2s;
}

.srpc .srpc-dropdown__btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* No option left after cascading. */
.srpc .srpc-dropdown__btn.is-disabled {
  background: var(--srpc-surface-alt) !important;
  border-color: #e0e0e0 !important;
  color: #aaa !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  transform: none !important;
  box-shadow: none !important;
  opacity: .4;
}

/* Exactly one option left: shown but not openable, the dimension is already
   decided. Mirrors .grex-readonly on the legacy catalog, padlock included. */
.srpc .srpc-dropdown__btn.is-readonly {
  background: var(--srpc-surface-alt) !important;
  border-color: #d8dde3 !important;
  color: #6b7785 !important;
  cursor: default !important;
  pointer-events: none !important;
  transform: none !important;
  box-shadow: none !important;
  opacity: .75;
}

.srpc .srpc-dropdown__btn.is-readonly svg {
  opacity: .5;
}

.srpc .srpc-dropdown__btn.is-readonly::after {
  content: "🔒";
  margin-left: 4px;
  font-size: .75rem;
  opacity: .6;
}

.srpc-dropdown__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--srpc-radius-pill);
  background: var(--srpc-accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
}

.srpc-dropdown__badge[hidden] {
  display: none;
}

.srpc-dropdown__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 200;
  display: none;
  min-width: 240px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  background: var(--srpc-surface);
  border: 1px solid var(--srpc-line);
  border-radius: var(--srpc-radius-panel);
  box-shadow: var(--srpc-shadow-lg);
}

.srpc-dropdown.is-open .srpc-dropdown__panel {
  display: block;
  animation: srpc-slide-in .15s ease;
}

.srpc-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  border-radius: 8px;
  font-size: .95rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  color: var(--srpc-ink) !important;
  cursor: pointer;
  user-select: none;
  transition: background .1s;
}

.srpc-option:hover {
  background: var(--srpc-surface-alt);
}

.srpc-option.is-hidden {
  display: none;
}

.srpc-option span {
  flex: 1 1 auto;
}

.srpc-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  background: var(--srpc-surface);
  border: 2px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.srpc-option input[type="checkbox"]:checked {
  background: var(--srpc-blue);
  border-color: var(--srpc-blue);
}

.srpc-option input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 5px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ------------------------------------------------------------------ *
 * Chips and toolbar
 * ------------------------------------------------------------------ */

.srpc-chips {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
}

.srpc-chips.has-chips {
  display: flex;
  padding: 0 0 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--srpc-line);
}

.srpc-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 5px 12px !important;
  background: var(--srpc-accent-soft) !important;
  border: 1px solid transparent !important;
  border-radius: var(--srpc-radius-pill) !important;
  color: var(--srpc-accent) !important;
  font-size: .8rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  min-height: 0 !important;
  height: auto !important;
  box-shadow: none !important;
}

.srpc-chip:hover,
.srpc-chip:focus-visible {
  background: #ffe4cc !important;
  border-color: var(--srpc-accent) !important;
  color: var(--srpc-accent) !important;
}

.srpc-chip svg {
  width: 11px;
  height: 11px;
}

.srpc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.srpc-count {
  margin: 0 !important;
  font-size: .95rem !important;
  font-weight: 400 !important;
  color: var(--srpc-ink-mute) !important;
}

.srpc-count strong {
  color: var(--srpc-ink) !important;
  font-weight: 700 !important;
}

.srpc .srpc-clear,
.srpc .srpc-clear:focus,
.srpc .srpc-clear:active {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  margin: 0 !important;
  padding: 8px 16px !important;
  background: none !important;
  border: 1px solid var(--srpc-line) !important;
  border-radius: var(--srpc-radius-pill) !important;
  color: #999 !important;
  font-size: .88rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  min-height: 0 !important;
  height: auto !important;
  box-shadow: none !important;
}

.srpc .srpc-clear:hover,
.srpc .srpc-clear:focus-visible {
  background: none !important;
  border-color: var(--srpc-blue) !important;
  color: var(--srpc-blue) !important;
}

.srpc .srpc-clear[hidden] {
  display: none;
}

.srpc .srpc-clear svg {
  width: 11px;
  height: 11px;
}

/* ------------------------------------------------------------------ *
 * Groups and grid
 * ------------------------------------------------------------------ */

.srpc-group {
  margin-bottom: 38px;
}

.srpc-group[hidden] {
  display: none;
}

.srpc-group__head {
  margin-bottom: 16px;
}

.srpc-group__title {
  margin: 0 !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  color: var(--srpc-navy) !important;
}

.srpc-group__tagline {
  margin: 4px 0 0 !important;
  font-size: .95rem !important;
  font-weight: 400 !important;
  color: var(--srpc-ink-mute) !important;
}

/* With a single catalog selected the group heading is redundant. */
.srpc.is-single-catalog .srpc-group__head {
  display: none;
}

.srpc-group__empty {
  margin: 0;
  padding: 28px 20px;
  background: var(--srpc-surface-alt);
  border-radius: var(--srpc-radius-panel);
  color: var(--srpc-ink-mute);
  text-align: center;
}

.srpc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.srpc-empty {
  padding: 60px 20px;
  text-align: center;
}

.srpc-empty h3 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  color: var(--srpc-ink);
}

.srpc-empty p {
  margin: 0;
  color: var(--srpc-ink-mute);
  font-size: .95rem;
}

/* ------------------------------------------------------------------ *
 * Card
 * ------------------------------------------------------------------ */

.srpc-card {
  --srpc-card-accent: var(--srpc-accent);

  display: flex;
  overflow: hidden;
  min-height: 240px;
  height: 100%;
  background: var(--srpc-surface);
  border: 1px solid var(--srpc-line);
  border-radius: var(--srpc-radius-card);
  box-shadow: var(--srpc-shadow-md);
  transition: box-shadow .25s, transform .25s;
}

.srpc-card:hover {
  box-shadow: 0 14px 40px rgba(0, 0, 0, .1);
  transform: translateY(-2px);
}

.srpc-card.is-hidden {
  display: none;
}

.srpc-card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 240px;
  width: 240px;
  padding: 20px;
  background: var(--srpc-surface);
  border-right: 1px solid var(--srpc-line-strong);
}

/* Orange in every catalog: that is how both legacy pages paint it
   (#FFEEDF on #F78426). The per-catalog accent is used by the selector only. */
.srpc-card__sku {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 6px 16px;
  border-radius: var(--srpc-radius-pill);
  background: var(--srpc-accent-soft);
  color: var(--srpc-accent) !important;
  font-size: .85rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

/* The image is a <button> so the modal opens from the keyboard. The theme adds
   padding:20px 32px to every button, which cropped the photo by 64px compared
   to the legacy markup (a plain div). Hence the !important below. */
.srpc .srpc-card__img,
.srpc .srpc-card__img:focus,
.srpc .srpc-card__img:active {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  min-height: 0 !important;
  height: auto !important;
}

.srpc .srpc-card__img img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  border-radius: 10px;
}

.srpc-card__img--zoom {
  position: relative;
  cursor: zoom-in;
}

.srpc-card__img--empty {
  width: 150px;
  height: 100px;
  border-radius: var(--srpc-radius-panel);
  background: var(--srpc-surface-alt);
}

.srpc-card__zoom {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--srpc-blue);
  color: #fff;
  opacity: .85;
  transition: opacity .15s, transform .15s;
}

.srpc-card__img--zoom:hover .srpc-card__zoom {
  opacity: 1;
  transform: scale(1.08);
}

.srpc-card__zoom svg {
  width: 16px;
  height: 16px;
}

.srpc-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  padding: 22px 24px;
}

/* The theme paints h4 in #505050; the G-Rex catalog uses #333. */
.srpc-card__title {
  margin: 0 0 8px !important;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  color: var(--srpc-ink) !important;
}

/* Grows so every card foot lines up. clamp 10 matches the G-Rex page. */
.srpc-card__desc {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 10;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  color: var(--srpc-ink-soft) !important;
}

.srpc-card__desc p {
  margin: 0 0 .6em;
}

.srpc-card__desc p:last-child {
  margin-bottom: 0;
}

.srpc-card__flag {
  display: inline-flex;
  align-self: flex-start;
  margin: 0 0 8px !important;
  padding: 4px 12px;
  border-radius: var(--srpc-radius-pill);
  background: #e6f6ec;
  color: #1c7a45 !important;
  font-size: .8rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
}

.srpc-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  min-height: 26px;
  align-content: flex-start;
}

.srpc-tag {
  display: block;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--srpc-tag-bg);
  color: var(--srpc-blue) !important;
  font-size: .82rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  letter-spacing: .02em;
}

.srpc-card__foot {
  margin-top: auto;
}

/* Reproduces the gap the G-Rex page leaves between the dotted rule and the
   price. */
.srpc-card__rule {
  display: block;
  margin: 8px 0;
  padding-top: 14px;
  border-top: 1px dotted var(--srpc-blue);
}

.srpc-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 0;
}

/* Live, the price computes to #0F3D5E, not the #004876 the legacy CSS declares. */
.srpc-card__amount {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: var(--srpc-navy) !important;
}

.srpc-card__unit {
  font-size: .9rem !important;
  font-weight: 400 !important;
  color: var(--srpc-ink-mute) !important;
}

.srpc-card__cta {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 46px !important;
  margin-top: 8px;
  padding: 12px 24px !important;
  border-radius: 12px !important;
  background: var(--srpc-blue) !important;
  color: #fff !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  transition: background .2s;
}

.srpc-card__cta:hover,
.srpc-card__cta:focus-visible {
  background: var(--srpc-blue-dark) !important;
  color: #fff !important;
  text-decoration: none !important;
}

.srpc-card__cta--off {
  background: #ccc;
  color: #888;
  pointer-events: none;
}

/* ------------------------------------------------------------------ *
 * Image modal
 * ------------------------------------------------------------------ */

.srpc-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.srpc-modal.is-open {
  display: flex;
}

.srpc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 61, 94, .8);
  backdrop-filter: blur(2px);
}

.srpc-modal__panel {
  position: relative;
  max-width: min(900px, 92vw);
  max-height: 88vh;
  padding: 20px;
  background: #fff;
  border-radius: var(--srpc-radius-card);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  text-align: center;
  overflow: auto;
}

.srpc-modal__panel img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  margin: 0 auto;
  border-radius: 10px;
}

.srpc-modal__caption {
  margin: 14px 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--srpc-navy);
}

.srpc .srpc-modal__close,
.srpc .srpc-modal__close:focus,
.srpc .srpc-modal__close:active {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: var(--srpc-surface-alt);
  border: 0;
  border-radius: 50%;
  color: var(--srpc-navy);
  cursor: pointer;
  transition: background .15s;
  min-height: 0;
}

.srpc .srpc-modal__close:hover,
.srpc .srpc-modal__close:focus-visible {
  background: #e2e6ec;
  color: var(--srpc-navy);
}

.srpc .srpc-modal__close svg {
  width: 15px;
  height: 15px;
}

/*
 * Los estados los declaramos nosotros, no el tema.
 *
 * Hello Elementor repinta todo <button> en :hover y en :focus — fondo #c36 y
 * texto blanco. El :hover ya lo cubriamos; el :focus no, y como un clic con el
 * raton deja el foco puesto sin activar :focus-visible, la tarjeta se quedaba
 * pintada del color del tema despues de elegir un catalogo.
 *
 * Cada boton lleva ahora su aspecto base tambien en :focus y :active. Las
 * reglas de :hover y :focus-visible van despues en la hoja, asi que siguen
 * mandando cuando les toca.
 */

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */

/*
 * El catalogo se mide por el hueco que le da el tema, no por la ventana.
 *
 * Un tema de bloques —los que trae WordPress— sirve el contenido dentro de una
 * columna estrecha: 620px en una pantalla de 1440. Con consultas de ventana la
 * tarjeta se creia ancha, mantenia sus 240px de imagen y dejaba la ficha en una
 * tira de cuarenta pixeles. Preguntando por el ancho del contenedor la tarjeta
 * se apila cuando de verdad no cabe, sea cual sea el tema.
 *
 * El contenedor va en «results» y en «chooser», nunca en «.srpc»: hacer
 * contenedor al raiz lo convertiria en bloque contenedor de sus descendientes
 * fijos, y la ampliacion de imagen —que es position: fixed y vive dentro—
 * dejaria de cubrir la pantalla.
 */
.srpc-results { container-type: inline-size; container-name: srpcres; }
.srpc-chooser { container-type: inline-size; container-name: srpcchoose; }

@container srpcres (max-width: 1024px) {
  .srpc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container srpcres (max-width: 560px) {
  .srpc-card {
    flex-direction: column;
  }

  .srpc-card__media {
    flex: 0 0 auto;
    width: auto;
    padding: 48px 16px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--srpc-line-strong);
  }

  .srpc .srpc-card__img {
    max-width: 60%;
    margin: 0 auto;
  }

  .srpc-card__body {
    padding: 18px 16px;
  }

  .srpc-card__title {
    font-size: 1.15rem;
  }

  .srpc-card__desc {
    font-size: .9rem;
  }
}

@container srpcchoose (max-width: 640px) {
  .srpc-chooser__options {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Las consultas de ventana siguen ahi para los navegadores sin soporte de
   contenedor, y para el movil, donde ventana y hueco miden casi lo mismo. */

@media (max-width: 1024px) {
  .srpc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .srpc-chooser__options {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .srpc .srpc-dropdown__btn {
    width: 100%;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: .88rem;
  }

  .srpc-dropdown__panel {
    left: 0;
    right: 0;
    min-width: 0;
  }

  .srpc-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .srpc-card {
    flex-direction: column;
  }

  .srpc-card__media {
    flex: 0 0 auto;
    width: auto;
    padding: 48px 16px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--srpc-line-strong);
  }

  .srpc .srpc-card__img {
    max-width: 60%;
    margin: 0 auto;
  }

  .srpc-card__body {
    padding: 18px 16px;
  }

  .srpc-card__title {
    font-size: 1.15rem;
  }

  .srpc-card__desc {
    font-size: .9rem;
  }
}
