/* /features/purchasing/ only: the body of the hero's live instrument (three vendors' quotes for
   one quote request, scored side by side, one awarded and ordered; js/pages/purchasing.js).
   The instrument's shell (stage, board header, activity footer) is .site-instrument in
   css/public-site.css. */

.pur-board {
    --pur-green: #146C43;
    --pur-green-soft: #E7F5EC;
    --pur-blue: #1E40AF;
    --pur-blue-soft: #E8EEFD;
}

.pur-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; height: 292px; }

.pur-card {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    overflow: hidden;
    border: 1px solid var(--site-line);
    border-radius: 10px;
    background: #fff;
    transition: border-color .25s ease, box-shadow .25s ease, opacity .35s ease;
}
.pur-card.is-received { cursor: pointer; }
.pur-card.is-received:hover { border-color: var(--site-accent); }
.pur-card.is-highest { box-shadow: inset 0 3px 0 #16A34A; }
.pur-card.is-winner { border-color: var(--pur-green); box-shadow: inset 0 0 0 1px var(--pur-green); }
.pur-board.is-awarded .pur-card:not(.is-winner) { opacity: .5; }

.pur-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pur-card__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--site-text); }
.pur-card__badge {
    flex: none;
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: #F1EFF5;
    color: var(--site-muted);
    font-family: var(--site-font-mono);
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.pur-card__badge--submitted { background: var(--site-panel); color: var(--site-accent); }
.pur-card__badge--highest { background: var(--pur-blue-soft); color: var(--pur-blue); }
.pur-card__badge--recommended { background: var(--pur-green-soft); color: var(--pur-green); }
.pur-card__badge--awarded { background: var(--pur-green); color: #fff; }

/* Quote lines (skeleton bars until the quote is in) */
.pur-card__lines { flex: none; height: 104px; display: flex; flex-direction: column; gap: 2px; }
.pur-card__wait {
    flex: 1;
    display: flex;
    align-items: flex-end;
    padding-bottom: 4px;
    background:
        linear-gradient(#EFEDF4, #EFEDF4) 0 8px / 82% 8px no-repeat,
        linear-gradient(#EFEDF4, #EFEDF4) 0 30px / 64% 8px no-repeat,
        linear-gradient(#EFEDF4, #EFEDF4) 0 52px / 74% 8px no-repeat;
    font-size: 12px;
    font-style: italic;
    color: var(--site-subtle);
}
.pur-line { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid #F0EEF4; font-size: 12.5px; color: var(--site-text-2); }
.pur-line span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pur-line span:last-child { flex: none; }
.pur-line.is-new { animation: pur-line-in .4s cubic-bezier(.34, 1.3, .64, 1) backwards; }
@keyframes pur-line-in { from { opacity: 0; transform: translateY(-6px); } }

.pur-card__total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--site-line); }
.pur-card__total > span:first-child { font-family: var(--site-font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--site-subtle); }
.pur-card__amount { display: inline-block; font-size: 16px; font-weight: 600; color: var(--site-text); }

/* Lead time, experience and the three compliance checks */
.pur-card__facts { flex: none; min-height: 44px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--site-muted); }
.pur-checks { display: flex; flex-wrap: wrap; gap: 4px; }
.pur-check { padding: 2px 6px; border-radius: 4px; background: var(--pur-green-soft); color: var(--pur-green); font-family: var(--site-font-mono); font-size: 10px; letter-spacing: .04em; }
.pur-check--no { background: #F6F5F8; color: var(--site-subtle); text-decoration: line-through; }

/* Score out of 100 from the comparison's weights */
.pur-card__score { flex: none; height: 18px; display: flex; align-items: center; gap: 8px; }
.pur-card__score:empty { visibility: hidden; }
.pur-score__label { font-family: var(--site-font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--site-subtle); }
.pur-score__track { flex: 1; height: 5px; overflow: hidden; border-radius: 3px; background: #EFEDF4; }
.pur-score__fill { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--site-accent); transition: width .8s cubic-bezier(.22, 1, .36, 1); }
.pur-card.is-highest .pur-score__fill, .pur-card.is-winner .pur-score__fill { background: #16A34A; }
.pur-score__value { width: 24px; font-size: 12.5px; font-weight: 600; text-align: right; color: var(--site-text); }

/* The order raised from the awarded quote */
.pur-card__stamp {
    position: absolute;
    top: 96px;
    left: 50%;
    padding: 6px 14px;
    border: 2px solid var(--pur-green);
    border-radius: 6px;
    background: rgba(255, 255, 255, .92);
    color: var(--pur-green);
    font-family: var(--site-font-mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .1em;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-50%) rotate(-8deg);
    pointer-events: none;
}
.pur-card__stamp small { display: block; font-size: 9.5px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; }
.pur-board.is-ordered .pur-card.is-winner .pur-card__stamp { opacity: 1; animation: pur-stamp .4s cubic-bezier(.22, 1.3, .36, 1) backwards; }
@keyframes pur-stamp { from { opacity: 0; transform: translateX(-50%) rotate(-8deg) scale(1.9); } }

/* ---------- Tablet: three narrow cards, without the quote lines ---------- */
@media (min-width: 760.02px) and (max-width: 940px) {
    .pur-cards { height: 232px; }
    .pur-card__head { flex-direction: column; align-items: flex-start; gap: 6px; }
    .pur-card__lines { display: none; }
    .pur-card__stamp { top: 124px; }   /* over the facts, clear of the total */
}

/* ---------- Narrow: one compact row per vendor ---------- */
@media (max-width: 760px) {
    .pur-cards { grid-template-columns: minmax(0, 1fr); height: auto; gap: 10px; }
    .pur-card { height: 106px; padding: 10px 12px; gap: 8px; }
    /* The Awarded badge and the activity line carry the order here. */
    .pur-card__lines, .pur-card__facts, .pur-card__stamp { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pur-card, .pur-score__fill { transition: none; }
}
