/*
 * The Equipment Inquiry dialog on an item page (inc/equipment/inquiry.php). It takes the look
 * that the restyle gave Popup Maker's popup (parts/a-global.css): a white box with a thin rule,
 * the navy title, a 44 px Close button in the top right corner, and the page dimmed in navy.
 * The restyle's tokens apply where it defines them, with plain values as the fallback.
 */

.gl-eq-inquiry {
  box-sizing: border-box;
  width: min(600px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--gl-rule, #b9bfcc);
  border-radius: var(--gl-radius, 4px);
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 29, 69, .16);
  color: var(--gl-ink, #1f2430);
  font-family: var(--gl-sans, "Libre Franklin", "Segoe UI", system-ui, -apple-system, sans-serif);
}
.gl-eq-inquiry::backdrop { background-color: rgba(16, 29, 69, .6); }
.gl-eq-inquiry[open] { animation: gl-eq-inquiry-in 200ms cubic-bezier(.23, 1, .32, 1); }
@keyframes gl-eq-inquiry-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* The page stops scrolling while the dialog is open. The restyle keeps the scroll bar's strip
   (scrollbar-gutter: stable), so the strip takes the dimmed page's color, as it does for the
   popup: white under the .6 navy dim layer. */
html.gl-eq-inquiry-open { overflow: hidden; background-color: rgb(112, 119, 143) !important; }

/* The title row stays at the top while the form scrolls, so Close is always in reach. */
.gl-eq-inquiry__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 22px 6px 8px 24px;
  background: #fff;
}
.gl-eq-inquiry__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 6px 0 0;
  color: var(--gl-navy, #182a61);
  font-family: var(--gl-serif, "Libre Franklin", "Segoe UI", system-ui, -apple-system, sans-serif);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: anywhere;
}
.gl-eq-inquiry__title:focus { outline: none; }
.gl-eq-inquiry__title:focus-visible { outline: 2px solid var(--gl-navy, #182a61); outline-offset: 2px; }
.gl-eq-inquiry__close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 0;
  min-height: 0;
  margin: -16px 0 0;
  padding: 0;
  border: 0;
  border-radius: var(--gl-radius, 4px);
  background: transparent;
  box-shadow: none;
  color: var(--gl-navy, #182a61);
  font: 400 30px/44px var(--gl-sans, "Libre Franklin", "Segoe UI", system-ui, -apple-system, sans-serif);
  text-shadow: none;
  cursor: pointer;
}
.gl-eq-inquiry__close:hover { background: var(--gl-wash, #eef0f5); }
.gl-eq-inquiry__close:focus-visible { outline: 2px solid var(--gl-navy, #182a61); outline-offset: -2px; }

.gl-eq-inquiry__body {
  padding: 4px 24px 24px;
  color: var(--gl-ink, #1f2430);
  font-size: 17px;
  line-height: 1.55;
}
.gl-eq-inquiry__body p { font-weight: 400; }
.gl-eq-inquiry__body p:last-child { margin-bottom: 0; }
.gl-eq-inquiry__body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.gl-eq-inquiry__body select,
.gl-eq-inquiry__body textarea { min-height: 44px; max-width: 100%; }
.gl-eq-inquiry__body .wpcf7-submit { min-height: 44px; }

/* Phones: the dialog fills the screen's width, sits on its foot, and scrolls inside. */
@media (max-width: 767.98px) {
  .gl-eq-inquiry {
    width: 100%;
    max-height: 100dvh;
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: var(--gl-radius, 4px) var(--gl-radius, 4px) 0 0;
  }
  .gl-eq-inquiry__head { padding: 14px 4px 6px 16px; }
  .gl-eq-inquiry__title { font-size: 1.3rem; }
  .gl-eq-inquiry__close { margin-top: -8px; }
  .gl-eq-inquiry__body { padding: 4px 16px calc(20px + env(safe-area-inset-bottom, 0px)); font-size: 16px; }
  .gl-eq-inquiry__body textarea { max-height: 40dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .gl-eq-inquiry[open] { animation: none; }
}
