/* ==================================================================
   Product page quick enquiry pop-up                    (2026-10-26)
   Markup: includes/quick-enquiry-dialog.php. Loaded only on product
   pages (machines/_product.php, products/view.php) through $page['css'].
   Built on site.css tokens and its .field / .btn-submit / .form-alert
   / .hp-field classes; only what those do not cover is here.
   ================================================================== */

html.qe-open { overflow: hidden; }

.qe {
    width: min(440px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--sh-lg);
    overflow: auto;
    overscroll-behavior: contain;
}
.qe::backdrop { background: rgba(8, 8, 8, .55); }
.qe[open] { animation: qe-in .2s ease-out; }
@keyframes qe-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .qe[open] { animation: none; } }

.qe-panel { position: relative; padding: 28px 24px 22px; }

.qe-close {
    position: absolute; top: 8px; right: 8px;
    width: 44px; height: 44px;                       /* touch target */
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 999px; background: transparent;
    color: var(--ink-70); cursor: pointer;
}
.qe-close:hover { background: var(--surface-3); color: var(--ink); }

.qe-title {
    font-family: var(--font-heading); font-size: 1.4rem; line-height: 1.25;
    margin: 0 44px 8px 0; color: var(--ink);
}
/* Focused by script on open (tabindex="-1") so screen readers start at the heading; it is not
   interactive and cannot be tabbed to, so it carries no focus ring. */
.qe-title:focus { outline: none; }
.qe-text { font-size: .95rem; line-height: 1.55; color: var(--ink-70); margin: 0 0 16px; }
.qe-saved {
    font-size: .88rem; line-height: 1.5; margin: -6px 0 16px;
    padding: 10px 12px; border-radius: var(--r-sm);
    background: var(--accent-tint); color: var(--accent-600);
}
.qe-nowrap { white-space: nowrap; }

.qe-tick {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-bottom: 12px; border-radius: 999px;
    background: #ecfdf3; color: #067647;
}

.qe-product {
    display: flex; gap: 12px; align-items: center;
    padding: 12px; margin-bottom: 18px;
    border: 1px solid var(--line); border-radius: var(--r);
    background: var(--surface-2);
}
.qe-img {
    flex: 0 0 56px; width: 56px; height: 56px; object-fit: contain;
    border-radius: var(--r-sm); background: var(--surface);
}
.qe-product-text { min-width: 0; }
.qe-product-name { font-weight: 700; font-size: .95rem; line-height: 1.35; margin: 0; color: var(--ink); }
.qe-meta { font-size: .84rem; margin: 3px 0 0; color: var(--ink-70); }

.qe-field { margin-bottom: 14px; }
.qe-field textarea { min-height: 84px; }
.qe-field input[readonly] { background: var(--surface-2); }
.qe-optional { font-weight: 400; color: var(--ink-70); }
.qe-hint { font-size: .8rem; color: var(--ink-70); margin: 7px 0 0; }   /* site .hint (--ink-40) is under 4.5:1 */
.qe-change {
    align-self: flex-start; margin-top: 4px; padding: 10px 0; min-height: 44px;
    border: 0; background: none; cursor: pointer;
    font: 600 .86rem var(--font-body); color: var(--accent);
    text-decoration: underline; text-underline-offset: 3px;
}

.qe-status { margin: 4px 0 14px; padding: 12px 14px; font-size: .88rem; }

/* --brand-600: white on the base magenta is 4.36:1, under AA for this text size. */
.qe-submit { width: 100%; background: var(--brand-600); }
.qe-submit:hover:not(:disabled) { background: var(--brand-700); }
.qe-submit[aria-busy="true"] { cursor: progress; }

.qe-privacy { font-size: .8rem; line-height: 1.55; color: var(--ink-70); margin: 12px 0 0; }
.qe-privacy a { color: var(--accent); font-weight: 600; }

@media (max-width: 420px) {
    .qe-panel { padding: 24px 16px 18px; }
    .qe-title { font-size: 1.25rem; }
}

/* ------------------------------------------------------------------
   Blog pop-up additions (2026-11-09): "What do you need?" choices and the
   shorter message box. The country flag picker reuses site.css (.phone-field,
   .cc-*), the same styles as the long enquiry form.
   Native radios stay in the page (keyboard + screen readers); the label is the
   44 px tap target, 8 px apart, with a visible focus ring (ui-ux-pro-max: touch
   spacing, focus states, optional fields marked).
   ------------------------------------------------------------------ */
.qe-needs { border: 0; padding: 0; min-width: 0; }
.qe-needs-legend {
    float: none; width: auto; padding: 0; margin: 0 0 8px;
    font-size: .9rem; font-weight: 600; color: var(--ink); line-height: 1.4;
}
.qe-needs-list { display: flex; flex-wrap: wrap; gap: 8px; }
.qe-need { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.qe-need input {
    position: absolute; inset: 0; width: 100%; height: 100%;
    margin: 0; opacity: 0; cursor: pointer;
}
.qe-need span {
    display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px;
    border: 1px solid var(--ink-40); border-radius: 999px; background: var(--surface);
    font-size: .875rem; line-height: 1.3; color: var(--ink);
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.qe-need:hover span { border-color: var(--ink-50); background: var(--surface-2); }
.qe-need input:checked + span {
    border-color: var(--brand-700); background: var(--brand-tint); color: var(--brand-700); font-weight: 600;
}
.qe-need input:checked + span::before {
    content: ""; flex: 0 0 14px; height: 14px; margin-right: 6px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a81264' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center / contain;
}
.qe-need input:focus-visible + span { outline: 2px solid var(--brand-700); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .qe-need span { transition: none; } }

.qe-field textarea[rows="2"] { min-height: 64px; }
/* The country list opens inside the scrolling pop-up: keep it from being cut off at the bottom. */
.qe .cc-list { max-height: 220px; }

/* Short screens (phones): tighter spacing in the blog pop-up only (it has the need choices), so
   "Send enquiry" stays in view without scrolling inside the pop-up. Product pop-ups are unchanged.
   Touch targets keep their 44 px. */
@media (max-height: 860px) {
    .qe:has(.qe-needs) .qe-panel { padding: 18px 18px 14px; }
    .qe:has(.qe-needs) .qe-title { margin-bottom: 4px; font-size: 1.25rem; }
    .qe:has(.qe-needs) .qe-text { margin-bottom: 10px; }
    .qe:has(.qe-needs) .qe-product { margin-bottom: 10px; padding-top: 8px; padding-bottom: 8px; }
    .qe:has(.qe-needs) .qe-field { margin-bottom: 10px; }
    .qe:has(.qe-needs) .qe-needs-legend { margin-bottom: 6px; }
    .qe:has(.qe-needs) .qe-field textarea[rows="2"] { min-height: 52px; }
    /* the picture's size is set inline (96x72) for tall screens */
    .qe:has(.qe-needs) .qe-img { width: 72px !important; height: 54px !important; flex-basis: 72px !important; }
}
