/* Shared Speedhorse buyer catalog layer. Loaded by every sale catalog. */
:root {
  --font-display: 'Oswald', Arial, sans-serif;
  --font-body: 'Source Sans 3', Arial, sans-serif;
  --buyer-paper: var(--bg2);
  --buyer-ink: var(--text);
  --buyer-muted: var(--text3);
  --buyer-line: var(--border2);
  --buyer-action: var(--red);
}
body { font-size: 16px; }
.app-header { padding: 14px 22px; border-bottom: 3px solid var(--red); }
.brand-badge { border-radius: 4px; }
.brand-text h1 { font-family: var(--font-display); font-size: 21px; }
.buyer-version-label { color: var(--gold-bright); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.current-version-link { color: var(--text); border: 1px solid var(--border2); padding: 8px 12px; text-decoration: none; font-size: 13px; font-weight: 700; }
.current-version-link:hover { background: var(--red); border-color: var(--red); color: #fff; }
.sidebar { width: 224px; padding-top: 14px; }
.nav-item { min-height: 48px; font-size: 15px; font-weight: 700; border-radius: 4px; }
.nav-item.active { background: var(--red); color: #fff; }
.nav-item.active .count { color: #fff; background: rgba(0,0,0,.25); }
.buyer-more { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
.buyer-more-label { padding: 4px 12px; color: var(--text3); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.main { padding-top: 20px; }
.section-title { font-size: 30px; }
.section-sub { font-size: 15px; }
.buyer-guide { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 18px; margin-bottom: 20px; border: 2px solid var(--gold); background: var(--bg2); }
.buyer-guide h2 { font: 700 23px var(--font-display); margin-bottom: 5px; }
.buyer-guide p { color: var(--text2); }
.guide-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.guide-step { padding: 7px 10px; background: var(--bg3); border-left: 3px solid var(--red); font-size: 13px; font-weight: 700; }
.buyer-button, .print-choice { min-height: 42px; padding: 9px 14px; background: var(--red); color: #fff; border: 1px solid var(--red); font-size: 14px; font-weight: 800; }
.buyer-button:hover, .print-choice:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.buyer-button.secondary { background: var(--bg2); color: var(--text); border-color: var(--border2); }
.buyer-button.secondary:hover { background: var(--red); color: #fff; border-color: var(--red); }
.filter-bar { border-radius: 4px; padding: 16px; }
.filter-bar input[type="text"], .filter-bar select { min-height: 43px; font-size: 14px; }
.filter-bar select.catalog-filter,
.filter-bar select[aria-label^="Filter by"] { color: var(--red-bright, var(--red)) !important; -webkit-text-fill-color: var(--red-bright, var(--red)) !important; font-weight: 800 !important; }
.filter-bar select.catalog-filter option,
.filter-bar select[aria-label^="Filter by"] option { color: var(--text); -webkit-text-fill-color: var(--text); font-weight: 600; }
.filter-count { width: 100%; margin-left: 0; font-size: 14px; }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; padding-top: 4px; }
.filter-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 10px; background: var(--bg3); border: 1px solid var(--gold); color: var(--text); font-size: 13px; font-weight: 700; }
.filter-chip span { color: var(--red-bright); font-size: 17px; }
.catalogue-grid { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.horse-card { border-radius: 4px; padding: 16px; border-width: 2px; }
.card-name { font-size: 19px; }
.card-meta, .card-lines, .card-consignor { font-size: 14px; }
.paddle { width: 44px; height: 44px; border-radius: 4px; font-size: 15px; background: var(--red); color: #fff; }
.card-buyer-facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin-top: 12px; }
.card-fact { padding: 8px; background: var(--bg3); font-size: 12px; color: var(--text3); }
.card-fact b { display: block; color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sale-status { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 8px; border: 1px solid var(--border2); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.sale-status.sold, .sale-status.mine { background: var(--green); border-color: var(--green); color: #fff; }
.sale-status.out { background: var(--red); border-color: var(--red); color: #fff; }
.sale-status.repurchased { border-color: var(--gold); color: var(--gold-bright); }
.sale-status.upcoming { color: var(--text2); }
.buyer-dashboard { display: grid; gap: 16px; }
.buyer-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.buyer-summary { padding: 14px; background: var(--bg2); border-top: 4px solid var(--red); }
.buyer-summary span { display: block; color: var(--text3); font-size: 11px; text-transform: uppercase; font-weight: 800; }
.buyer-summary b { display: block; font: 700 24px var(--font-display); }
.buyer-section { background: var(--bg2); border: 1px solid var(--border); padding: 16px; }
.buyer-section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.buyer-section h3 { font:700 20px var(--font-display); }
.buyer-section-heading { margin:-16px -16px 16px; padding:14px 16px; border-left:6px solid var(--red); border-bottom:2px solid var(--red); background:var(--bg3); }
.buyer-section-heading h3 { font-size:25px; text-transform:uppercase; }
.saved-horses-controls { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:0 0 14px; flex-wrap:wrap; }
.saved-horses-days { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.saved-horses-days button { min-height:42px; padding:8px 13px; border:1px solid var(--border2); background:var(--bg); color:var(--text); font-weight:800; }
.saved-horses-days button:hover, .saved-horses-days button.active { background:var(--red); border-color:var(--red); color:#fff; }
.saved-horses-sort { display:flex; justify-content:flex-end; align-items:center; gap:8px; margin:0; font-weight:700; }
.saved-horses-sort select { min-height:42px; min-width:160px; }
.ranked-picks-list { display:grid; gap:7px; }
.ranked-pick-row { display:grid; grid-template-columns:82px 70px minmax(180px,1.5fr) minmax(150px,1fr) auto; gap:12px; align-items:center; padding:11px 12px; border:1px solid var(--border); background:var(--bg); }
.ranked-pick-rank { color:var(--red-bright); font:700 17px var(--font-display); text-transform:uppercase; }
.ranked-pick-hip { font:700 16px var(--font-display); }
.ranked-pick-horse { display:grid; min-width:0; }
.ranked-pick-horse span, .ranked-pick-consignor { color:var(--text3); font-size:12px; }
.buyer-actions { display:flex; gap:8px; flex-wrap:wrap; }
.sale-day-list { display: grid; gap: 8px; }
.sale-day-row { display:grid; grid-template-columns: 68px minmax(160px,1.4fr) minmax(140px,1fr) minmax(140px,1fr) 110px 120px; gap:10px; align-items:center; min-height:72px; padding:10px 12px; border:1px solid var(--border); background:var(--bg2); }
.sale-day-hip { font:700 22px var(--font-display); color:var(--red-bright); }
.sale-day-name { font-weight:800; }
.sale-day-sub { color:var(--text3); font-size:12px; }
.route-group { margin-bottom: 18px; }
.route-group-title { padding: 9px 12px; background: var(--text); color: var(--bg); font-weight: 900; text-transform: uppercase; }
.route-row { display:grid; grid-template-columns:60px 70px 1fr 1fr auto; gap:10px; padding:10px 12px; border:1px solid var(--border); border-top:0; align-items:center; }
.print-menu { position: relative; }
.print-menu summary { list-style:none; }
.print-menu summary::-webkit-details-marker { display:none; }
.print-options { position:absolute; z-index:30; top:calc(100% + 6px); left:0; min-width:190px; padding:7px; background:var(--bg2); border:1px solid var(--border2); box-shadow:0 10px 30px var(--shadow-strong); }
.print-choice { width:100%; text-align:left; margin:2px 0; }
.settings-wrap { display:flex; align-items:center; gap:8px; }
.guide-btn-top { font-size:17px; font-weight:900; background:var(--red); color:#fff !important; border-color:var(--red) !important; }
.guide-btn-top:hover, .guide-btn-top:active { background:var(--red-strong,#a00d24); color:#fff !important; border-color:var(--gold) !important; }
.buyer-mobile-nav { display:none; }
.sale-day-max { display:grid; gap:4px; color:var(--text3); font-size:11px; font-weight:800; text-transform:uppercase; }
.sale-day-max input { width:110px; min-height:42px; padding:8px 10px; border:1px solid var(--border2); background:var(--bg); color:var(--text); font-size:16px; }
@media (max-width: 860px) {
  body { font-size: 16px; }
  body { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
  .app-header { min-height:58px; padding:9px 12px; }
  .app-header .mobile-nav-btn, .sidebar, .nav-backdrop { display:none !important; }
  .brand { gap:8px; }
  .brand-text h1 { font-size:16px; }
  .buyer-version-label { font-size:9px; }
  .header-stats > .lang-switch { display:none; }
  .main { padding: 14px 12px 36px; }
  .section-title { font-size: 27px; }
  .buyer-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .buyer-guide { grid-template-columns:1fr; padding:15px; gap:14px; }
  .buyer-guide h2 { font-size:21px; }
  .guide-steps { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .guide-step { min-height:44px; display:flex; align-items:center; }
  .buyer-guide .buyer-button { width:100%; }
  .buyer-button, .print-choice { min-height:46px; font-size:15px; }
  .filter-bar { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:12px; position:relative; }
  .session-toggle { grid-column:1 / -1; overflow-x:auto; justify-content:flex-start; scrollbar-width:none; }
  .session-toggle::-webkit-scrollbar { display:none; }
  .session-toggle button { min-width:72px; min-height:42px; padding:8px 12px; flex:1 0 auto; }
  .jump-hip { grid-column:1 / -1; min-height:46px; }
  .filter-bar .jump-hip input[type="text"] { flex:1; width:auto; font-size:16px; }
  .jump-hip button { min-width:52px; min-height:38px; font-size:14px; }
  .filter-bar > input[type="text"] { grid-column:1 / -1; min-width:0; width:100%; }
  .filter-bar input[type="text"], .filter-bar select { min-width:0; width:100%; min-height:46px; font-size:16px; }
  .filter-count, .active-filters { grid-column:1 / -1; }
  .active-filters { overflow-x:auto; flex-wrap:nowrap; padding-bottom:3px; scrollbar-width:none; }
  .active-filters::-webkit-scrollbar { display:none; }
  .filter-chip { flex:0 0 auto; min-height:42px; }
  .catalogue-grid { grid-template-columns:minmax(0,1fr); min-width:0; }
  .horse-card { min-width:0; padding:14px; }
  .paddle { width:48px; height:48px; font-size:16px; }
  .card-name { font-size:20px; }
  .card-meta, .card-lines, .card-consignor { font-size:14px; }
  .card-actions button { width:42px; height:42px; font-size:20px; }
  .card-buyer-facts { grid-template-columns:1fr 1fr; }
  .card-fact { min-height:60px; font-size:12px; }
  .card-fact b { font-size:15px; white-space:normal; line-height:1.2; }
  .buyer-section { padding:14px 12px; }
  .buyer-section-heading { margin:-14px -12px 14px; padding:13px 12px; }
  .buyer-section-heading h3 { font-size:22px; }
  .buyer-section-head { align-items:stretch; }
  .buyer-section-head > div:first-child { width:100%; }
  .buyer-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; }
  .buyer-actions > *, .buyer-actions .buyer-button { width:100%; }
  .saved-horses-controls { align-items:stretch; }
  .saved-horses-days { width:100%; display:grid; grid-template-columns:repeat(auto-fit,minmax(74px,1fr)); }
  .saved-horses-sort { width:100%; justify-content:stretch; }
  .saved-horses-sort select { flex:1; min-width:0; }
  .ranked-pick-row { grid-template-columns:auto 1fr auto; grid-template-areas:"rank horse hip" "consignor consignor open"; gap:8px 10px; padding:12px; }
  .ranked-pick-rank { grid-area:rank; }
  .ranked-pick-hip { grid-area:hip; text-align:right; }
  .ranked-pick-horse { grid-area:horse; }
  .ranked-pick-consignor { grid-area:consignor; }
  .ranked-pick-open { grid-area:open; }
  .print-options { position:fixed; left:12px; right:12px; top:auto; bottom:calc(76px + env(safe-area-inset-bottom)); min-width:0; }
  .sale-day-row { grid-template-columns:66px minmax(0,1fr) auto; grid-template-areas:"hip horse state" "location location location" "max max max" "open open open"; gap:10px 12px; padding:14px 12px; }
  .sale-day-hip { grid-area:hip; font-size:24px; }
  .sale-day-horse { grid-area:horse; min-width:0; }
  .sale-day-name { font-size:18px; }
  .sale-day-location { grid-area:location; padding:10px; background:var(--bg3); border-left:3px solid var(--gold); }
  .sale-day-max { grid-area:max; width:100%; }
  .sale-day-max input { width:100%; min-width:0; }
  .sale-day-state { grid-area:state; text-align:right; }
  .sale-day-open { grid-area:open; justify-self:stretch; width:100%; }
  .route-row { grid-template-columns:auto 1fr auto; grid-template-areas:"hip horse rank" "location location open"; gap:9px 12px; padding:12px; }
  .route-hip { grid-area:hip; }
  .route-rank { grid-area:rank; text-align:right; }
  .route-horse { grid-area:horse; min-width:0; }
  .route-location { grid-area:location; padding:8px; background:var(--bg3); border-left:3px solid var(--gold); }
  .route-open { grid-area:open; }
  .current-version-link { display:none; }
  .buyer-mobile-nav { position:fixed; z-index:75; left:0; right:0; bottom:0; display:flex; align-items:stretch; overflow-x:auto; background:var(--bg2); border-top:2px solid var(--red); padding:5px 4px calc(5px + env(safe-area-inset-bottom)); box-shadow:0 -8px 24px var(--shadow-strong); scrollbar-width:none; }
  .buyer-mobile-nav::-webkit-scrollbar { display:none; }
  .buyer-mobile-nav-item { position:relative; flex:1 1 0; min-width:61px; min-height:54px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; color:var(--text3); }
  .buyer-mobile-nav-item > span { font-size:20px; line-height:1; }
  .buyer-mobile-nav-item small { font-size:10px; font-weight:800; white-space:nowrap; }
  .buyer-mobile-nav-item b { position:absolute; top:1px; right:9px; min-width:18px; height:18px; padding:0 4px; border-radius:9px; background:var(--red); color:#fff; font-size:10px; line-height:18px; }
  .buyer-mobile-nav-item.active { color:var(--text); background:var(--red); }
  .buyer-mobile-nav-item.active b { background:var(--text); color:var(--bg); }
  .guide-btn-top { font-size:15px; }
  .sh-live-pill {
    left:auto !important; right:auto !important; bottom:auto !important;
    width:100%; min-height:44px; margin:0 0 14px; padding:8px 12px !important; border-radius:4px !important;
    justify-content:center; box-shadow:none !important;
  }
  .print-options { bottom:calc(76px + env(safe-area-inset-bottom)); }
  .flipbook-wrap { height:calc(100dvh - 210px); min-height:420px; }
  .compare-table-wrap { max-height:calc(100dvh - 220px); }
}

@media (min-width: 600px) and (max-width: 1024px) {
  .catalogue-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .filter-bar { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .filter-bar .session-toggle, .filter-bar .jump-hip, .filter-bar > input[type="text"], .filter-count, .active-filters { grid-column:auto; }
  .filter-bar .session-toggle { grid-column:1 / -1; }
  .filter-bar > input[type="text"] { grid-column:span 2; }
  .buyer-mobile-nav-item { flex-basis:96px; }
  .sale-day-row { grid-template-columns:70px minmax(180px,1.5fr) minmax(160px,1fr) 124px auto; grid-template-areas:"hip horse location max state" ". horse location open open"; }
  .buyer-summary-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
}

@media (max-width: 390px) {
  .main { padding-left:9px; padding-right:9px; }
  .guide-steps, .card-buyer-facts { grid-template-columns:1fr; }
  .filter-bar { grid-template-columns:1fr; }
  .filter-bar > * { grid-column:1 !important; }
  .buyer-summary-grid { grid-template-columns:1fr 1fr; }
  .sale-day-row { grid-template-columns:58px minmax(0,1fr); grid-template-areas:"hip horse" "state state" "location location" "max max" "open open"; }
  .sale-day-state { text-align:left; display:flex; align-items:center; justify-content:space-between; }
}

/* Mobile catalog header (moved from the Heritage-only buyer page) */
@media (max-width: 639px) {
  .catalogue-header-row { flex-wrap: wrap; flex-direction: column; align-items: flex-start; gap: 12px; }
  .catalogue-header-row .aqha-promo { margin-top: 0; align-self: flex-start; padding: 6px 12px; }
  .catalogue-header-row .aqha-promo img { height: 34px; }
  .catalogue-header-row .section-title { font-size: 26px; }
  .catalogue-header-row .section-sub { font-size: 13px; line-height: 1.45; }
}

/* Rank control on the individual horse page */
.detail-rank{display:inline-flex;align-items:center;margin-left:8px;vertical-align:middle}
.detail-rank .rank-select{height:34px;min-width:58px;font-size:14px;opacity:1}
.detail-rank .rank-label{font-size:12px;letter-spacing:.06em;text-transform:uppercase;margin-right:6px}

/* Batch-rendered catalog: full-width "show more" row inside the grid */
.catalog-load-more { grid-column: 1 / -1; display: flex; justify-content: center; padding: 10px 0 4px; }
.catalog-load-more .buyer-button { min-width: 240px; }

/* ===== Pedigree highlight (brand-red pedigree direction) ===== */
.card-lines { font-size: 14px; line-height: 1.7; }
.card-lines .lbl { font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.card-lines > div:first-child b { color: var(--red-bright); font-weight: 800; font-size: 15px; }
.card-lines > div:nth-child(2) b { color: var(--text); font-weight: 800; font-size: 15px; }
.card-consignor {
  margin-top: 8px; padding: 7px 10px;
  background: var(--bg3); border-left: 4px solid var(--red);
  font-weight: 800; font-size: 14px; color: var(--text);
  border-radius: 0 4px 4px 0;
}
.sex-pill {
  display: inline-block; padding: 1px 8px; margin-left: 2px;
  background: var(--red); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  vertical-align: 1px;
}
