/* ==========================================================================
   JRP Business Suite — front end
   Uses the theme's design tokens (--c-*, --s-*, --r-*) so product pages and the
   quote form are visually native. Every token has a fallback, so the plugin
   still renders sanely if it is ever used with a different theme.
   Author: Ashin Iqbal from PBIS LLC
   ========================================================================== */

/* --------------------------------------------------------------------------
   PRODUCT PAGE HEAD
   -------------------------------------------------------------------------- */
.jrp-p-head { display: grid; gap: var(--s-7, 2rem); margin-top: var(--s-5, 1.25rem); }
@media (min-width: 900px) {
  .jrp-p-head { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: var(--s-9, 3rem); align-items: start; }
}
.jrp-p-head > * { min-width: 0; }
.jrp-p-head__text .badge { margin-bottom: var(--s-4, 1rem); }
.jrp-p-head__text h1 { margin-bottom: var(--s-4, 1rem); }

/* Headline figures */
.jrp-p-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: var(--s-7, 2rem) 0 0;
  border-top: 1px solid var(--c-line-2, #d3d9e2);
}
@media (min-width: 620px) { .jrp-p-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.jrp-p-stats > div { padding: var(--s-5, 1.25rem) var(--s-4, 1rem) var(--s-4, 1rem) 0; border-bottom: 1px solid var(--c-line, #e3e7ed); }
@media (min-width: 620px) {
  .jrp-p-stats > div { border-bottom: 0; border-right: 1px solid var(--c-line, #e3e7ed); padding-left: var(--s-5, 1.25rem); }
  .jrp-p-stats > div:first-child { padding-left: 0; }
  .jrp-p-stats > div:last-child { border-right: 0; }
}
@media (max-width: 619px) {
  .jrp-p-stats > div:nth-child(odd) { border-right: 1px solid var(--c-line, #e3e7ed); padding-right: var(--s-4, 1rem); }
  .jrp-p-stats > div:nth-child(even) { padding-left: var(--s-5, 1.25rem); }
}
.jrp-p-stats dt {
  font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--c-faint, #98a2b3);
}
.jrp-p-stats dd {
  margin: .35rem 0 0;
  font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem);
  font-weight: 900; letter-spacing: -.025em; line-height: 1.15;
  color: var(--c-ink, #0f1319);
  font-variant-numeric: tabular-nums;
}

/* Media */
.jrp-p-media { margin: 0; }
.jrp-p-media img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--c-line, #e3e7ed);
  border-radius: var(--r-lg, 12px);
  background: var(--c-surface, #f7f8fa);
}
.jrp-p-media__ph {
  display: grid; place-content: center; justify-items: center; gap: .7rem;
  aspect-ratio: 4 / 3;
  padding: var(--s-6, 1.5rem);
  text-align: center;
  color: var(--c-faint, #98a2b3);
  background:
    repeating-linear-gradient(45deg, transparent 0 9px, rgba(17,87,199,.03) 9px 18px),
    #fff;
  border: 1px dashed var(--c-line-2, #d3d9e2);
  border-radius: var(--r-lg, 12px);
}
.jrp-p-media__ph span { font-size: .8125rem; font-weight: 700; }

/* --------------------------------------------------------------------------
   PRODUCT CARDS
   -------------------------------------------------------------------------- */
.jrp-pcard__media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--c-surface-2, #eef1f5);
  border-bottom: 1px solid var(--c-line, #e3e7ed);
}
.jrp-pcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .48s cubic-bezier(.22,.61,.36,1); }
.card--link:hover .jrp-pcard__media img { transform: scale(1.035); }
.jrp-pcard__ph { display: grid; place-items: center; height: 100%; color: var(--c-line-strong, #b9c2cf); }
.jrp-pcard__model {
  font-family: var(--f-mono, ui-monospace, monospace);
  font-size: .75rem; font-weight: 700; letter-spacing: .06em;
  color: var(--c-pri, #1157c7);
}
.jrp-pcard .card__text { flex: 1; }
.jrp-pcard__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4, 1rem);
  flex-wrap: wrap;
  border-top: 1px solid var(--c-line, #e3e7ed);
  margin-top: var(--s-2, .5rem);
  padding-top: var(--s-4, 1rem);
}

/* Category filter */
.jrp-pfilter { display: flex; flex-wrap: wrap; gap: .4rem; }
.jrp-pfilter__item {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem .9rem;
  border: 1px solid var(--c-line-2, #d3d9e2);
  border-radius: var(--r-sm, 5px);
  background: #fff;
  font-size: .8125rem; font-weight: 800; letter-spacing: .01em;
  color: var(--c-muted, #6b7785);
  text-decoration: none;
  transition: border-color .16s, color .16s, background-color .16s;
}
.jrp-pfilter__item:hover { border-color: var(--c-line-strong, #b9c2cf); color: var(--c-ink, #0f1319); }
.jrp-pfilter__item.is-active { background: var(--c-ink, #0f1319); border-color: var(--c-ink, #0f1319); color: #fff; }
.jrp-pfilter__n {
  font-family: var(--f-mono, monospace); font-size: .6875rem; opacity: .65;
}

/* --------------------------------------------------------------------------
   QUOTE FORM
   -------------------------------------------------------------------------- */
.jrp-qf {
  max-width: 58rem;
  padding: clamp(1.5rem, 1rem + 2.2vw, 2.5rem);
  background: #fff;
  border: 1px solid var(--c-line, #e3e7ed);
  border-radius: var(--r-lg, 12px);
  scroll-margin-top: calc(var(--header-h, 88px) + 1.5rem);
}
.jrp-qf__title { font-size: var(--t-h3, 1.5rem); font-weight: 800; color: var(--c-ink, #0f1319); letter-spacing: -.018em; }
.jrp-qf__intro { margin-top: .6rem; font-size: .9375rem; line-height: 1.65; color: var(--c-muted, #6b7785); max-width: 58ch; }
.jrp-qf__form { margin-top: var(--s-6, 1.5rem); }

/* The honeypot must be invisible to people but present to a bot, so it is moved
   off-screen rather than display:none — some bots skip hidden inputs. */
.jrp-qf__hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

.jrp-qf__grid { display: grid; gap: var(--s-5, 1.25rem); }
@media (min-width: 640px) { .jrp-qf__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5, 1.25rem) var(--s-6, 1.5rem); } }
.jrp-qf .field { display: grid; gap: .4rem; min-width: 0; }
.jrp-qf .field--full { grid-column: 1 / -1; }
.jrp-qf label { font-size: .875rem; font-weight: 700; color: var(--c-ink-2, #1e252f); }
.jrp-qf .req { color: var(--c-red, #c0342b); margin-left: .1em; }
.jrp-qf .hint { font-size: .78rem; color: var(--c-faint, #98a2b3); margin: 0; }
.jrp-qf .hint a { color: var(--c-pri, #1157c7); }
.jrp-qf input[readonly].is-locked { background: var(--c-surface, #f7f8fa); color: var(--c-muted, #6b7785); cursor: default; }

/* Consent */
.jrp-qf__consent { display: flex; gap: .65rem; align-items: flex-start; font-weight: 500 !important; }
.jrp-qf__consent input { margin-top: .25rem; flex: none; width: 17px; height: 17px; accent-color: var(--c-pri, #1157c7); }
.jrp-qf__consent span { font-size: .8125rem; line-height: 1.6; color: var(--c-muted, #6b7785); }

.jrp-qf__actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4, 1rem) var(--s-6, 1.5rem);
  margin-top: var(--s-7, 2rem);
  padding-top: var(--s-6, 1.5rem);
  border-top: 1px solid var(--c-line, #e3e7ed);
}
.jrp-qf__reassure { font-size: .78rem; line-height: 1.55; color: var(--c-faint, #98a2b3); max-width: 40ch; margin: 0; }

/* Notices */
.jrp-qf__notice {
  display: grid; gap: .4rem;
  padding: var(--s-5, 1.25rem) var(--s-6, 1.5rem);
  margin-bottom: var(--s-6, 1.5rem);
  border-radius: var(--r, 8px);
  border: 1px solid;
}
.jrp-qf__notice:focus { outline: none; }
.jrp-qf__notice strong { font-size: 1rem; font-weight: 800; }
.jrp-qf__notice p, .jrp-qf__notice li { font-size: .875rem; line-height: 1.6; }
.jrp-qf__notice ul { margin: 0; padding-left: 1.15rem; }
.jrp-qf__notice--ok {
  background: var(--c-grn-50, #eefaf2);
  border-color: var(--c-grn-100, #dcf3e5);
  color: var(--c-grn-800, #0b6b2f);
}
.jrp-qf__notice--ok p { color: var(--c-body, #454f5d); }
.jrp-qf__notice--err {
  background: var(--c-red-50, #fdefee);
  border-color: #f7dcda;
  color: var(--c-red, #c0342b);
}
.jrp-qf__notice--err li { color: var(--c-body, #454f5d); }
.jrp-qf__ref { font-family: var(--f-mono, monospace); font-size: .8125rem; color: var(--c-body, #454f5d); }

/* Inline validation. Only shown once a field has been interacted with, so the
   form never greets someone with a wall of red. */
.jrp-qf .field.has-error input,
.jrp-qf .field.has-error select,
.jrp-qf .field.has-error textarea {
  border-color: var(--c-red, #c0342b);
  box-shadow: 0 0 0 3px rgba(192, 52, 43, .12);
}
.jrp-qf .field__err {
  font-size: .78rem;
  font-weight: 600;
  color: var(--c-red, #c0342b);
}

@media (prefers-reduced-motion: reduce) {
  .jrp-pcard__media img { transition: none !important; }
}
