/* =====================================================================
   DIAGNOSTIC TEST PRICES — public pages
   Uses the design tokens from style.css (--primary, --accent, --line ...)
   ===================================================================== */

/* ---------- Page header band ---------- */
.tp-head {
    background: linear-gradient(160deg, var(--primary-wash) 0%, #fff 100%);
    border-bottom: 1px solid var(--line);
    padding: 34px 0 28px;
}
.tp-head h1 { margin-bottom: 6px; }
.tp-sub { color: var(--ink-soft); max-width: 64ch; margin: 0; }
.tp-crumbs { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 12px; }
.tp-crumbs a { color: var(--ink-soft); }
.tp-crumbs a:hover { color: var(--primary-deep); }

/* ---------- Search ---------- */
.tp-search { position: relative; max-width: 660px; margin-top: 18px; }
.tp-search input[type="text"] {
    height: 54px; padding-left: 46px; font-size: 1rem;
    border-radius: 12px; border-color: var(--line-strong); box-shadow: var(--shadow-sm);
}
.tp-search-icon { position: absolute; left: 16px; top: 15px; font-size: 1.1rem; pointer-events: none; }
.tp-search .ac-list { top: 8px; }
.ac-item .ac-price { float: right; font-weight: 800; color: var(--gov-green); font-size: 0.86rem; margin-left: 10px; }

/* ---------- Chips ---------- */
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.tp-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 30px; font-size: 0.86rem; font-weight: 700;
    background: #fff; color: var(--ink); border: 1.5px solid var(--line-strong);
    transition: background .15s, border-color .15s;
}
.tp-chip:hover { text-decoration: none; border-color: var(--primary); background: var(--primary-wash); }
.tp-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tp-chip small { font-weight: 600; opacity: .75; }

/* ---------- Filter bar ---------- */
.tp-filters {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.tp-filters .f { display: flex; flex-direction: column; min-width: 150px; flex: 1 1 150px; }
.tp-filters label { font-size: 0.74rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.tp-filters select { padding: 9px 10px; font-size: 0.9rem; }
.tp-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; padding-bottom: 9px; cursor: pointer; }
.tp-check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ---------- Test cards (catalog) ---------- */
.tp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tp-card {
    background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--primary);
    border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px;
    box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s;
}
.tp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tp-card.is-empty { border-top-color: var(--line-strong); }
.tp-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tp-cat-tag { font-size: 0.72rem; font-weight: 700; color: var(--primary-deep); background: var(--primary-wash); padding: 3px 10px; border-radius: 20px; }
.tp-card h3 { margin: 2px 0 0; font-size: 1.05rem; }
.tp-card h3 a { color: var(--ink); }
.tp-card h3 a:hover { color: var(--primary-deep); text-decoration: none; }
.tp-card .alt-name { font-size: 0.82rem; color: var(--ink-soft); margin-top: -4px; }
.tp-range { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.tp-range .from { font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; }
.tp-range .amt { font-size: 1.45rem; font-weight: 800; color: var(--ink); }
.tp-range .to { font-size: 0.86rem; color: var(--ink-soft); }
.tp-card-meta { font-size: 0.82rem; color: var(--ink-soft); }
.tp-card-actions { margin-top: auto; display: flex; gap: 8px; padding-top: 10px; }
.tp-card-actions .btn { flex: 1; justify-content: center; }

.tp-add {
    border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink);
    font: inherit; font-size: 0.76rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; cursor: pointer;
    transition: all .15s; white-space: nowrap;
}
.tp-add:hover { border-color: var(--primary); color: var(--primary-deep); }
.tp-add.on { background: var(--gov-green); border-color: var(--gov-green); color: #fff; }

.tp-btn-sm { padding: 7px 13px; font-size: 0.82rem; border-width: 1.5px; }

/* ---------- Sticky compare bar ---------- */
.tp-basket-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--ink); color: #fff; padding: 12px 0;
    transform: translateY(110%); transition: transform .22s ease;
    box-shadow: 0 -6px 24px rgba(22, 34, 58, .25);
}
.tp-basket-bar.show { transform: none; }
.tp-basket-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.tp-basket-bar strong { font-size: 0.96rem; }
.tp-basket-bar .links { display: flex; align-items: center; gap: 12px; }
.tp-basket-bar .clear { background: none; border: 0; color: #C9D3E6; font: inherit; font-size: 0.86rem; cursor: pointer; text-decoration: underline; }

/* ---------- Stats strip (single test page) ---------- */
.tp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 18px; }
.tp-stat {
    background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--primary);
    border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.tp-stat.low { border-top-color: var(--gov-green); }
.tp-stat.high { border-top-color: var(--maroon); }
.tp-stat .l { font-size: 0.76rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em; }
.tp-stat .v { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.tp-stat .s { font-size: 0.78rem; color: var(--ink-soft); }

.tp-save {
    background: var(--gov-green-wash); border: 1px solid #BFE9D6; color: #0E6B47;
    border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-weight: 600;
}
.tp-info {
    background: var(--primary-wash); border: 1px solid #CFE2F7; color: var(--primary-deep);
    border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-size: 0.92rem;
}
.tp-info strong { display: block; margin-bottom: 2px; }

/* ---------- Hospital offer rows (single test page) ---------- */
.tp-offers { display: flex; flex-direction: column; gap: 12px; }
.tp-offer {
    display: grid; grid-template-columns: 40px 1fr 200px auto; gap: 18px; align-items: center;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.tp-offer.best { border-color: var(--gov-green); box-shadow: 0 0 0 3px var(--gov-green-wash), var(--shadow-sm); }
.tp-rank {
    width: 36px; height: 36px; border-radius: 50%; background: var(--paper);
    display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--ink-soft);
}
.tp-offer.best .tp-rank { background: var(--gov-green); color: #fff; }
.tp-offer-main h3 { margin: 0 0 4px; font-size: 1.05rem; }
.tp-offer-main h3 a { color: var(--ink); }
.tp-offer-main h3 a:hover { color: var(--primary-deep); text-decoration: none; }
.tp-offer-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.82rem; color: var(--ink-soft); align-items: center; }
.tp-offer-note { font-size: 0.84rem; margin-top: 6px; color: var(--ink); background: var(--gold-wash); padding: 5px 10px; border-radius: 6px; display: inline-block; }
.tp-price-box { text-align: right; }
.tp-price { font-size: 1.55rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.tp-offer.best .tp-price { color: #0E6B47; }
.tp-price-old { text-decoration: line-through; color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; display: block; }
.tp-diff { font-size: 0.78rem; color: var(--ink-soft); margin-top: 2px; }
.tp-bar { height: 6px; border-radius: 4px; background: var(--line); margin-top: 8px; overflow: hidden; }
.tp-bar span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.tp-offer.best .tp-bar span { background: var(--gov-green); }
.tp-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Badges ---------- */
.tp-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; line-height: 1.4; }
.tp-badge-low  { background: var(--gov-green); color: #fff; }
.tp-badge-disc { background: var(--accent-wash); color: var(--accent-deep); }
.tp-badge-ok   { background: var(--gov-green-wash); color: #0E6B47; }
.tp-badge-warn { background: var(--gold-wash); color: #9A6200; }
.tp-badge-info { background: var(--primary-wash); color: var(--primary-deep); }
.tp-badge-gov  { background: var(--gov-green-wash); color: var(--gov-green); }

/* ---------- Hospital profile: price table ---------- */
.tp-section { margin: 12px 0 34px; scroll-margin-top: 90px; }
.tp-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tp-section-head h2 { margin: 0; }
.tp-updated { font-size: 0.8rem; color: var(--ink-soft); }
.tp-mini-search { position: relative; flex: 1 1 220px; max-width: 320px; }
.tp-mini-search input { padding: 9px 12px 9px 34px; font-size: 0.9rem; }
.tp-mini-search span { position: absolute; left: 11px; top: 9px; font-size: 0.9rem; pointer-events: none; }
.tp-table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.tp-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tp-table th { text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); background: var(--paper); padding: 10px 14px; }
.tp-table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.tp-table tr:hover td { background: #FAFCFF; }
.tp-table td.p { font-weight: 800; white-space: nowrap; }
.tp-table .old { text-decoration: line-through; color: var(--ink-soft); font-weight: 600; font-size: 0.82rem; margin-right: 6px; }
.tp-table tr.is-hidden, .tp-table tr.is-collapsed { display: none; }
.tp-table .tname a { color: var(--ink); font-weight: 600; }
.tp-table .tname a:hover { color: var(--primary-deep); }
.tp-table .tcat { display: block; font-size: 0.74rem; color: var(--ink-soft); }
.tp-table-foot { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--paper); }
.tp-noresult { padding: 22px; text-align: center; color: var(--ink-soft); display: none; }
.tp-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- Basket (multi-test cost) ---------- */
.tp-selected { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tp-pill {
    display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--primary);
    color: var(--primary-deep); padding: 6px 8px 6px 14px; border-radius: 30px; font-size: 0.88rem; font-weight: 700;
}
.tp-pill a.x { width: 22px; height: 22px; border-radius: 50%; background: var(--primary-wash); color: var(--primary-deep); display: inline-flex; align-items: center; justify-content: center; font-size: 0.9rem; line-height: 1; }
.tp-pill a.x:hover { background: var(--maroon); color: #fff; text-decoration: none; }
.tp-matrix-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.tp-matrix { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 560px; }
.tp-matrix th { background: var(--paper); font-size: 0.76rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); padding: 11px 14px; text-align: right; white-space: nowrap; }
.tp-matrix th:first-child, .tp-matrix td:first-child { text-align: left; }
.tp-matrix td { padding: 12px 14px; border-top: 1px solid var(--line); text-align: right; }
.tp-matrix td:first-child { min-width: 220px; }
.tp-matrix td.total { font-weight: 800; font-size: 1.05rem; }
.tp-matrix tr.best td { background: var(--gov-green-wash); }
.tp-matrix tr.best td.total { color: #0E6B47; }
.tp-matrix .miss { color: var(--maroon); font-weight: 700; font-size: 0.8rem; }
.tp-matrix .hn a { font-weight: 700; color: var(--ink); }

/* ---------- Empty state / notes / pagination ---------- */
.tp-empty {
    background: #fff; border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
    padding: 40px 20px; text-align: center; color: var(--ink-soft);
}
.tp-empty .ic { font-size: 2.2rem; display: block; margin-bottom: 6px; }
.tp-empty h3 { color: var(--ink); margin-bottom: 4px; }
.tp-empty p { margin: 0 auto 14px; }
.tp-note { font-size: 0.82rem; color: var(--ink-soft); margin-top: 22px; border-left: 3px solid var(--gold); padding: 8px 12px; background: var(--gold-wash); border-radius: 0 6px 6px 0; max-width: none; }
.tp-pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px; }
.tp-pagination a, .tp-pagination span { padding: 7px 13px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); font-weight: 700; font-size: 0.86rem; color: var(--ink); background: #fff; }
.tp-pagination a:hover { text-decoration: none; border-color: var(--primary); }
.tp-pagination .cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.tp-related { margin-top: 34px; }

/* ---------- Homepage promo band ---------- */
.tp-promo {
    background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--accent);
    border-radius: 16px; box-shadow: var(--shadow-md); padding: 28px 30px;
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: center;
}
.tp-promo h2 { margin-bottom: 6px; }
.tp-promo .tp-search { margin-top: 16px; }
.tp-popular h4 { margin: 0 0 10px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.tp-popular .tp-chips { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .tp-grid { grid-template-columns: repeat(2, 1fr); }
    .tp-stats { grid-template-columns: repeat(2, 1fr); }
    .tp-offer { grid-template-columns: 40px 1fr auto; }
    .tp-offer .tp-actions { grid-column: 2 / -1; flex-direction: row; flex-wrap: wrap; }
    .tp-promo { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .tp-grid { grid-template-columns: 1fr; }
    .tp-head { padding: 24px 0 20px; }
    .tp-offer { grid-template-columns: 32px 1fr; gap: 12px; padding: 14px; }
    .tp-offer .tp-rank { width: 30px; height: 30px; font-size: 0.85rem; }
    .tp-offer .tp-price-box { grid-column: 1 / -1; text-align: left; }
    .tp-offer .tp-actions { grid-column: 1 / -1; }
    .tp-table .hide-sm { display: none; }
    .tp-table th, .tp-table td { padding: 10px 10px; }
    .tp-promo { padding: 20px 18px; }
    .tp-filters .f { flex-basis: 100%; }
}