/*
 * Lookup popups + "Parts not found" card (2026-10-19).
 *
 * Built from the owner's designs in _archive/img/ - "Car Reg Wrong.png",
 * "Turbo number incorrect.png" and "Parts not found.png": a white rounded card,
 * a magnifier icon (img/lookup/), a bold navy heading, the call-us line and a
 * grey X in the top-right corner. Sizes follow the mockups' proportions.
 *
 *   .ace-lookup-overlay   the popup js/ace-lookup-popup.js opens when a
 *                         registration / turbo number finds nothing
 *   .ace-lookup-card      the card itself; also printed inline by regnum2.php
 *                         (--inline) in place of the old "Parts not Found" heading
 *
 * Linked from foot.html, foot2.html and regnum2.php. Selectors are scoped to the
 * card and kept specific enough to beat style.css's global p / a / img / h2 rules.
 */

.ace-lookup-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    /* Above the cookie banner (_gtag.php, 2147483000), Magnific Popup (100000)
       and Bootstrap modals (1050) - the popup must be the top layer. */
    z-index: 2147483200;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 16px;
    background: rgba(9, 22, 50, 0.55);
    opacity: 0;
    visibility: hidden;
    -webkit-transition: opacity 0.18s ease, visibility 0s linear 0.18s;
    transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}

.ace-lookup-overlay.is-open {
    opacity: 1;
    visibility: visible;
    -webkit-transition: opacity 0.18s ease, visibility 0s;
    transition: opacity 0.18s ease, visibility 0s;
}

.ace-lookup-card {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 24px 24px 44px;
    background: #ffffff;
    border: 1px solid #e1e6ee;
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(9, 22, 50, 0.18), 0 2px 6px rgba(9, 22, 50, 0.08);
    text-align: center;
    font-family: 'Work Sans', 'Avenir Next', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #0a1f56;
}

.ace-lookup-overlay .ace-lookup-card {
    max-height: 100%;
    overflow-y: auto;
    -webkit-transform: translateY(10px) scale(0.97);
    transform: translateY(10px) scale(0.97);
    -webkit-transition: -webkit-transform 0.2s ease;
    transition: transform 0.2s ease;
}

.ace-lookup-overlay.is-open .ace-lookup-card {
    -webkit-transform: none;
    transform: none;
}

/* Inline version (regnum2.php "Parts not found"): sits in the results column. */
.ace-lookup-card.ace-lookup-card--inline {
    margin: 22px auto 0;
    box-shadow: 0 10px 30px rgba(9, 22, 50, 0.10), 0 1px 4px rgba(9, 22, 50, 0.06);
}

.ace-lookup-card[hidden],
.ace-lookup-hint[hidden] {
    display: none !important;
}

/* The grey X. Drawn with two bars so no icon font is needed. */
.ace-lookup-card .ace-lookup-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #7f8e9d;
    cursor: pointer;
    -webkit-transition: background-color 0.15s ease, color 0.15s ease;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ace-lookup-card .ace-lookup-close::before,
.ace-lookup-card .ace-lookup-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 2.5px;
    margin: -1.25px 0 0 -11px;
    border-radius: 2px;
    background: currentColor;
}

.ace-lookup-card .ace-lookup-close::before {
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
}

.ace-lookup-card .ace-lookup-close::after {
    -webkit-transform: rotate(-45deg);
    transform: rotate(-45deg);
}

.ace-lookup-card .ace-lookup-close:hover,
.ace-lookup-card .ace-lookup-close:focus {
    background: #eef2f7;
    color: #33475b;
    outline: none;
}

.ace-lookup-card .ace-lookup-close:focus-visible {
    box-shadow: 0 0 0 3px rgba(30, 115, 224, 0.45);
}

.ace-lookup-card img.ace-lookup-icon {
    display: block;
    width: auto;
    height: 100px;   /* fallback where clamp() is unsupported */
    height: clamp(74px, 20vw, 116px);
    max-width: 70%;
    margin: 0 auto 14px;
    border-radius: 0;
    -o-object-fit: contain;
    object-fit: contain;
}

.ace-lookup-card .ace-lookup-title {
    margin: 0 0 12px;
    padding: 0;
    font-family: inherit;
    font-size: 26px;
    font-size: clamp(20px, 5.6vw, 31px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.2px;
    color: #0a1f56;
    text-transform: none;
}

.ace-lookup-card p.ace-lookup-text {
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-size: 21px;
    font-size: clamp(16px, 4.5vw, 25px);
    font-weight: 400;
    line-height: 1.35;
    color: #12306b;
}

.ace-lookup-card p.ace-lookup-text a,
.ace-lookup-card p.ace-lookup-text a:hover,
.ace-lookup-card p.ace-lookup-text a:focus {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    white-space: nowrap;
}

.ace-lookup-card p.ace-lookup-text a:hover,
.ace-lookup-card p.ace-lookup-text a:focus {
    text-decoration: underline;
}

/* "Please try searching manually using the filter form" under the inline card. */
.ace-lookup-hint {
    max-width: 520px;
    margin: 16px auto 4px;
    text-align: center;
    font-family: 'Work Sans', 'Avenir Next', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-size: clamp(16px, 4.2vw, 19px);
    font-weight: 600;
    line-height: 1.4;
    color: #0a1f56;
}

/* Lookup "Go!" button while the check runs: the label is swapped for a spinner. */
.ace-lookup-busy {
    position: relative;
    cursor: progress !important;
}

.ace-lookup-busy > span {
    visibility: hidden;
}

.ace-lookup-busy::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    -webkit-animation: ace-lookup-spin 0.7s linear infinite;
    animation: ace-lookup-spin 0.7s linear infinite;
}

@-webkit-keyframes ace-lookup-spin {
    to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@keyframes ace-lookup-spin {
    to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ace-lookup-overlay,
    .ace-lookup-overlay.is-open,
    .ace-lookup-overlay .ace-lookup-card {
        -webkit-transition: none;
        transition: none;
    }

    .ace-lookup-overlay .ace-lookup-card {
        -webkit-transform: none;
        transform: none;
    }

    .ace-lookup-busy::after {
        -webkit-animation-duration: 1.6s;
        animation-duration: 1.6s;
    }
}

@media print {
    .ace-lookup-overlay {
        display: none !important;
    }
}
