/* VIN fitment / question modal — product page. Paired with
   _fitment_inquiry_modal.html and wolf-fitment-inquiry.js. */

.wolf-fitment-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
  margin: 1.2rem 0 0;
  padding: 1.4rem 1.6rem;
  font-size: 1.55rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--wolf-surface, #fff);
  color: var(--wolf-blue, #1b3a6b);
  border: 2px solid var(--wolf-border, #c9d3e0);
  border-radius: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.wolf-fitment-trigger__icon {
  flex: none;
  color: var(--wolf-gold-hover, #d97e0a);
}
.wolf-fitment-trigger:hover {
  border-color: var(--wolf-gold, #c8a04a);
  background: var(--wolf-gold-light, #fef7ed);
}
.wolf-fitment-trigger:focus-visible {
  outline: 3px solid var(--wolf-gold, #c8a04a);
  outline-offset: 2px;
}

/* Native <dialog>, opened with showModal(). The element IS the scrollable
   panel; the browser renders it in the top layer (no z-index needed) and
   paints ::backdrop behind it. Mobile = bottom sheet (margin pins it to the
   bottom edge); >=600px = centered card. */
.wolf-fitment-modal {
  box-sizing: border-box; /* width:100% must include the padding (no global reset) */
  margin: auto auto 0; /* bottom sheet: centered horizontally, pinned bottom */
  width: 100%;
  max-width: 52rem;
  max-height: 92vh;  /* fallback for browsers without dvh */
  max-height: 92dvh; /* tracks the *visible* viewport as the URL bar moves */
  overflow-y: auto;
  overscroll-behavior: contain; /* no scroll-chaining to the page behind */
  -webkit-overflow-scrolling: touch;
  padding: 2.4rem 2rem calc(2rem + env(safe-area-inset-bottom)); /* clear the home indicator */
  border: none;
  border-radius: 12px 12px 0 0;
  background: #fff;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.25);
}
.wolf-fitment-modal::backdrop {
  background: rgba(10, 20, 40, 0.55);
}
@media (min-width: 600px) {
  .wolf-fitment-modal {
    margin: auto;
    padding-bottom: 2rem;
    border-radius: 12px;
  }
}

/* Body scroll lock. position:fixed is what actually holds on iOS (overflow
   alone doesn't). JS toggles this class and publishes the dynamic scroll offset
   and scrollbar-width compensation as custom properties, so no inline style
   rules are written (CSP: style-src-attr 'none'). */
body.wolf-fitment-modal-open {
  overflow: hidden;
  position: fixed;
  top: var(--wolf-fitment-scroll-top, 0);
  left: 0;
  right: 0;
  width: 100%;
  padding-right: var(--wolf-fitment-scrollbar-width, 0);
}

.wolf-fitment-modal__close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  width: 4rem;
  height: 4rem;
  font-size: 2.8rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--wolf-text-muted, #6b7785);
  cursor: pointer;
}
.wolf-fitment-modal__close:focus-visible {
  outline: 3px solid var(--wolf-gold, #c8a04a);
  outline-offset: 2px;
}

.wolf-fitment-modal__title { font-size: 2.2rem; margin: 0 3rem 0.6rem 0; }
.wolf-fitment-modal__context {
  font-size: 1.5rem;
  color: var(--wolf-text-muted, #6b7785);
  margin: 0 0 1.6rem;
}

.wolf-fitment-form__label {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 1.2rem 0 0.4rem;
}
.wolf-fitment-form__optional { font-weight: 400; color: var(--wolf-text-muted, #6b7785); }

.wolf-fitment-form__input {
  width: 100%;
  font-size: 1.6rem; /* >=16px: prevents iOS focus zoom */
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--wolf-border, #c9d3e0);
  border-radius: 6px;
  background: #fff;
}
.wolf-fitment-form__input:focus-visible {
  outline: 3px solid var(--wolf-gold, #c8a04a);
  outline-offset: 2px;
  border-color: var(--wolf-gold, #c8a04a);
}
.wolf-fitment-form__textarea { resize: vertical; min-height: 9rem; }

.wolf-fitment-form__row { display: flex; gap: 1.2rem; }
.wolf-fitment-form__col { flex: 1 1 0; min-width: 0; }

/* Honeypot — kept in the DOM and focusable-by-bots, hidden from humans
   and screen readers. Do NOT use display:none (some bots skip those). */
.wolf-fitment-form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.wolf-fitment-form__turnstile { margin: 1.6rem 0 0; min-height: 6.5rem; }

.wolf-fitment-form__submit {
  width: 100%;
  margin-top: 1.6rem;
  padding: 1.4rem;
  font-size: 1.7rem;
  font-weight: 700;
  cursor: pointer;
}
.wolf-fitment-form__submit:disabled { opacity: 0.55; cursor: not-allowed; }

.wolf-fitment-form__status { margin-top: 1.2rem; font-size: 1.5rem; }
.wolf-fitment-form__status--error { color: var(--wolf-status-error, #b00020); }

.wolf-fitment-modal__success { text-align: center; padding: 2rem 0; }
.wolf-fitment-modal__success-title { font-size: 2rem; margin: 0 0 0.8rem; }
