/* CarDecision — end-to-end UI/UX polish
 * Buttons, chips, hero search, contrast, spacing.
 * Loaded last so these rules win.
 */

:root {
  --cd-btn-radius: 12px;
  --cd-chip-radius: 999px;
  --cd-btn-h: 48px;
  --cd-ink: #0B1F33;
  --cd-accent: #E85D04;
  --cd-accent-dark: #c44d03;
}

/* ========== Buttons (consistent everywhere) ========== */
.btn,
a.btn,
button.btn,
.cd-cta,
.cd-nav-actions .cd-cta,
.hero-actions .btn,
.cw-hero-cta .btn,
.cw-hero-search .btn {
  border-radius: var(--cd-btn-radius) !important;
  min-height: var(--cd-btn-h);
  padding: 0.7rem 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  text-decoration: none;
}

.btn-sm {
  min-height: 36px;
  padding: 0.4rem 0.75rem;
  border-radius: 10px !important;
}

.btn-primary {
  background: var(--cd-accent);
  color: #fff !important;
  border: 1px solid transparent;
  box-shadow: 0 6px 16px rgba(232, 93, 4, 0.22);
}
.btn-primary:hover {
  background: var(--cd-accent-dark);
  color: #fff !important;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--brand-line, #d7e0e8);
  color: var(--brand-ink, var(--cd-ink));
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  color: #fff !important;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff !important;
}

.hero .btn-outline,
.hero-car-detail .btn-outline {
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff !important;
}
.hero .btn-outline:hover,
.hero-car-detail .btn-outline:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #fff;
  color: #fff !important;
}

/* ========== Home hero: CTA + search + suggest chips ========== */
.cw-hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.15rem;
  max-width: 520px;
}
.cw-hero-cta .btn {
  margin: 0;
}

.cw-hero-search {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 0.55rem;
  max-width: 520px;
  width: 100%;
  padding: 0.55rem;
  border-radius: 16px;
  background: rgba(7, 20, 34, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  box-sizing: border-box;
}
.cw-hero-search .input,
.cw-hero-search .btn {
  min-height: var(--cd-btn-h);
  height: var(--cd-btn-h);
  margin: 0;
  border-radius: var(--cd-btn-radius) !important;
}
.cw-hero-search .input {
  border: 0;
  background: #fff;
  color: var(--cd-ink);
  padding: 0 0.95rem;
  font-size: 0.95rem;
  width: 100%;
}
.cw-hero-search .input::placeholder {
  color: #5B6B7A;
  opacity: 1;
}
.cw-hero-search .btn {
  padding-inline: 1.25rem;
  white-space: nowrap;
}

/* CRITICAL: chips inherit .cw-hero { color:#fff } — force readable contrast */
.cw-hero .cd-suggest-chips,
.cd-suggest-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.9rem 0 0;
  max-width: 560px;
}
.cw-hero .cd-suggest-chips a,
.cw-hero .cd-suggest-chips button,
.cd-suggest-chips a,
.cd-suggest-chips button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.4rem 0.9rem;
  border-radius: var(--cd-chip-radius);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}
.cw-hero .cd-suggest-chips a:hover,
.cd-suggest-chips a:hover {
  background: #fff;
  color: var(--cd-ink) !important;
  border-color: #fff;
}

/* Light-surface suggest chips (non-hero) */
.container .cd-suggest-chips a,
.container .cd-suggest-chips button,
.cw-home .cd-suggest-chips a {
  background: #fff;
  color: var(--cd-ink) !important;
  border: 1px solid var(--brand-line, #d7e0e8);
}
.container .cd-suggest-chips a:hover {
  border-color: var(--cd-accent);
  color: var(--cd-accent) !important;
}

@media (max-width: 560px) {
  .cw-hero-search {
    grid-template-columns: 1fr;
  }
  .cw-hero-search .btn {
    width: 100%;
  }
}

/* ========== Status / meta chips (compact, readable) ========== */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.75rem 0 0;
}
.meta-row .chip,
.hero .chip,
.hero-car-detail .chip,
.chip:not([role="button"]):not(.chip-action) {
  min-height: 0;
  padding: 0.35rem 0.7rem;
  line-height: 1.25;
  font-size: 0.8rem;
  border-radius: var(--cd-chip-radius);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.hero-visual img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
}

/* ========== Budget / body pills on light home ========== */
.cw-pill,
.cw-type {
  color: var(--cd-ink) !important;
}
.cw-pill:hover,
.cw-type:hover {
  color: var(--cd-ink) !important;
}

/* ========== Forms / filters ========== */
.input,
.select,
.textarea {
  border-radius: 12px;
  min-height: 44px;
}
.form-group {
  margin-bottom: 1rem;
}

/* ========== Cards / grids ========== */
.car-card-grid,
.grid {
  gap: 1rem;
}
.result-card,
.car-card {
  border-radius: 16px;
}

/* ========== Ad slots ========== */
.ad-slot {
  margin: 1.25rem 0;
}
.ad-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 0.35rem;
}
.ad-frame {
  min-height: 90px;
  border-radius: 12px;
  overflow: hidden;
}
.ad-reserved {
  display: grid;
  place-items: center;
  min-height: 90px;
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--brand-muted, #5B6B7A);
  background: rgba(11, 31, 51, 0.04);
  border: 1px dashed rgba(11, 31, 51, 0.12);
  border-radius: 12px;
}

/* ========== Car detail hero spacing ========== */
.hero-car-detail .hero-grid {
  align-items: start;
  gap: 1.5rem;
}
@media (min-width: 900px) {
  .hero-car-detail .hero-grid {
    gap: 2rem;
  }
}

/* ========== Footer link contrast ========== */
.site-footer a {
  text-decoration: none;
}
.site-footer a:hover {
  color: #fff;
}

/* ========== Dark theme safety ========== */
html[data-theme="dark"] .cw-hero-search .input {
  background: #152433;
  color: #eef3f7;
}
html[data-theme="dark"] .container .cd-suggest-chips a {
  background: rgba(255, 255, 255, 0.08);
  color: #eef3f7 !important;
  border-color: rgba(255, 255, 255, 0.14);
}
