/* ============================================================
   Routes — Premium vehicle catalog (/search)
   Correction pass v3: top-right diagonal TOP PICK ribbon,
   no AVAILABLE over cars, tight media (no flex-grow gap),
   strong price hierarchy, dark/light one structure.
   Scoped to the SPA catalog (article.rr-cat + results grid).
   ============================================================ */

:root {
  --rcat-radius: 14px;
  --rcat-pad: 20px;
  --rcat-gap: 18px;
  --rcat-light: #e4e7ec;
  --rcat-border: rgba(16, 24, 40, 0.06);
  --rcat-shadow: 0 10px 24px -16px rgba(16, 24, 40, 0.18);
  --rcat-shadow-hover: 0 16px 34px -16px rgba(16, 24, 40, 0.26);
  --rcat-dark-a: #12283a;
  --rcat-dark-b: #0b1926;
  --rcat-ink: #101828;
  --rcat-muted: #6b7280;
  --rcat-chip-bg: #e9ebef;
  --rcat-chip-ink: #3d4452;
  --rcat-brand: #ff7a1a;
  --rcat-brand-hover: #e56a0f;
  --rcat-select: var(--rcat-brand);
  --rcat-select-hover: var(--rcat-brand-hover);
  --rcat-badge: var(--rcat-brand);
  --rcat-price-light: #e56a0f; /* deepened brand orange so big price text reads on grey */
  --rcat-price-dark: #ff7a1a;
}

/* ---------- Results grid: 4 wide / 3 desktop / 2 tablet / 1 mobile ---------- */
#root .grid.sm\:grid-cols-2.lg\:grid-cols-3.\32xl\:grid-cols-4 {
  gap: var(--rcat-gap);
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 640px) and (max-width: 1279px) {
  #root .grid.sm\:grid-cols-2.lg\:grid-cols-3.\32xl\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1280px) and (max-width: 1399px) {
  #root .grid.sm\:grid-cols-2.lg\:grid-cols-3.\32xl\:grid-cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1400px) {
  #root .grid.sm\:grid-cols-2.lg\:grid-cols-3.\32xl\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- Card shell: one surface, same structure for all cards ---------- */
article.rr-cat {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: var(--rcat-pad);
  border: 1px solid var(--rcat-border);
  border-radius: var(--rcat-radius);
  background: var(--rcat-light);
  box-shadow: var(--rcat-shadow);
  color: var(--rcat-ink);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
article.rr-cat:hover {
  transform: translateY(-2px);
  box-shadow: var(--rcat-shadow-hover);
}

/* Dark recommended card: identical structure, navy theme only */
article.rr-cat.rr-cat-dark {
  border-color: rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, var(--rcat-dark-a) 0%, var(--rcat-dark-b) 100%);
  color: #fff;
  box-shadow: 0 14px 32px -16px rgba(9, 23, 34, 0.5);
}

/* ---------- TOP PICK: top-right diagonal corner ribbon ---------- */
.rr-cat-badge {
  position: absolute;
  top: 14px;
  right: -34px;
  z-index: 6;
  width: 118px;
  margin: 0;
  padding: 7px 0;
  border-radius: 0;
  background: var(--rcat-badge);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(45deg);
  box-shadow: 0 4px 12px rgba(232, 101, 15, 0.35);
  pointer-events: none;
}
article.rr-cat.rr-cat-dark .rr-cat-badge {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* ---------- Header: category + model ---------- */
.rr-cat-head {
  padding: 0;
  margin: 0;
  padding-right: 2.25rem; /* clear diagonal ribbon */
}
.rr-cat-title {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--rcat-ink);
}
article.rr-cat.rr-cat-dark .rr-cat-title {
  color: #fff;
}
.rr-cat-sub {
  margin: 6px 0 0;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rcat-ink);
}
.rr-cat-sub em {
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  opacity: 0.78;
}
article.rr-cat.rr-cat-dark .rr-cat-sub {
  color: rgba(255, 255, 255, 0.88);
}
article.rr-cat.rr-cat-dark .rr-cat-sub em {
  opacity: 0.72;
}

/* ---------- Spec chips: uniform, compact ---------- */
.rr-cat-specs {
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.rr-cat-spec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--rcat-chip-bg);
  color: var(--rcat-chip-ink);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.rr-cat-spec svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  opacity: 0.85;
}
article.rr-cat.rr-cat-dark .rr-cat-spec {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
}

/* ---------- Image area: tight under specs (no flex-grow gap) ---------- */
.rr-cat-media {
  position: relative;
  display: flex;
  flex: 0 0 auto; /* do NOT absorb row slack — that created the big gap */
  align-items: flex-end;
  justify-content: center;
  height: 168px;
  min-height: 168px;
  margin: 8px 0 0;
  padding: 0;
  background: transparent;
  overflow: visible;
  aspect-ratio: auto !important; /* override SPA aspect-[16/10] that inflated height */
}
@media (min-width: 1280px) {
  .rr-cat-media { height: 180px; min-height: 180px; }
}
.rr-cat-img {
  display: block;
  width: 92%;
  max-width: 380px;
  max-height: 158px;
  object-fit: contain;
  object-position: center bottom;
  background: transparent !important;
  filter: drop-shadow(0 14px 10px rgba(0, 0, 0, 0.16));
}
@media (min-width: 1280px) {
  .rr-cat-img { max-height: 170px; }
}
article.rr-cat.rr-cat-dark .rr-cat-img {
  filter: drop-shadow(0 16px 14px rgba(0, 0, 0, 0.42));
}
/* Neutralize the SPA's aggressive hover zoom */
article.rr-cat .group-hover\:scale-\[1\.04\] {
  transition: transform 0.3s ease;
}
article.rr-cat:hover .group-hover\:scale-\[1\.04\] {
  transform: scale(1.02);
}

/* Hide image-corner clutter actions (save/compare) on catalog cards */
.rr-cat-media .absolute.right-4 {
  display: none;
}

/* Low-stock / sold-out status (Available is removed in markup): top-right,
   off the car's roofline, small and quiet — tucked under ribbon */
.rr-cat-media .absolute.bottom-3.left-5 {
  top: 0;
  right: 0;
  bottom: auto;
  left: auto;
}
.rr-cat-media .absolute.bottom-3.left-5 span {
  font-size: 0.64rem;
  letter-spacing: 0.06em;
}

/* ---------- Footer: daily+Select row / divider / total ---------- */
.rr-cat-foot {
  margin-top: auto; /* leftover row height sits below the car, not above it */
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
/* Flatten the inner price wrapper so its children join the foot flex flow:
   [strike?] [daily] [select] / [divider] / [total] */
.rr-cat-foot > div {
  display: contents;
}
.rr-cat-foot::before {
  content: "";
  order: 3;
  flex: 1 0 100%;
  height: 1px;
  margin: 12px 0 10px;
  background: rgba(16, 24, 40, 0.08);
}
article.rr-cat.rr-cat-dark .rr-cat-foot::before {
  background: rgba(255, 255, 255, 0.14);
}

/* Deal strike-through sits above the daily price on its own line */
.rr-cat-foot .text-ink-muted.line-through {
  order: 0;
  flex: 1 0 100%;
  margin: 0 0 2px;
  font-size: 0.75rem;
  color: var(--rcat-muted) !important;
}
article.rr-cat.rr-cat-dark .rr-cat-foot .text-ink-muted.line-through {
  color: rgba(255, 255, 255, 0.5) !important;
}

.rr-cat-price {
  order: 1;
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--rcat-price-light) !important;
}
article.rr-cat.rr-cat-dark .rr-cat-price {
  color: var(--rcat-price-dark) !important;
}
.rr-cat-perday {
  margin-left: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rcat-muted);
}
article.rr-cat.rr-cat-dark .rr-cat-perday {
  color: rgba(255, 255, 255, 0.65);
}

.rr-cat-total {
  order: 4;
  flex: 1 0 100%;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--rcat-ink) !important;
}
.rr-cat-total b {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.rr-cat-total .rr-cat-total-days {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--rcat-muted);
}
.rr-cat-total .rr-cat-total-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--rcat-muted);
}
article.rr-cat.rr-cat-dark .rr-cat-total {
  color: #fff !important;
}
article.rr-cat.rr-cat-dark .rr-cat-total-days {
  color: rgba(255, 255, 255, 0.65);
}
article.rr-cat.rr-cat-dark .rr-cat-total-sub {
  color: rgba(255, 255, 255, 0.65);
}

/* ---------- Select button ---------- */
.rr-cat-select {
  order: 2;
  margin-left: auto;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  height: 46px;
  min-width: 116px;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 8px;
  background: var(--rcat-select);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
.rr-cat-select:hover {
  background: var(--rcat-select-hover);
}
.rr-cat-select:active {
  transform: translateY(1px);
}
.rr-cat-select:focus-visible {
  outline: 2px solid var(--rcat-select);
  outline-offset: 2px;
}
article.rr-cat.rr-cat-dark .rr-cat-select {
  box-shadow: 0 10px 22px -10px rgba(255, 122, 26, 0.55);
}

/* ---------- Keep card children above any effects ---------- */
article.rr-cat > *:not(.rr-cat-badge) {
  position: relative;
  z-index: 1;
}

/* ---------- Unavailable vehicles ---------- */
article.rr-cat.opacity-70 {
  opacity: 0.65;
}
article.rr-cat.grayscale .rr-cat-img {
  filter: grayscale(1) drop-shadow(0 12px 10px rgba(15, 23, 34, 0.14));
}

/* ---------- Sticky filter bar: minor visual polish only ---------- */
#root .sticky.z-30.bg-surface\/85 {
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
}

/* ---------- Compact search title band ("Which ride moves you?") ----------
   Keep the original dark ink look (stripe + counter); only reduce height.
   IMPORTANT: exclude [data-rv="hero"] — the home hero also uses bg-ink + h1.type-hero,
   and a `background:` shorthand here was wiping its photo to solid black. */
#root main section.bg-ink:has(h1.type-hero):not([data-rv="hero"]),
#root main section.bg-ink.rha:has(h1.type-hero):not([data-rv="hero"]) {
  min-height: 0 !important;
  background-color: #0e1116 !important;
  background-image: none !important;
  color: #fff !important;
}
#root main section.bg-ink:has(h1.type-hero) > .relative.mx-auto {
  gap: 0.75rem !important;
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}
@media (min-width: 1024px) {
  #root main section.bg-ink:has(h1.type-hero) > .relative.mx-auto {
    padding-top: 1.15rem !important;
    padding-bottom: 1.15rem !important;
  }
}
#root main section.bg-ink:has(h1.type-hero) h1.type-hero,
#root main section.bg-ink:has(h1.type-hero) .type-hero {
  font-size: clamp(1.65rem, 2.6vw, 2.35rem) !important;
  line-height: 1.08 !important;
  max-width: 22ch;
  color: #fff !important;
}
#root main section.bg-ink:has(h1.type-hero) .text-accent-500 {
  color: #ff7a1a !important;
}
#root main section.bg-ink:has(h1.type-hero) .text-white:not([class*="bg-"]) {
  color: #fff !important;
}
#root main section.bg-ink:has(h1.type-hero) [class*="text-white/"] {
  color: rgba(255, 255, 255, 0.65) !important;
}
#root main section.bg-ink:has(h1.type-hero) p.mt-5 {
  margin-top: 0.4rem !important;
  font-size: 0.8125rem !important;
  color: rgba(255, 255, 255, 0.7) !important;
}
#root main section.bg-ink:has(h1.type-hero) .flex.items-end.justify-between {
  gap: 1.25rem !important;
}
#root main section.bg-ink:has(h1.type-hero) .rounded-3xl {
  padding: 0.65rem 1.1rem !important;
  border-radius: 1rem !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  box-shadow: none !important;
}
#root main section.bg-ink:has(h1.type-hero) .text-5xl,
#root main section.bg-ink:has(h1.type-hero) .sm\:text-6xl {
  font-size: 2rem !important;
  color: #fff !important;
}
#root main section.bg-ink:has(h1.type-hero) .absolute.rounded-full {
  height: 10rem !important;
  width: 10rem !important;
}
#root main section.bg-ink:has(h1.type-hero) .diag-stripes-soft {
  display: block !important;
  opacity: 0.7 !important;
}
/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  article.rr-cat { min-height: 0; }
  .rr-cat-media { height: 156px; min-height: 156px; }
  .rr-cat-img { max-height: 146px; }
}
@media (max-width: 640px) {
  :root { --rcat-pad: 18px; }
  article.rr-cat { min-height: 0; }
  .rr-cat-media { height: 152px; min-height: 152px; }
  .rr-cat-img { max-height: 142px; }
  .rr-cat-select { min-width: 104px; }
  .rr-cat-badge {
    top: 12px;
    right: -36px;
    width: 108px;
    font-size: 0.54rem;
  }
}
