/* ============================================================
   Routes - Pay now / Pay later
   1. Catalog card: two fare tiles replace the single Select row
      (article.rr-cat → .rr-rates), light + navy "Top pick" cards.
   2. Plan switch (.rv-plan): vehicle drawer, /car sidebar, checkout.
      Borrows the filter-chip language already on /search:
      active = ink pill with an orange dot.
   3. Checkout "Pay later" card (.rv-later).
   Money is rendered as plain "$12.34" text nodes so routes-currency.js
   converts it like everything else.
   ============================================================ */

:root {
  --pp-ink: #101828;
  --pp-ink-soft: #3d4452;
  --pp-muted: #6b7280;
  --pp-faint: #8a91a0;
  --pp-line: rgba(16, 24, 40, 0.08);
  --pp-orange: #ff7a1a;
  --pp-orange-deep: #e56a0f;
  --pp-orange-dark: #d85f0a;
  --pp-save: #0e9f6e;
  --pp-save-ink: #067a54;
  --pp-track: #f1f3f7;
  --pp-display: "Plus Jakarta Sans", "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --pp-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------------------------------------
   1. Catalog card fare tiles
   ------------------------------------------------------------ */
article.rr-cat .rr-rates {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

article.rr-cat .rr-rate {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 11px 11px 10px;
  border: 1px solid var(--pp-line);
  border-radius: 10px;
  background: #fff;
  color: var(--pp-ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s var(--pp-ease);
}
article.rr-cat .rr-rate--now {
  border: 1.5px solid var(--pp-orange);
  background: #fffaf6;
  padding: 10.5px 10.5px 9.5px; /* keep the inner box the same size as the 1px tile */
}
article.rr-cat .rr-rate:hover {
  box-shadow: 0 10px 22px -16px rgba(16, 24, 40, 0.35);
}

article.rr-cat .rr-rate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 14px;
  gap: 6px;
}
article.rr-cat .rr-rate-name {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--pp-ink);
  white-space: nowrap;
}
article.rr-cat .rr-rate--later .rr-rate-name {
  color: var(--pp-muted);
}

/* Savings tag rides the top edge of the tile like a price sticker */
article.rr-cat .rr-rate-save {
  position: absolute;
  top: -9px;
  right: 9px;
  padding: 4px 7px 3px;
  border-radius: 999px;
  background: var(--pp-save);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 3px 8px -2px rgba(14, 159, 110, 0.55);
}

article.rr-cat .rr-rate-price {
  margin: 7px 0 0;
  font-family: var(--pp-display);
  font-size: 1.34rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--pp-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
article.rr-cat .rr-rate--now .rr-rate-price {
  color: var(--pp-orange-deep);
}
article.rr-cat .rr-rate-per {
  margin-left: 3px;
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--pp-muted);
}

article.rr-cat .rr-rate-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 3px;
  margin: 6px 0 0;
  font-size: 0.76rem;
  line-height: 1.25;
  color: var(--pp-muted);
  font-variant-numeric: tabular-nums;
}
article.rr-cat .rr-rate-total b {
  font-weight: 700;
  color: var(--pp-ink);
  letter-spacing: -0.01em;
}
article.rr-cat .rr-rate-note {
  margin: 2px 0 0;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--pp-faint);
}
article.rr-cat .rr-rate--now .rr-rate-note {
  color: var(--pp-save-ink);
}

/* Pay later switched off for this class (admin): one wide prepaid tile, button on the right. */
article.rr-cat .rr-rates--solo {
  grid-template-columns: minmax(0, 1fr);
}
article.rr-cat .rr-rates--solo .rr-rate--now {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "head  btn"
    "price btn"
    "total btn"
    "note  btn";
  align-items: center;
  column-gap: 14px;
}
article.rr-cat .rr-rates--solo .rr-rate-head {
  grid-area: head;
  justify-content: flex-start;
  gap: 8px;
}
article.rr-cat .rr-rates--solo .rr-rate-price { grid-area: price; }
article.rr-cat .rr-rates--solo .rr-rate-total { grid-area: total; }
article.rr-cat .rr-rates--solo .rr-rate-note { grid-area: note; }
article.rr-cat .rr-rates--solo .rr-rate-btn {
  grid-area: btn;
  width: auto;
  min-width: 132px;
  height: 40px;
  margin-top: 0;
  padding: 0 18px;
}

article.rr-cat .rr-rate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  margin-top: 10px;
  padding: 0 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: -0.005em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    transform 0.18s var(--pp-ease), box-shadow 0.18s ease;
}
article.rr-cat .rr-rate--now .rr-rate-btn {
  border: 0;
  background: var(--pp-orange);
  color: #fff;
  box-shadow: 0 8px 18px -12px rgba(255, 122, 26, 0.9);
}
article.rr-cat .rr-rate--now .rr-rate-btn:hover {
  background: var(--pp-orange-deep);
}
article.rr-cat .rr-rate--later .rr-rate-btn {
  border: 1.5px solid var(--pp-ink);
  background: transparent;
  color: var(--pp-ink);
}
article.rr-cat .rr-rate--later .rr-rate-btn:hover {
  background: var(--pp-ink);
  color: #fff;
}
article.rr-cat .rr-rate-btn:active {
  transform: translateY(1px);
}
article.rr-cat .rr-rate-btn:focus-visible {
  outline: 2px solid var(--pp-orange);
  outline-offset: 2px;
}

article.rr-cat .rr-rates-foot {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 0.64rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--pp-faint);
}

/* Navy "Top pick" card */
article.rr-cat.rr-cat-dark .rr-rate {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}
article.rr-cat.rr-cat-dark .rr-rate--now {
  border-color: var(--pp-orange);
  background: rgba(255, 122, 26, 0.1);
}
article.rr-cat.rr-cat-dark .rr-rate:hover {
  box-shadow: 0 14px 28px -18px rgba(0, 0, 0, 0.7);
}
article.rr-cat.rr-cat-dark .rr-rate-name {
  color: #fff;
}
article.rr-cat.rr-cat-dark .rr-rate--later .rr-rate-name {
  color: rgba(255, 255, 255, 0.62);
}
article.rr-cat.rr-cat-dark .rr-rate-price {
  color: #fff;
}
article.rr-cat.rr-cat-dark .rr-rate--now .rr-rate-price {
  color: #ff9440;
}
article.rr-cat.rr-cat-dark .rr-rate-per,
article.rr-cat.rr-cat-dark .rr-rate-total,
article.rr-cat.rr-cat-dark .rr-rate-note {
  color: rgba(255, 255, 255, 0.62);
}
article.rr-cat.rr-cat-dark .rr-rate--now .rr-rate-note {
  color: #6fe0b3;
}
article.rr-cat.rr-cat-dark .rr-rate-total b {
  color: #fff;
}
article.rr-cat.rr-cat-dark .rr-rate--later .rr-rate-btn {
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
}
article.rr-cat.rr-cat-dark .rr-rate--later .rr-rate-btn:hover {
  background: #fff;
  border-color: #fff;
  color: var(--pp-ink);
}
article.rr-cat.rr-cat-dark .rr-rates-foot {
  color: rgba(255, 255, 255, 0.5);
}

/* Unavailable cars: tiles dim with the card, no hover lift */
article.rr-cat.opacity-70 .rr-rate:hover {
  box-shadow: none;
}

/* ------------------------------------------------------------
   2. Plan switch (drawer, /car sidebar, checkout)
   ------------------------------------------------------------ */
.rv-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px;
  padding: 4px;
  border-radius: 13px;
  background: var(--pp-track);
  border: 1px solid rgba(16, 24, 40, 0.06);
  box-shadow: inset 0 1px 0 #fff;
}
.rv-plan--stacked {
  grid-template-columns: minmax(0, 1fr);
}
/* Spacing lives here: the Tailwind build is purged, so mb-* may not exist. */
.rv-plan.mb-2 { margin-bottom: 0.55rem; }
.rv-plan.mb-3 { margin-bottom: 0.85rem; }
.rv-plan.mb-5 { margin-bottom: 1.15rem; }

/* Drawer footer: the plan label lengthens the meta line on phones - keep the
   per-day tag from wrapping. */
[role="dialog"] .price-tag {
  flex: none;
  white-space: nowrap;
}

.rv-plan-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 12px 9px 11px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #444b5a;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 0 0 1px rgba(16, 24, 40, 0.05);
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease,
    transform 0.18s var(--pp-ease);
}
.rv-plan-opt:hover {
  color: var(--pp-ink);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px rgba(16, 24, 40, 0.4), 0 0 0 1px rgba(16, 24, 40, 0.1);
}
.rv-plan-opt:active {
  transform: translateY(0) scale(0.985);
}
.rv-plan-opt:focus-visible {
  outline: 2px solid var(--pp-orange);
  outline-offset: 2px;
}
.rv-plan-opt.is-on {
  background: #0e1116;
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(14, 17, 22, 0.75);
}
.rv-plan-opt.is-on:hover {
  transform: none;
  color: #fff;
}

.rv-plan-dot {
  flex: none;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  border: 1.5px solid #c3c8d2;
  background: transparent;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}
.rv-plan-opt.is-on .rv-plan-dot {
  border-color: var(--pp-orange);
  background: var(--pp-orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.28);
}

.rv-plan-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.rv-plan-text b {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.rv-plan-text small {
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--pp-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.rv-plan-opt.is-on .rv-plan-text small {
  color: rgba(255, 255, 255, 0.68);
}
/* Savings line on the Pay now option */
.rv-plan-opt:first-child .rv-plan-text small {
  color: var(--pp-save-ink);
}
.rv-plan-opt:first-child.is-on .rv-plan-text small {
  color: #6fe0b3;
}

/* Stacked (sidebar) rows: room for the label, saving on the right */
.rv-plan--stacked .rv-plan-opt {
  padding: 10px 13px 10px 12px;
}
.rv-plan--stacked .rv-plan-text {
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  flex: 1;
  gap: 10px;
}
.rv-plan--stacked .rv-plan-text small {
  margin-top: 0;
  font-size: 0.74rem;
}

/* ------------------------------------------------------------
   3. Checkout: Pay later card
   ------------------------------------------------------------ */
.rv-later {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--pp-line);
  border-radius: 16px;
  background: #fff;
}
.rv-later-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--pp-track);
  color: var(--pp-ink-soft);
}
.rv-later-body {
  flex: 1;
  min-width: 0;
}
.rv-later-title {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pp-ink);
}
.rv-later-sub {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--pp-muted);
}
.rv-later-sub b {
  font-weight: 700;
  color: var(--pp-ink);
}
.rv-later-amt {
  flex: none;
  margin: 0 0 0 auto;
  text-align: right;
  font-family: var(--pp-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--pp-ink);
  font-variant-numeric: tabular-nums;
}
.rv-later-amt small {
  display: block;
  margin-top: 5px;
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pp-faint);
}
@media (max-width: 480px) {
  .rv-later {
    flex-wrap: wrap;
  }
  .rv-later-amt {
    width: 100%;
    margin-top: 4px;
    text-align: left;
  }
  .rv-later-amt small {
    display: inline;
    margin-left: 6px;
  }
}

/* ------------------------------------------------------------
   Responsive tuning for the card tiles
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  article.rr-cat .rr-rates {
    gap: 10px;
  }
  article.rr-cat .rr-rate {
    padding: 12px 12px 11px;
  }
  article.rr-cat .rr-rate--now {
    padding: 11.5px 11.5px 10.5px;
  }
  article.rr-cat .rr-rate-price {
    font-size: 1.45rem;
  }
  article.rr-cat .rr-rate-btn {
    height: 40px;
    font-size: 0.86rem;
  }
}
@media (min-width: 1400px) and (max-width: 1520px) {
  article.rr-cat .rr-rate-price {
    font-size: 1.24rem;
  }
  article.rr-cat .rr-rate {
    padding: 10px 10px 9px;
  }
  article.rr-cat .rr-rate--now {
    padding: 9.5px 9.5px 8.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  article.rr-cat .rr-rate,
  article.rr-cat .rr-rate-btn,
  .rv-plan-opt,
  .rv-plan-dot {
    transition: none !important;
  }
}
