/* Friendly Powersports — ClearPrice-style price card.
   Shared styles for VDP and SRP variants. */

.fps-price-card,
.fps-why-modal {
  --fps-pc-bg: #fff;
  --fps-pc-text: var(--off-black, #111);
  --fps-pc-muted: #6b6b6b;
  --fps-pc-border: rgba(0, 0, 0, 0.08);
  --fps-pc-divider: rgba(0, 0, 0, 0.08);
  --fps-pc-credit: #1f7a3a;
  --fps-pc-allin-bg: #e6f4ea;
  --fps-pc-allin-fg: #1f7a3a;
  --fps-pc-clearance-bg: #fff4d6;
  --fps-pc-clearance-fg: #8a6300;
}

.fps-price-card {
  background: var(--fps-pc-bg);
  color: var(--fps-pc-text);
  border-radius: 12px;
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  line-height: 1.4;
}

/* ---------- header ---------- */

.fps-price-card__head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label  amount"
    "plus   amount";
  align-items: baseline;
  column-gap: 12px;
}

.fps-price-card__label {
  grid-area: label;
  font-weight: 600;
  font-size: 14px;
  color: var(--fps-pc-text);
}

.fps-price-card__plus {
  grid-area: plus;
  font-size: 12px;
  color: var(--fps-pc-muted);
}

.fps-price-card__amount {
  grid-area: amount;
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-align: right;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.fps-price-card__strike {
  font-size: 14px;
  font-weight: 500;
  color: var(--fps-pc-muted);
  text-decoration: line-through;
}

.fps-price-card__final {
  font-size: 28px;
  font-weight: 700;
  color: var(--fps-pc-text);
  letter-spacing: -0.01em;
}

/* ---------- pill (All-in / Manager / Clearance) ---------- */
/* Self-contained — colors defined directly so the component renders the
   same regardless of which container it lives in (.fps-price-card on VDP,
   .inv-card-pill on SRP). */

.fps-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  width: max-content;
  max-width: 100%;
  text-decoration: none;
}

.fps-pill__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.fps-pill__text {
  white-space: normal;
}

.fps-pill--allin {
  background: #e6f4ea;
  color: #1f7a3a;
}

.fps-pill--manager {
  background: #e6f4ea;
  color: #1f7a3a;
}

.fps-pill--clearance {
  background: #fff4d6;
  color: #8a6300;
}

/* SRP top-of-card: pill sits at the top-left of the card on a white
   background. The bottom padding gives the pill some breathing room
   from the unit image directly below it. Collapses to zero height
   when no special-status pill is rendered. */
.inv-card-pill {
  padding: 14px 18px 10px;
  margin: 0;
}

.inv-card-pill:empty {
  display: none;
}

.fps-pill--compact {
  font-size: 12px;
  padding: 5px 10px;
}

/* ---------- accordion ---------- */
/* The summary itself is the bordered "button" (matches mock). The body
   expands below it without an outer box. */

.fps-friendly-way {
  margin-top: 4px;
}

.fps-friendly-way__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color 0.15s, border-color 0.15s, border-radius 0.15s;
}

.fps-friendly-way__summary:hover {
  background: #ececee;
  border-color: #d4d4d8;
}

.fps-friendly-way[open] .fps-friendly-way__summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: #e4e4e7;
}

.fps-friendly-way__summary::-webkit-details-marker { display: none; }
.fps-friendly-way__summary::marker                 { display: none; content: ''; }

.fps-friendly-way__title strong {
  font-weight: 700;
  font-size: 15px;
  display: block;
}

.fps-friendly-way__title span {
  font-weight: 500;
  font-size: 12px;
  color: var(--fps-pc-muted);
  display: block;
  margin-top: 2px;
}

.fps-friendly-way__chevron {
  width: 12px;
  height: 8px;
  color: var(--fps-pc-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.fps-friendly-way[open] .fps-friendly-way__chevron {
  transform: rotate(180deg);
}

.fps-friendly-way__body {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-top: 0;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* ---------- breakdown ---------- */

.fps-breakdown {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fps-breakdown__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.fps-breakdown__row dt,
.fps-breakdown__row dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.fps-breakdown__row dt {
  color: var(--fps-pc-text);
}

.fps-breakdown__row dd {
  color: var(--fps-pc-text);
  text-align: right;
}

.fps-breakdown__row--credit dt,
.fps-breakdown__row--credit dd {
  color: var(--fps-pc-credit);
  font-weight: 600;
}

.fps-breakdown__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--fps-pc-divider);
  margin-top: 4px;
  font-weight: 700;
  font-size: 15px;
}

.fps-breakdown__total-label,
.fps-breakdown__total-amount {
  font-weight: 700;
}

/* "Plus tax, title & registration" callout shown inside the accordion
   body on both VDP and SRP — sits directly under the Friendly-price
   total row. */
.fps-breakdown__plus {
  font-size: 12px;
  color: var(--fps-pc-muted);
  margin-top: 2px;
  text-align: right;
}

/* ---------- "why" link ---------- */

.fps-why-link,
.fps-why-link:hover,
.fps-why-link:focus,
.fps-why-link:focus-visible,
.fps-why-link:active {
  appearance: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 8px 0 0;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent, #cf1e27);
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
  outline: none;
}

.fps-why-link:hover,
.fps-why-link:focus-visible {
  color: var(--fps-pc-text);
}

.fps-why-link:focus-visible {
  outline: 2px solid var(--accent, #cf1e27);
  outline-offset: 2px;
}

/* Belt-and-suspenders override for the parent theme's main/footer
   "a -> dotted bottom border" inline rule. The .text-decoration-none
   class on each <a> uses the rule's own escape hatch; this CSS rule
   covers any link nested inside our components that we missed. */
.fps-price-card a,
.fps-why-modal a,
.inv-card-image-link,
.inv-card-titles,
.vdp-cta-phone {
  border-bottom: 0;
}

/* ---------- modal ---------- */

.fps-why-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
}

.fps-why-modal[aria-hidden="false"] {
  display: flex;
}

.fps-why-modal__panel {
  background: #fff;
  color: var(--fps-pc-text);
  border-radius: 12px;
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 36px 36px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.fps-why-modal__close,
.fps-why-modal__close:hover,
.fps-why-modal__close:focus,
.fps-why-modal__close:focus-visible,
.fps-why-modal__close:active {
  position: absolute;
  top: 14px;
  right: 14px;
  appearance: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--fps-pc-muted);
  padding: 6px;
  outline: none;
}

.fps-why-modal__close:hover,
.fps-why-modal__close:focus-visible {
  color: var(--fps-pc-text);
}

.fps-why-modal h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent, #cf1e27);
}

.fps-why-modal h3 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.fps-why-modal p {
  margin: 0 0 24px;
  color: var(--fps-pc-muted);
  font-size: 15px;
  line-height: 1.5;
}

.fps-why-modal__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  border: 1px solid var(--fps-pc-divider);
}

.fps-why-modal__table th,
.fps-why-modal__table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--fps-pc-divider);
}

.fps-why-modal__table thead th {
  font-weight: 700;
  background: #fafafa;
  border-bottom: 2px solid var(--fps-pc-divider);
  white-space: nowrap;
}

.fps-why-modal__table tbody tr th[scope="row"],
.fps-why-modal__table tfoot tr th[scope="row"] {
  font-weight: 600;
  color: var(--fps-pc-text);
}

.fps-why-modal__table .fps-why-modal__col-friendly {
  background: var(--fps-pc-allin-bg);
  color: var(--fps-pc-allin-fg);
}

.fps-why-modal__table tfoot th[scope="row"],
.fps-why-modal__table tfoot td {
  font-weight: 700;
  font-size: 17px;
  background: #fafafa;
  border-top: 2px solid var(--fps-pc-divider);
}

.fps-why-modal__table tfoot .fps-why-modal__col-friendly {
  background: var(--fps-pc-allin-bg);
}

/* ---- Modal responsive ---- */

/* Tablet: trim padding/fonts but keep the 3-column comparison intact. */
@media (max-width: 768px) {
  .fps-why-modal {
    padding: 14px;
  }

  .fps-why-modal__panel {
    padding: 24px 22px 28px;
    border-radius: 10px;
  }

  .fps-why-modal h2 {
    font-size: 14px;
    letter-spacing: 0.05em;
  }

  .fps-why-modal h3 {
    font-size: 20px;
  }

  .fps-why-modal p {
    font-size: 14px;
    margin-bottom: 18px;
  }

  .fps-why-modal__table,
  .fps-why-modal__table th,
  .fps-why-modal__table td {
    font-size: 14px;
  }

  .fps-why-modal__table th,
  .fps-why-modal__table td {
    padding: 10px 12px;
  }

  .fps-why-modal__table tfoot th[scope="row"],
  .fps-why-modal__table tfoot td {
    font-size: 15px;
  }

  .fps-why-modal__close {
    top: 8px;
    right: 8px;
  }
}

/* Phone: stack each row as its own card with data-label column hints.
   Side-by-side comparison breaks down at this width  the row-card form
   keeps both the Friendly value and the dealer value comparable but
   labeled. */
@media (max-width: 560px) {
  .fps-why-modal__panel {
    padding: 22px 16px 24px;
  }

  .fps-why-modal h3 {
    font-size: 18px;
  }

  .fps-why-modal__table {
    border: 0;
    font-size: 14px;
  }

  .fps-why-modal__table thead {
    display: none;
  }

  .fps-why-modal__table,
  .fps-why-modal__table tbody,
  .fps-why-modal__table tfoot,
  .fps-why-modal__table tr {
    display: block;
  }

  .fps-why-modal__table tr {
    border: 1px solid var(--fps-pc-divider);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
  }

  .fps-why-modal__table th[scope="row"] {
    display: block;
    width: 100%;
    background: #fafafa;
    padding: 10px 14px;
    font-weight: 700;
    text-align: left;
    border-bottom: 1px solid var(--fps-pc-divider);
    border-top: 0;
  }

  .fps-why-modal__table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--fps-pc-divider);
    text-align: right;
  }

  .fps-why-modal__table td:last-child {
    border-bottom: 0;
  }

  .fps-why-modal__table td::before {
    content: attr(data-label);
    color: var(--fps-pc-muted);
    font-weight: 500;
    text-align: left;
    flex: 0 0 auto;
  }

  .fps-why-modal__table .fps-why-modal__col-friendly {
    background: var(--fps-pc-allin-bg);
  }

  .fps-why-modal__table tfoot tr {
    border-color: rgba(0, 0, 0, 0.18);
  }

  .fps-why-modal__table tfoot th[scope="row"] {
    background: #fafafa;
  }

  .fps-why-modal__table tfoot td {
    font-weight: 700;
    font-size: 15px;
  }
}

/* ---------- VDP-specific tweaks ---------- */

.fps-price-card--vdp {
  border: 1px solid var(--fps-pc-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* VDP head: stacked layout (label / large price / plus-tax line) instead
   of the side-by-side row used on SRP. Matches image-1 mock. */
.fps-price-card--vdp .fps-price-card__head {
  display: block;
}

.fps-price-card--vdp .fps-price-card__label {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.fps-price-card--vdp .fps-price-card__amount {
  justify-content: flex-start;
  text-align: left;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 12px;
}

.fps-price-card--vdp .fps-price-card__final {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.fps-price-card--vdp .fps-price-card__strike {
  font-size: 18px;
  font-weight: 500;
}

.fps-price-card--vdp .fps-price-card__plus {
  font-size: 13px;
  font-weight: 400;
  color: #8a8a8a;
}

/* Slightly more generous typography on VDP — the price card has more
   real estate than its SRP counterpart. */
.fps-price-card--vdp .fps-friendly-way__title strong {
  font-size: 17px;
}

.fps-price-card--vdp .fps-friendly-way__title span {
  font-size: 13px;
  margin-top: 3px;
}

.fps-price-card--vdp .fps-breakdown {
  gap: 10px;
}

.fps-price-card--vdp .fps-breakdown__row dt,
.fps-price-card--vdp .fps-breakdown__row dd {
  font-size: 15px;
}

.fps-price-card--vdp .fps-breakdown__total {
  font-size: 17px;
  padding-top: 12px;
  margin-top: 6px;
}

.fps-price-card--vdp .fps-breakdown__total-label,
.fps-price-card--vdp .fps-breakdown__total-amount {
  font-size: 17px;
}

.fps-price-card--vdp .fps-why-link {
  font-size: 14px;
  padding-top: 12px;
}

/* VDP "Friendly Way": shares the same boxed summary + connected-body
   treatment as SRP (defined on the base .fps-friendly-way__summary /
   __body rules), just with the slightly larger typography defined
   above. A bit of top space pushes it off the price block. */
.fps-price-card--vdp .fps-friendly-way {
  margin-top: 4px;
}

/* ---------- SRP-specific tweaks ---------- */

/* SRP: card sits inside .inv-card (which already has rounded corners
   and border). Strip its own radius so the top divider is a clean
   horizontal hairline instead of curving with the corners. */
.fps-price-card--srp {
  padding: 14px 18px;
  font-size: 13px;
  border-top: 1px solid var(--fps-pc-divider);
  border-radius: 0;
}

.fps-price-card--srp .fps-price-card__final {
  font-size: 22px;
  font-weight: 600;
}

.fps-price-card--srp .fps-friendly-way__title strong {
  font-size: 14px;
}

/* ---------- mobile ---------- */

@media (max-width: 899px) {
  .fps-price-card--vdp {
    padding: 14px;
  }
  .fps-price-card--vdp .fps-price-card__final {
    font-size: 24px;
  }
}
