/* Graduated Essentials concept. Scoped to stock tiles, not vehicle detail pages. */
.card--essentials {
  border-color:#d9e2eb;
  box-shadow:0 5px 18px rgba(11,31,58,.07);
  transition:border-color .16s ease,box-shadow .16s ease;
}
.card--essentials:hover {box-shadow:0 7px 22px rgba(11,31,58,.1);}
.card--essentials:focus-visible {outline:3px solid var(--blue);outline-offset:3px;}
.card--essentials .ph {position:relative;overflow:hidden;}
.card--essentials .ph img {display:block;}
.card--essentials [hidden], .photo-viewer [hidden] {display:none!important;}
.card--essentials h3 a {color:inherit;}
.card--essentials a:focus-visible, .card-photos:focus-visible,
.photo-viewer button:focus-visible {outline:3px solid var(--blue);outline-offset:3px;}
.card-photos {
  position:absolute;left:10px;bottom:10px;min-height:44px;padding:8px 10px;
  border:1px solid #fff;border-radius:6px;background:#0b1f3a;color:#fff;
  font:600 12px "Segoe UI",Arial,sans-serif;cursor:pointer;
}
.photo-viewer {
  width:min(960px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:16px;
  border:1px solid #cddbe5;border-radius:12px;color:var(--navy);background:#fff;
  overflow:auto;overscroll-behavior:contain;
}
.photo-viewer::backdrop {background:rgba(5,15,30,.82);}
.photo-viewer-header {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;}
.photo-viewer-header h2 {margin:0;font-size:18px;overflow-wrap:anywhere;}
.photo-viewer button {
  min-height:44px;padding:9px 14px;border:1px solid #cddbe5;border-radius:6px;
  color:var(--navy);background:#f5f9fb;font:600 14px "Segoe UI",Arial,sans-serif;cursor:pointer;
}
.photo-viewer button:disabled {opacity:.5;cursor:default;}
.photo-viewer-close {flex-shrink:0;}
.photo-viewer-stage {height:min(58dvh,560px);display:flex;align-items:center;justify-content:center;background:#0b1f3a;border-radius:6px;}
.photo-viewer-stage img {display:block;width:100%;height:100%;object-fit:contain;}
.photo-viewer-status {min-height:22px;margin:12px 0;text-align:center;font-size:14px;}
.photo-viewer-controls {display:flex;justify-content:space-between;gap:12px;}
#photo-viewer-help {margin:12px 0 0;color:#52677d;font-size:12px;text-align:center;}
@media(max-width:480px) {
  .photo-viewer {padding:12px;}
  .photo-viewer-header h2 {font-size:16px;}
  .photo-viewer-stage {height:48dvh;}
}
.card--essentials .card-reference {
  position:static;display:block;margin-bottom:6px;
  padding:0;border:0;border-radius:0;background:none;
  color:var(--muted);font-size:11px;letter-spacing:.03em;
}
.card--essentials .cb {padding:13px 16px 15px;display:flex;flex-direction:column;flex:1;min-width:0;}
.card--essentials .cb h3 {font-size:20px;line-height:1.16;letter-spacing:-.025em;}
.card--essentials .cb .ver {
  margin:6px 0 9px;min-height:0;color:#52677d;font-size:12px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.card--essentials .specs {display:flex;align-items:center;flex-wrap:wrap;gap:5px 8px;color:#52677d;font-size:11px;min-height:21px;}
.card--essentials .specs span+span::before {content:"·";margin-right:8px;color:#9aabb9;}
.card-quote {margin-top:11px;padding:10px 11px 9px;border:1px solid #dce7eb;border-left:3px solid #14a899;border-radius:6px;background:#f7faf9;}
.card--essentials .card-quote .price {margin:0!important;font-size:24px;line-height:1.1;font-weight:750;letter-spacing:-.035em;}
.card--essentials .price small {color:#496276;font-size:12px;font-weight:700;letter-spacing:normal;}
.card--essentials .cb .quote-caption {margin:5px 0 0;color:#718295;font-size:10px;}
.card--essentials .cb .quote-base {margin:5px 0 0;color:#62768b;font-size:11px;}
.card--essentials .cb .card-metric {
  display:flex;justify-content:space-between;gap:12px;align-items:baseline;
  margin:0;padding:9px 1px;color:#62768b;font-size:11px;
}
.card-metric strong {color:#344b63;font-weight:650;text-align:right;}
.card--essentials .isv {border-bottom:1px solid #edf0f3;}
.card--essentials .cb .market-position {margin:9px 0 0;font-size:12px;line-height:1.45;font-weight:600;}
.market-position small {font-size:11px;font-weight:400;white-space:nowrap;}
.card--essentials .cb .market-position.pos {
  margin:12px 0 4px;padding:12px;
  border:1px solid #bfe3d6;border-radius:8px;
  background:#edf9f3;color:#0b6b55;font-size:14px;line-height:1.4;font-weight:700;
}
.card--essentials .market-position.pos strong {
  display:block;margin-bottom:4px;font-size:24px;line-height:1.1;color:#10A586;
  font-family:inherit;font-weight:750;letter-spacing:-.035em;overflow-wrap:anywhere;
}
.card--essentials .market-position.pos small {
  display:block;margin-top:5px;font-size:12px;font-weight:500;white-space:normal;
}
.card--essentials .mds {margin-bottom:3px!important;}
.card-open {
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  margin-top:auto;padding:9px 11px;border:1px solid #cddbe5;border-radius:6px;
  background:#fff;color:#16436a;font-size:12px;font-weight:650;
}
.card-open span {color:#148e83;font-size:17px;line-height:12px;}
.card--essentials:hover .card-open {border-color:#7398b2;background:#f5f9fb;}
.card--essentials .card-metric.mds span{color:#344b63;font-weight:650;}
/* Wide screens: show more cars per row (up to 6) instead of leaving empty margins. */
@media (min-width:1500px){
  main.wrap:has(> .grid), header.top .wrap, .site-footer .wrap {max-width:1800px;}
}
.card[hidden]{display:none!important}

/* Deal-ribbon card: whole car visible (no zoom crop), saving on a ribbon over the photo. */
.card--essentials .ph img {object-fit:contain;background:#eef2f7;}
.card-ribbon {position:absolute;left:0;top:14px;z-index:1;padding:6px 14px 6px 12px;border-radius:0 99px 99px 0;
  background:#14a899;color:#fff;font-size:12px;font-weight:700;box-shadow:0 2px 6px rgba(11,31,58,.25);}
.card-ribbon.neg {background:#6b7c8f;}
.card-ribbon:not(.pos):not(.neg) {background:#52677d;}
.card--essentials .cb .engine {margin:0 0 4px;color:#344b63;font-size:12px;font-weight:600;}

/* Compact card */
.card--essentials .ph {aspect-ratio:auto;display:block;min-height:0;}
.card--essentials .ph img {width:100%;height:auto;object-fit:contain;}
.grid:has(> .card--essentials) {gap:10px;}
.card--essentials .cb {padding:9px 11px 10px;}
.card--essentials .card-reference {margin-bottom:3px;font-size:10px;}
.card-head {display:flex;justify-content:space-between;align-items:flex-start;gap:8px;padding-bottom:7px;border-bottom:1px solid #e6ebf0;}
.card-name {min-width:0;flex:1;}
.card--essentials .cb h3 {font-size:16px;}
.card--essentials .cb .ver {margin:3px 0 0;}
.card--essentials .card-quote {margin:0;padding:0;border:0;background:none;text-align:right;flex-shrink:0;}
.card--essentials .card-quote .price {font-size:18px;white-space:nowrap;}
.card--essentials .cb .quote-caption {margin:2px 0 0;font-size:9px;white-space:nowrap;}
.card--essentials .cb .specs-line {margin:7px 0 0;color:#718295;font-size:11px;}
.card--essentials .card-reg-chip {
  display:inline-flex;align-items:center;gap:4px;flex-shrink:0;max-width:100px;
  padding:3px 7px;border:1px solid #dde3ee;border-radius:10px;background:#f5f7fb;
  color:#6b7a90;font-size:11px;font-weight:600;line-height:1.3;
}
.card--essentials .card-reg-chip:hover {border-color:#b8c4d6;color:#344b63;}
.card-ribbon {top:0;white-space:nowrap;padding:5px 12px 5px 10px;border-radius:0 99px 99px 0;box-shadow:none;font-size:12px;}
.card-ribbon.pos {background:#10A586;}
.card-badges {position:absolute;left:0;top:10px;z-index:1;display:flex;flex-direction:column;align-items:flex-start;gap:6px;}
.card-badges .card-ribbon {position:static;}
.card-mds {display:inline-block;padding:5px 12px 5px 10px;border-radius:0 99px 99px 0;
  background:#3185CF;color:#fff;font-size:12px;font-weight:700;white-space:nowrap;}
.card-photos {left:10px;bottom:10px;right:auto;}
@media(max-width:480px){
  .card-ribbon,.card-mds {font-size:11px;}
  .card-ribbon {padding:4px 9px 4px 8px;}
}
