/*
 * Print.az — Reusable category "unlisted product" request section + modal.
 *
 * Visual language mirrors quote-request modal (typography, controls, focus rings,
 * sticky header + 44px close, mobile top-align / 100dvh / safe-area).
 * Scoped under .category-request / .category-request-modal to avoid collisions.
 */

/* --- In-page section ------------------------------------------------------ */
.category-request {
  padding: 48px 0 56px;
  background: #f6f7f9;
  border-top: 1px solid #e6e8ec;
}

/*
 * FLEX COLUMN, for two reasons measured on the rendered page.
 *
 * 1. THE BUTTON SAT IN A LINE BOX. .category-request__cta is inline-flex, so
 *    as a block-layout child it sits on a text baseline and carries the
 *    line-box descender beneath it. Measured before: 22.0px above the button
 *    and 0.0px below, with the trust line effectively glued to it. As a flex
 *    item the button is no longer in a line box, so the space below is the
 *    margin and nothing else.
 *
 * 2. THE HOST PAGE WAS WINNING THE MARGIN. category-page.css declares
 *    ".category-page h1, h2, h3, p { margin-top: 0 }" -- that is (0,1,1),
 *    class plus type, which beats the component's (0,1,0)
 *    ".category-request__trust" whatever the load order. It sets only
 *    margin-top, so __heading and __desc kept their bottom margins and the
 *    single casualty was the trust element's 14px, computing to 0.
 *
 *    The component's own rules are raised to (0,2,0) below so the component
 *    owns its spacing on any host page, rather than winning by luck.
 */
.category-request__inner {
  max-width: 720px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.category-request__heading {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  color: #17191d;
}

.category-request .category-request__desc {
  margin: 0 auto 20px;
  max-width: 58ch;
  color: #4f5865;
  font-size: 1rem;
  line-height: 1.6;
}

.category-request__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  color: #fff;
  background: #d71920;
  box-shadow: 0 14px 30px rgba(215, 25, 32, 0.24);
  transition: transform 0.12s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.category-request__cta:hover {
  background: #a80f16;
  transform: translateY(-1px);
}

.category-request__cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.34);
}

/*
 * Scoped to beat .category-page p (0,1,1). The value is the one that
 * measured ~22px of optical space beneath the button, matching the space
 * above it -- verify the RENDERED ink-to-ink gap, not this number, if it
 * ever changes.
 */
.category-request .category-request__trust {
  margin: 21px auto 0;
  max-width: 42ch;
  color: #6b7280;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Compact secondary CTA (configurator product pages) */
.category-request--compact-cta {
  padding: 28px 0 36px;
  background: #ffffff;
  border-top: 1px solid #e6e8ec;
}

.category-request--compact-cta .category-request__inner {
  max-width: 640px;
}

.category-request--compact-cta .category-request__heading {
  margin: 0 0 8px;
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.category-request--compact-cta .category-request__desc {
  margin: 0 auto 18px;
  max-width: 48ch;
  font-size: 0.95rem;
}

.category-request--compact-cta .category-request__cta {
  min-height: 46px;
  padding: 0 24px;
  color: #d71920;
  background: #ffffff;
  border: 2px solid #d71920;
  box-shadow: none;
}

.category-request--compact-cta .category-request__cta:hover {
  color: #ffffff;
  background: #d71920;
  transform: translateY(-1px);
}

.category-request--compact-cta .category-request__cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.28);
}

/* --- Modal shell (mirrors quote-modal) ------------------------------------ */
.category-request-modal {
  position: fixed;
  inset: 0;
  z-index: 3250;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  padding: 20px;
  overflow: hidden;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.category-request-modal[hidden] {
  display: none;
}

.category-request-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 16, 0.62);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.category-request-modal.is-open .category-request-modal__backdrop {
  opacity: 1;
}

.category-request-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 40px 90px rgba(10, 12, 16, 0.4);
  opacity: 0;
  transform: scale(0.96) translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.category-request-modal.is-open .category-request-modal__dialog {
  opacity: 1;
  transform: none;
}

.category-request-modal__header {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 56px 10px 28px;
  background: #ffffff;
}

.category-request-modal__header h2 {
  margin: 0;
  padding-right: 4px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #17191d;
  line-height: 1.2;
}

.category-request-modal__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding: 0 28px 28px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.category-request-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #e6e8ec;
  background: #fff;
  color: #17191d;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.category-request-modal__close:hover {
  border-color: #d71920;
  color: #d71920;
}

.category-request-modal__close svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.category-request-modal__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.32);
}

.category-request-modal__intro {
  margin: 0 0 18px;
  color: #4f5865;
  font-size: 0.96rem;
  line-height: 1.5;
}

.category-request-modal__product {
  margin: -6px 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #17191d;
  font-size: 0.92rem;
  line-height: 1.45;
}

.category-request-modal__product[hidden] {
  display: none;
}

.category-request-modal__trust {
  margin: 4px 0 14px;
  color: #6b7280;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.45;
}

.category-request-turnstile-field {
  margin-bottom: 14px;
}

.category-request-turnstile {
  min-height: 65px;
  min-width: 300px;
}

.category-request-turnstile iframe {
  max-width: 100%;
}

/* Honeypot — hidden from humans, present for bots */
.category-request-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Form ----------------------------------------------------------------- */
.category-request-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.category-request-form label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #17191d;
}

.category-request-form .req {
  color: #d71920;
}

.category-request-form input,
.category-request-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  font: inherit;
  color: #17191d;
  background: #fff;
}

.category-request-form textarea {
  min-height: 96px;
  resize: vertical;
}

.category-request-form input:focus,
.category-request-form textarea:focus,
.category-request-form .file-drop:focus-within {
  outline: none;
  border-color: #d71920;
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.18);
}

.category-request-form input[aria-invalid="true"],
.category-request-form textarea[aria-invalid="true"] {
  border-color: #d71920;
}

.category-request-field-error {
  font-size: 0.82rem;
  font-weight: 700;
  color: #a80f16;
}

.category-request-field-error::before {
  content: "⚠ ";
}

.category-request-field-error[hidden] {
  display: none;
}

.category-request-form .file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px;
  border: 1px dashed #c4cbd4;
  border-radius: 12px;
  cursor: pointer;
  background: #fafbfc;
}

.category-request-form .file-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.category-request-form .file-drop strong {
  font-size: 0.95rem;
  color: #17191d;
}

.category-request-form .file-drop span {
  font-size: 0.82rem;
  color: #6b7280;
}

.category-request-form__hint {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.4;
}

.category-request-form .file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-request-form .file-list[hidden] {
  display: none;
}

.category-request-form .file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 10px;
  font-size: 0.86rem;
}

.category-request-form .file-row span {
  overflow-wrap: anywhere;
}

.category-request-form .file-remove {
  border: 0;
  background: transparent;
  color: #a80f16;
  font-weight: 800;
  cursor: pointer;
  font-size: 0.82rem;
  flex: 0 0 auto;
}

.category-request-form .file-remove:hover {
  text-decoration: underline;
}

.category-request-form .form-submit,
.category-request-modal__success .form-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: #fff;
  background: #d71920;
  box-shadow: 0 14px 30px rgba(215, 25, 32, 0.24);
  transition: transform 0.12s ease;
}

.category-request-form .form-submit:hover {
  transform: translateY(-1px);
}

.category-request-form .form-submit[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.category-request-form .form-submit:focus-visible,
.category-request-modal__success .form-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.34);
}

.category-request-form .form-status {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  display: none;
}

.category-request-form .form-status[data-state] {
  display: block;
}

.category-request-form .form-status[data-state="loading"] {
  background: #eef2f7;
  color: #33415c;
}

.category-request-form .form-status[data-state="pending"] {
  background: #fff7e6;
  color: #7a5200;
  border: 1px solid #ffe1a8;
}

.category-request-form .form-status[data-state="error"] {
  background: #fdeaea;
  color: #a80f16;
  border: 1px solid #f5c2c2;
}

.category-request-form .form-status a {
  text-decoration: underline;
  font-weight: 800;
}

.category-request-modal__success {
  text-align: center;
  padding: 20px 8px 8px;
}

.category-request-modal__success[hidden] {
  display: none;
}

.category-request-modal__success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: #e9f7ef;
  color: #1b7a43;
}

.category-request-modal__success-icon svg {
  width: 30px;
  height: 30px;
}

.category-request-modal__success h2 {
  margin: 0 0 8px;
}

.category-request-modal__success p {
  margin: 0 auto 20px;
  max-width: 40ch;
  color: #4f5865;
  line-height: 1.55;
}

.category-request-modal__success .form-submit {
  width: auto;
  min-height: 44px;
  padding: 0 26px;
}

.category-request-optional {
  color: #6b7280;
  font-weight: 500;
  font-size: 0.86em;
}

.category-request-form--simple .form-field {
  margin-bottom: 14px;
}

.category-request-form--simple textarea {
  min-height: 88px;
}

/* intl-tel-input (CDN) — fit Print.az form controls */
.category-request-form .iti {
  width: 100%;
  display: block;
}

.category-request-form .iti__tel-input,
.category-request-form .iti input.iti__tel-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #d7dbe3;
  border-radius: 12px;
  font: inherit;
  color: #17191d;
  background: #fff;
}

.category-request-form .iti__tel-input:focus,
.category-request-form .iti input.iti__tel-input:focus {
  outline: none;
  border-color: rgba(215, 25, 32, 0.55);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.16);
}

.category-request-form .iti__country-container {
  left: 2px;
}

.category-request-form .iti--inline-dropdown .iti__dropdown-content {
  border-radius: 12px;
  border: 1px solid #e6e8ec;
  box-shadow: 0 16px 40px rgba(17, 19, 24, 0.14);
  z-index: 30;
}

@media (max-width: 899.98px) {
  .category-request-form--simple .form-field {
    margin-bottom: 12px;
  }
}

/* iOS-safe body lock */
body.category-request-modal-open {
  overflow: hidden;
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

@media (max-width: 899.98px) {
  .category-request {
    padding: 36px 0 44px;
  }

  .category-request--compact-cta {
    padding: 24px 0 32px;
  }

  .category-request__cta {
    width: min(100%, 320px);
  }

  .category-request--compact-cta .category-request__cta {
    width: min(100%, 280px);
  }

  .category-request-modal {
    align-items: flex-start;
    justify-content: center;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
  }

  .category-request-modal__dialog {
    width: 100%;
    max-height: calc(100vh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    margin: 0;
  }

  .category-request-modal__header {
    padding: 18px 56px 10px 18px;
  }

  .category-request-modal__scroll {
    padding: 0 18px 22px;
  }

  .category-request-modal__close {
    top: 10px;
    right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-request-modal__backdrop,
  .category-request-modal__dialog,
  .category-request__cta,
  .category-request-form .form-submit {
    transition: none !important;
  }
}
