/* QM Product Sales Hub - front office.
   Color/typography tokens follow the QualityMotors theme (custom.css):
   --qm-gold #d4af37, --qm-gold-dark #b8860b, Manrope, and the configurator
   card's border/background/shadow family, so the hub reads as a native
   sibling of the "Stel uw uitvoering samen" card. */
.qmpsh-sales-hub {
  --qmpsh-gold: #d4af37;
  --qmpsh-gold-light: #e1c362;
  --qmpsh-gold-dark: #b8860b;
  --qmpsh-dark: #151515;
  --qmpsh-cream: #f8f1e2;
  --qmpsh-border: rgba(188, 145, 38, .34);
  --qmpsh-muted: #5f584a;
  --qmpsh-shadow: 0 18px 44px rgba(32, 24, 8, .10), 0 2px 8px rgba(32, 24, 8, .035);
  position: relative;
  /* Real z-index (not auto): when a fixed-height theme panel lets the hub
     visually spill out, transparent later siblings would otherwise sit on
     top in hit-testing and swallow every click on the buttons. */
  z-index: 20;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 1.15rem 0 1.4rem;
  color: var(--qmpsh-dark);
  font-family: inherit;
  clear: both;
  pointer-events: auto;
}

.qmpsh-sales-hub *,
.qmpsh-sales-hub *::before,
.qmpsh-sales-hub *::after,
.qmpsh-modal *,
.qmpsh-modal *::before,
.qmpsh-modal *::after {
  box-sizing: border-box;
}

.qmpsh-card {
  position: relative;
  overflow: hidden;
  padding: 26px 30px 24px;
  border: 1px solid var(--qmpsh-border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(211, 171, 64, .12), transparent 33%),
    linear-gradient(145deg, #fff 0%, #fffdf8 70%, var(--qmpsh-cream) 100%);
  box-shadow: var(--qmpsh-shadow);
}

.qmpsh-card__header {
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(188, 145, 38, .24);
}

.qmpsh-card__eyebrow,
.qmpsh-modal__eyebrow {
  margin: 0 0 6px;
  color: var(--qmpsh-gold-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.3;
}

.qmpsh-card__title {
  margin: 0 0 6px;
  color: #17130b;
  font-size: clamp(20px, 1.7vw, 27px);
  font-weight: 550;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.qmpsh-card__intro {
  margin: 0;
  color: var(--qmpsh-muted);
  font-size: 14px;
  line-height: 1.55;
}

.qmpsh-actions {
  display: grid;
  gap: .65rem;
}

.qmpsh-actions--primary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.qmpsh-actions--secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px solid rgba(21, 21, 21, .08);
}

.qmpsh-btn,
.qmpsh-link-btn,
.qmpsh-mobile-bar button {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.qmpsh-btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .025em;
  line-height: 1.2;
  text-decoration: none !important;
  text-transform: none;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, background-color .18s ease, border-color .18s ease;
}

.qmpsh-btn svg,
.qmpsh-link-btn svg,
.qmpsh-mobile-bar svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: currentColor;
}

.qmpsh-btn:hover,
.qmpsh-btn:focus-visible,
.qmpsh-link-btn:hover,
.qmpsh-link-btn:focus-visible {
  transform: translateY(-1px);
}

.qmpsh-btn:focus-visible,
.qmpsh-link-btn:focus-visible,
.qmpsh-mobile-bar button:focus-visible,
.qmpsh-modal__close:focus-visible {
  outline: 3px solid rgba(199, 154, 36, .35);
  outline-offset: 2px;
}

.qmpsh-btn--gold {
  color: #17130b !important;
  background: linear-gradient(135deg, var(--qmpsh-gold-light) 0%, var(--qmpsh-gold) 55%, var(--qmpsh-gold-dark) 115%);
  border-color: rgba(143, 102, 13, .35);
  box-shadow:
    0 8px 18px rgba(156, 113, 17, .18),
    inset 0 1px 0 rgba(255, 255, 255, .42);
}

.qmpsh-btn--gold:hover,
.qmpsh-btn--gold:focus-visible {
  color: #0e0c08 !important;
  filter: brightness(1.035);
  box-shadow:
    0 11px 24px rgba(156, 113, 17, .24),
    inset 0 1px 0 rgba(255, 255, 255, .5);
}

.qmpsh-btn--dark {
  color: #f4ecd8 !important;
  background: linear-gradient(180deg, #1b1b1b 0%, #080808 100%);
  border-color: rgba(188, 145, 38, .38);
  box-shadow:
    0 8px 18px rgba(15, 15, 15, .22),
    inset 0 1px 0 rgba(255, 255, 255, .07);
}

.qmpsh-btn--dark:hover,
.qmpsh-btn--dark:focus-visible {
  color: #ffe9ad !important;
  border-color: var(--qmpsh-gold);
  background: linear-gradient(180deg, #111 0%, #000 100%);
}

.qmpsh-btn--light {
  color: #17130b !important;
  background: rgba(255, 255, 255, .92);
  border-color: rgba(188, 145, 38, .30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 4px 12px rgba(32, 24, 8, .06);
}

.qmpsh-btn--light:hover,
.qmpsh-btn--light:focus-visible {
  color: #0e0c08 !important;
  border-color: var(--qmpsh-gold);
  background: #fffdf6;
}

.qmpsh-btn--whatsapp svg {
  color: #1f9c59;
}

.qmpsh-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 12px;
  color: #2c2515;
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(188, 145, 38, .26);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
  line-height: 1.25;
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.qmpsh-link-btn:hover,
.qmpsh-link-btn:focus-visible {
  color: #0e0c08;
  border-color: var(--qmpsh-gold);
  background: #fffdf6;
}

.qmpsh-link-btn svg {
  width: 16px;
  height: 16px;
  color: var(--qmpsh-gold-dark);
}

/* Instalment / rental information line - deliberately NOT a button: the
   "Betalen in termijnen" and "Huren" actions already own the click, so this
   is quiet supporting information that states the period explicitly. */
.qmpsh-notes {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: rgba(255, 253, 246, .75);
  border: 1px solid rgba(188, 145, 38, .22);
  border-left: 3px solid var(--qmpsh-gold);
  border-radius: 9px;
}

.qmpsh-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  color: #4a4234;
  font-size: 12.5px;
  line-height: 1.5;
}

.qmpsh-note + .qmpsh-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(188, 145, 38, .22);
}

.qmpsh-note__label {
  color: var(--qmpsh-gold-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.qmpsh-note__values {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
}

.qmpsh-note__value {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
}

.qmpsh-note__provider {
  color: #2c2515;
  font-weight: 700;
}

.qmpsh-note__value strong {
  color: #17130b;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.qmpsh-note__terms {
  color: #6b6350;
  font-size: 11.5px;
}

.qmpsh-note__sep {
  color: #8d846d;
  font-size: 11.5px;
  font-style: italic;
}

.qmpsh-usps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid rgba(188, 145, 38, .20);
  list-style: none;
}

.qmpsh-usps li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #4a4234;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .015em;
  line-height: 1.3;
}

.qmpsh-usps svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: var(--qmpsh-gold-dark);
}

/* Modal */
body.qmpsh-modal-open {
  overflow: hidden;
}

.qmpsh-modal[hidden],
.qmpsh-sales-hub [hidden] {
  display: none !important;
}

.qmpsh-modal {
  --qmpsh-gold: #d4af37;
  --qmpsh-gold-light: #e1c362;
  --qmpsh-gold-dark: #b8860b;
  --qmpsh-dark: #151515;
  --qmpsh-muted: #5f584a;
  position: fixed;
  z-index: 10050;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.qmpsh-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, .72);
  backdrop-filter: blur(4px);
}

.qmpsh-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 1px solid rgba(188, 145, 38, .45);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .32);
  overscroll-behavior: contain;
}

.qmpsh-modal__dialog::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--qmpsh-gold-dark), var(--qmpsh-gold-light), var(--qmpsh-gold-dark));
}

.qmpsh-modal__content {
  padding: 1.35rem;
}

.qmpsh-modal__close {
  position: absolute;
  z-index: 2;
  top: .65rem;
  right: .7rem;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  color: #333;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(21, 21, 21, .12);
  border-radius: 50%;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.qmpsh-modal__content h3 {
  margin: 0 2.5rem .2rem 0;
  color: var(--qmpsh-dark);
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1.2;
}

.qmpsh-modal__product {
  margin: 0 0 1rem;
  color: var(--qmpsh-muted);
  font-size: .9rem;
}

.qmpsh-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}

.qmpsh-field {
  display: block;
  margin: 0 0 .8rem;
}

.qmpsh-field--full {
  grid-column: 1 / -1;
}

.qmpsh-field > span {
  display: block;
  margin: 0 0 .28rem;
  color: #303030;
  font-size: .79rem;
  font-weight: 750;
  line-height: 1.3;
}

.qmpsh-field input,
.qmpsh-field select,
.qmpsh-field textarea {
  display: block;
  width: 100%;
  min-height: 43px;
  padding: .65rem .72rem;
  color: #171717;
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 9px;
  font: inherit;
  font-size: .9rem;
  line-height: 1.3;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.qmpsh-field textarea {
  min-height: 104px;
  resize: vertical;
}

.qmpsh-field input:focus,
.qmpsh-field select:focus,
.qmpsh-field textarea:focus {
  outline: none;
  border-color: var(--qmpsh-gold);
  box-shadow: 0 0 0 3px rgba(199, 154, 36, .14);
}

.qmpsh-field input[aria-invalid="true"],
.qmpsh-field select[aria-invalid="true"],
.qmpsh-field textarea[aria-invalid="true"] {
  border-color: #b32727;
}

.qmpsh-form-hint {
  margin: -.45rem 0 .75rem;
  color: #777;
  font-size: .73rem;
}

.qmpsh-check-row {
  display: grid;
  gap: .55rem;
  margin: .1rem 0 .95rem;
  padding: .72rem;
  background: #faf7ef;
  border: 1px solid rgba(199, 154, 36, .20);
  border-radius: 9px;
}

.qmpsh-check-row label,
.qmpsh-consent {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: 0;
  color: #424242;
  font-size: .78rem;
  line-height: 1.42;
  cursor: pointer;
}

.qmpsh-check-row input,
.qmpsh-consent input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: .06rem 0 0;
  accent-color: var(--qmpsh-gold);
}

.qmpsh-consent {
  margin: .1rem 0 1rem;
}

.qmpsh-consent a {
  color: #72530c;
  text-decoration: underline;
}

.qmpsh-form-alert {
  margin: 0 0 .8rem;
  padding: .7rem .8rem;
  color: #852424;
  background: #fff0f0;
  border: 1px solid #efb7b7;
  border-radius: 8px;
  font-size: .82rem;
  line-height: 1.45;
}

.qmpsh-submit {
  width: 100%;
}

.qmpsh-submit[disabled] {
  cursor: wait;
  opacity: .72;
}

.qmpsh-phone-fallback {
  margin: .75rem 0 0;
  color: #6b6b6b;
  font-size: .76rem;
  line-height: 1.4;
  text-align: center;
}

.qmpsh-phone-fallback a {
  color: #6f500b;
  font-weight: 800;
  text-decoration: underline;
}

.qmpsh-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(0, 0, 0, .25);
  border-top-color: #111;
  border-radius: 50%;
  animation: qmpsh-spin .75s linear infinite;
}

@keyframes qmpsh-spin {
  to { transform: rotate(360deg); }
}

.qmpsh-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.qmpsh-success {
  padding: 1.2rem .4rem .5rem;
  text-align: center;
}

.qmpsh-success__icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin: 0 auto .75rem;
  color: #111;
  background: linear-gradient(135deg, var(--qmpsh-gold-light), var(--qmpsh-gold));
  border-radius: 50%;
  font-size: 1.8rem;
  font-weight: 900;
}

.qmpsh-success h3 {
  margin: 0 auto 1rem;
  max-width: 520px;
  font-size: 1.15rem;
  line-height: 1.45;
}

.qmpsh-modal__dialog--video {
  width: min(920px, 100%);
  overflow: hidden;
  background: #080808;
}

.qmpsh-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.qmpsh-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Mobile sticky bar */
.qmpsh-mobile-bar {
  display: none;
}

@media (max-width: 991px) {
  .qmpsh-actions--primary,
  .qmpsh-actions--secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qmpsh-actions--primary > :last-child:nth-child(odd),
  .qmpsh-actions--secondary > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .qmpsh-sales-hub {
    margin: .95rem 0 1.1rem;
  }

  .qmpsh-card {
    padding: 1rem;
    border-radius: 14px;
  }

  .qmpsh-actions--primary {
    grid-template-columns: 1fr;
  }

  .qmpsh-actions--primary > :last-child:nth-child(odd) {
    grid-column: auto;
  }

  .qmpsh-actions--secondary {
    grid-template-columns: 1fr;
    gap: .18rem;
  }

  .qmpsh-actions--secondary > :last-child:nth-child(odd) {
    grid-column: auto;
  }

  .qmpsh-link-btn {
    justify-content: flex-start;
    padding: .55rem .35rem;
  }

  .qmpsh-usps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qmpsh-form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .qmpsh-modal {
    align-items: end;
    padding: 0;
  }

  .qmpsh-modal__dialog {
    width: 100%;
    max-height: 94vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }

  .qmpsh-modal__content {
    padding: 1.15rem 1rem calc(1.15rem + env(safe-area-inset-bottom));
  }

  .qmpsh-modal__dialog--video {
    margin: auto 0;
    border-radius: 12px;
  }

  .qmpsh-mobile-bar {
    position: fixed;
    z-index: 9998;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 1px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(13, 13, 13, .96);
    box-shadow: 0 -8px 22px rgba(0, 0, 0, .22);
    backdrop-filter: blur(8px);
  }

  .qmpsh-mobile-bar button {
    display: flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: .28rem;
    padding: .45rem .35rem;
    color: #fff;
    background: transparent;
    border-radius: 7px;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
  }

  .qmpsh-mobile-bar button:hover,
  .qmpsh-mobile-bar button:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .08);
  }

  .qmpsh-mobile-bar button svg {
    width: 17px;
    height: 17px;
  }

  .qmpsh-mobile-bar .qmpsh-mobile-bar__buy {
    color: #17130b;
    background: linear-gradient(135deg, #e1c362, #d4af37 55%, #b8860b 130%);
  }

  body.qmpsh-has-mobile-bar:not(.qmpsh-modal-open) {
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  .qmpsh-usps {
    grid-template-columns: 1fr;
  }

  .qmpsh-mobile-bar button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qmpsh-btn,
  .qmpsh-link-btn,
  .qmpsh-spinner {
    transition: none;
    animation-duration: .001ms;
  }
}


/* Compact in-column presentation on stacked (mobile/tablet) layouts, where
   the hub sits directly under the short description inside the flow. */
@media (max-width: 991.98px) {
  .qmpsh-sales-hub--summary {
    margin: .9rem 0 0;
  }

  .qmpsh-sales-hub--summary .qmpsh-card {
    padding: 18px;
    border-radius: 14px;
    box-shadow: 0 9px 24px rgba(32, 24, 8, .08);
  }

  .qmpsh-sales-hub--summary .qmpsh-card__title {
    font-size: 19px;
  }

  .qmpsh-sales-hub--summary .qmpsh-card__intro {
    font-size: 13px;
    line-height: 1.45;
  }
}

/* ==========================================================
   QualityMotors theme integration (desktop).

   The theme's white product panel is a ::before pinned to the
   image column (height follows the photo), and the full-width
   "Stel uw uitvoering samen" configurator clears that panel
   with margin-top: clamp(176px, 26vw - 28px, 304px) plus a
   200%-wide negative-margin pull. Give the hub the exact same
   treatment so it becomes its own luxe full-width card BETWEEN
   the product panel and the configurator - deterministic on
   every viewport, without overflowing the fixed-height panel -
   and pull the configurator up to sit neatly below the hub.
   ========================================================== */
@media (min-width: 992px) {
  body.page-product .product-information > .qmpsh-sales-hub--summary {
    width: calc(200% + 30px);
    max-width: none;
    /* Base offset only. front.js measures the image column (the theme's
       white panel ::before follows its height) and raises this margin via
       an inline style so the hub always clears the panel - the theme's own
       fixed clamp() is tuned for one photo ratio and overlaps the carousel
       on products with different image heights (e.g. helmets). */
    margin: 30px 0 0 calc(-100% - 30px);
  }

  body.page-product .product-information > .qmpsh-sales-hub ~ .product-actions {
    margin-top: 30px !important;
  }

  body.page-product .product-information > .qmpsh-sales-hub--summary .qmpsh-actions--primary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  body.page-product .product-information > .qmpsh-sales-hub--summary .qmpsh-actions--secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

/* Standalone presentation: JS fallback for layouts where the hub visually
   overflows a height-constrained ancestor panel; it is then moved directly
   below that panel as its own centered card. */
.qmpsh-sales-hub--standalone {
  max-width: min(1060px, calc(100% - 2rem));
  margin: 1.15rem auto;
}

@media (min-width: 992px) {
  .qmpsh-sales-hub--standalone .qmpsh-actions--primary,
  .qmpsh-sales-hub--standalone .qmpsh-actions--secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .qmpsh-sales-hub--standalone {
    max-width: calc(100% - 1.4rem);
    margin: .95rem auto;
  }
}
