
.pl-grid {
  width: 100%;
  background: #fff;
  overflow: hidden;
  margin-bottom: 24px;
}

.pl-scroll-wrap { position: relative; margin-bottom: 24px; }
.pl-scroll .pl-grid { margin-bottom: 0; }

@media screen and (min-width: 1021px) {
  .pl-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }

  .pl-scroll .pl-grid {
    min-width: var(--pl-min, auto);
  }
}

.pl-scroll-wrap::before,
.pl-scroll-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 4;
}

.pl-scroll-wrap::before {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0));
}

.pl-scroll-wrap::after {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0));
}

.pl-scroll-wrap.pl-show-left::before { opacity: 1; }
.pl-scroll-wrap.pl-show-right::after { opacity: 1; }

@media screen and (max-width: 1020px) {
  .pl-scroll-wrap.pl-show-left::before { opacity: 0; }
}

.pl-head {
  display: grid;
  grid-template-columns: var(--pl-cols);
  gap: 6px 8px;
  align-items: center;
  padding: 12px 16px;
  background: var(--secondary, #000);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
}

.pl-head-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  min-width: 0;
}

.pl-head-name {
  align-items: flex-start;
  text-align: left;
  font-size: 16px;
}

.pl-head-cta { min-width: 0; }

.pl-head-sub {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.2;
}

.pl-row {
  display: grid;
  grid-template-columns: var(--pl-cols);
  gap: 6px 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #ececee;
  cursor: pointer;
  transition: background 0.15s linear;
}

.pl-row:last-child { border-bottom: none; }

.pl-row:hover {
  background: var(--tableHighlight, rgba(121, 111, 110, 0.1));
}

.pl-cell {
  min-width: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.3;
}

.pl-name {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.pl-thumb {
  width: 64px;
  height: auto;
  max-height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
}

.pl-name-text { font-weight: 600; }

.pl-name-model { display: none; }

.pl-mdlname { font-weight: 600; }

/* Prices */
.pl-price { line-height: 1.25; }

.pl-price-now {
  font-weight: 600;
  color: var(--primary, #000);
  white-space: nowrap;
}

.pl-price-was {
  display: block;
  font-size: 12px;
  color: #999;
  text-decoration: line-through;
  white-space: nowrap;
}

/* Highlight discounted price in red, mirroring the car list cards */
.pl-price:has(.pl-price-was) .pl-price-now { color: #d32f2f; }

/* EE registration / annual fee */
.pl-fee {
  font-size: 12px;
  color: #555;
}

.pl-fee-line { display: block; white-space: nowrap; }

/* Lease */
.pl-lease-now {
  font-weight: 600;
  color: var(--primary, #000);
  white-space: nowrap;
}

.pl-lease-terms {
  display: block;
  font-size: 11px;
  color: #777;
  line-height: 1.2;
}

/* Financing terms on rows when every row shares the same calculator — the
   desktop header sub already shows them once, so rows only surface them in
   mobile card mode (re-enabled below). */
.pl-lease-terms-same { display: none; }

/* Card labels (title + unit/VAT/terms sub) — real elements rendered by the
   card branch of pricelist_row.html. Hidden everywhere except mobile card
   mode: desktop shows the header bar instead, and the compare/matrix
   transpose shows the header cells as a frozen label column. */
.pl-label { display: none; }

/* Action / CTA — colours come from the brand .red / .cta-button class;
   here we only handle placement inside the grid cell. */
.pl-cta {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pl-cta .red,
.pl-cta .cta-button,
.pl-cta .pl-btn {
  float: none;
  margin: 0;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  padding:10px;
  height:auto;
}

.pl-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pl-remove img { width: 16px; height: 16px; }

/* ==========================================================================
   Mobile (≤1020px) — card mode (default)
   Each row renders as a self-labelled card. Gated off .pl-compare (compare
   page transpose, see compare.css) and .pl-matrix (pricelist transpose
   below), where the cells must stay plain grid items.
   ========================================================================== */
@media screen and (max-width: 1020px) {
  .pl-name-model { display: inline; }

  .pl-grid:not(.pl-compare):not(.pl-matrix) {
    background: transparent;
    border-radius: 0;
    overflow: visible;
  }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-head { display: none; }

  /* Each row → card. Inner 6-col grid: regular cells span the full width,
     spec cells span 2 → three per row. No column gap so the spec cells'
     hairlines join into one continuous line. */
  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    column-gap: 0;
    /* stretch (not the base .pl-row center) — cells sharing a grid row must be
       equal height so their hairlines join into one aligned line */
    align-items: stretch;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    margin-bottom: 16px;
    padding: 8px 16px 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-row:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  }

  /* Label left, value(s) right. */
  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-cell {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 12px;
    row-gap: 2px;
    align-items: baseline;
    text-align: right;
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
    font-size: 14px;
  }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-label {
    display: block;
    grid-column: 1;
    grid-row: 1;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    line-height: 1.25;
  }

  .pl-label-sub {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #999;
    line-height: 1.2;
  }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-cell > .pl-v,
  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-price-now,
  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-price-was,
  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-lease-now,
  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-lease-terms,
  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-fee-line {
    grid-column: 2;
    text-align: right;
  }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-lease-terms-same { display: block; }

  /* A label with an empty value is just noise on a card. */
  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-cell:has(> .pl-v:empty) { display: none; }

  .compare-extra-section .pl-grid:not(.pl-matrix) .pl-row > .pl-cell:nth-last-child(2) {
    border-bottom: none;
  }

  /* Category name (non-car groups) */
  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-mdlname {
    display: block;
    text-align: left;
    font-weight: 700;
  }

  /* Name + thumb — the card header */
  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-name {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    text-align: left;
    border-bottom: 2px solid #f1f1f1;
    padding: 8px 0 12px;
    margin-bottom: 2px;
  }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-name-text { font-size: 16px; font-weight: 700; }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-thumb { width: 84px; max-height: 56px; }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-cell.pl-spec {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 12px 8px 0;
    border-bottom: none;
    text-align: left;
  }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-cell.pl-spec + .pl-cell:not(.pl-spec) {
    border-top: 1px solid #f1f1f1;
  }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-cell.pl-spec .pl-label {
    font-size: 11px;
    font-weight: 500;
  }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-cell.pl-spec > .pl-v {
    text-align: left;
    font-weight: 600;
    overflow-wrap: anywhere;
    margin-top: auto;
  }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-fee-line { white-space: normal; }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-cell.pl-fee:not(:has(.pl-fee-line)) { display: none; }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-cta {
    display: block;
    padding: 12px 0 0;
    border-bottom: none;
  }

  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-cta .red,
  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-cta .cta-button,
  .pl-grid:not(.pl-compare):not(.pl-matrix) .pl-cta .pl-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 9px 10px;
    white-space: normal !important;
    height: auto !important;
    min-height: 0;
  }
}

/* ==========================================================================
   Mobile (≤1020px) — matrix mode (.pl-matrix, toggled via pricelist.js)
   Transposed per model group: the header cells (incl. .pl-head-sub units)
   become a frozen left label column, variants become swipeable columns.
   Mirrors the compare module transpose (compare.css) — kept separate so the
   compare page stays untouched. Requires --pl-count (cells per row) and one
   .pl-grid per group. No ::before/::after on the grid: with the rows on
   display:contents they would become grid items and corrupt the column flow.
   ========================================================================== */
@media screen and (max-width: 1020px) {
  .pl-grid.pl-matrix {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(var(--pl-count, 1), auto);
    grid-template-columns: var(--pl-mx-label, min(9.5em, 38vw));
    grid-auto-columns: minmax(150px, 1fr);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .pl-scroll .pl-grid.pl-matrix { margin-bottom: 20px; }

  /* Per-group shadow anchor: the matrix scrolls itself, so the right-edge
     "more to scroll" cue can't live on the page-level .pl-scroll-wrap (it
     spans all groups) nor on the grid (::before/::after would become grid
     items). pricelist.js mirrors pl-show-* onto this wrapper. */
  .pl-mxwrap { position: relative; }

  .pl-mxwrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 28px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 4;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0));
  }

  .pl-mxwrap.pl-show-right::after { opacity: 1; }

  .pl-matrix .pl-head,
  .pl-matrix .pl-row { display: contents; }

  .pl-matrix .pl-cell,
  .pl-matrix .pl-head-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
    padding: 10px 12px;
    min-width: 0;
    box-sizing: border-box;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #f1f1f1;
  }

  .pl-matrix .pl-head-cell {
    position: sticky;
    left: 0;
    z-index: 2;
    align-items: flex-start;
    text-align: left;
    background: var(--secondary, #000);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-bottom-color: rgba(255, 255, 255, 0.12);
    overflow-wrap: break-word;
  }

  .pl-matrix.pl-show-left .pl-head-cell {
    box-shadow: 7px 0 8px -4px rgba(0, 0, 0, 0.4);
  }

  .pl-matrix .pl-head-sub { color: rgba(255, 255, 255, 0.75); }

  .pl-matrix .pl-name {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    background: #fff;
    border-bottom: 2px solid #e5e5e5;
    margin-bottom: 0;
  }

  .pl-matrix .pl-name .pl-thumb { width: 90px; max-height: 54px; }
  .pl-matrix .pl-name-text { font-size: 13px; font-weight: 700; }

  .pl-matrix .pl-head-name { border-bottom: 2px solid rgba(255, 255, 255, 0.12); }

  .pl-matrix .pl-cta {
    padding: 8px;
    border-bottom: none;
  }

  /* Defeat compare.css's absolutely-positioned remove-X (extra tables on the
     compare page): with display:contents rows the cell would escape to the
     wrapper corner. Same specificity, later stylesheet wins. */
  .pl-grid.pl-matrix .pl-cell.pl-cta:has(.pl-remove) {
    position: static;
    width: auto;
    padding: 8px;
  }

  .pl-grid.pl-matrix .pl-row:has(.pl-remove) .pl-name { padding-right: 12px; }

  .pl-matrix .pl-cta .red,
  .pl-matrix .pl-cta .cta-button,
  .pl-matrix .pl-cta .pl-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 8px 10px;
    font-size: 12px;
    line-height: normal;
    white-space: normal !important;
    height: auto !important;
    min-height: 0;
    text-align: center;
  }
}

/* ==========================================================================
   Pricelist toolbar: name search (all widths) + card/matrix view toggle
   (mobile only). .pl-view-toggle also appears bare (no .pl-tools) on the
   compare page's extra sections.
   ========================================================================== */
.pl-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.pl-tools .pl-view-toggle { margin: 0; }

.pl-search {
  position: relative;
  flex: 0 1 320px;
  min-width: 0;
}

.pl-search[hidden] { display: none; }

/* Model multi-picker — a select-look button opening a checkbox panel
   (a native <select multiple> is unusable: ctrl-click listbox on desktop).
   Options are filled client-side (pricelist.js) from the rendered group
   headers, so it lists whatever this site sells (car models, mower
   families, marine categories, …). Empty selection = show all. */
.pl-msel-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  margin: 0;
  box-sizing: border-box;
  border: 1px solid #d9d9de;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: #333;
  text-align: left;
  cursor: pointer;
}

.pl-msel-btn:focus { outline: none; border-color: #9b9ba1; }
.pl-msel-btn.has-sel { border-color: #9b9ba1; }

.pl-msel-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pl-msel-caret {
  flex: 0 0 auto;
  width: 12px;
  height: 8px;
  fill: none;
  stroke: #999;
  stroke-width: 2;
}

.pl-msel-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid #d9d9de;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  box-sizing: border-box;
}

.pl-msel-panel[hidden] { display: none; }

.pl-msel-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  margin: 0;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  text-align: left;
  cursor: pointer;
}

.pl-msel-opt:hover { background: #f4f4f6; }

.pl-msel-opt input {
  flex: 0 0 auto;
  margin: 0;
  width: auto;
  height: auto;
  accent-color: var(--secondary, #333);
}

.pl-view-toggle { display: none; }

/* Flat icon pair, matching the shop list/grid .view-switcher look. */
@media screen and (max-width: 1020px) {
  .pl-view-toggle {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin: 0 0 12px;
  }

  .pl-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    margin: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    line-height: 0;
  }

  .pl-view-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: #c9c5c5;
  }

  .pl-view-btn:hover svg,
  .pl-view-btn.is-active svg { fill: #796f6e; }
}

/* Model-picker filter (pricelist.js). !important: in matrix mode the rows are
   display:contents, and hidden groups/wraps must vanish in every view.
   .pricelist-header rides along on the Honda categories pages, where each
   section's heading is a sibling of its scroller. */
.pl-row.pl-srch-hide,
.pl-mxwrap.pl-srch-hide,
.pl-scroll-wrap.pl-srch-hide,
.pricelist-header.pl-srch-hide {
  display: none !important;
}

body.hc .pl-grid,
body.hc .pl-head,
body.hc .pl-row {
  background: #000 !important;
  color: #ff0 !important;
  border-color: #ff0 !important;
}

body.hc .pl-row:hover { background: #000 !important; }

body.hc .pl-head-sub,
body.hc .pl-price-now,
body.hc .pl-price-was,
body.hc .pl-lease-now,
body.hc .pl-lease-terms,
body.hc .pl-fee,
body.hc .pl-label,
body.hc .pl-label-sub {
  color: #ff0 !important;
}

@media screen and (max-width: 1020px) {
  body.hc .pl-row { border: 1px solid #ff0 !important; }
  body.hc .pl-cell { border-bottom-color: #ff0 !important; }
  body.hc .pl-view-btn svg { fill: #ff0 !important; }
}
