/* Function: styles the sell page hero wrapper and the screenshot-inspired marketing sections. */
.trade-in-hero {
  background: #fafafa;
  display: flex;
  justify-content: center;
  margin-block: 0;
  padding: 1rem;
}

/* Function: caps the instant-offer widget at the intended readable width. */
.trade-in-hero__inner {
  max-width: 1000px;
  width: 100%;
}

/* Function: defines shared DriveHaus section tokens for the post-widget content. */
.sell-marketing-section {
  --sell-navy: var(--primary-color, #1a377b);
  --sell-gold: var(--secondary-color, #FBB649);
  --sell-ink: #22252a;
  --sell-muted: #686d75;
  --sell-line: #dedfe3;
  --sell-soft: #f7f9fc;
  background: #ffffff;
  color: var(--sell-ink);
  margin-block: 0;
  padding: 4.75rem 0;
  scroll-margin-top: 5.5rem;
}

/* Function: gives alternating sections a quiet DriveHaus-tinted canvas. */
.sell-marketing-section:nth-of-type(3) {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* Function: constrains lower sell sections to match the rest of the site. */
.sell-marketing-section__inner {
  margin: 0 auto;
  max-width: var(--max-width, 1200px);
  padding: 0 1.5rem;
  width: 100%;
}

/* Function: normalizes screenshot-sized section headings without viewport-based type scaling. */
.sell-marketing-section h2 {
  color: var(--sell-ink);
  font-family: var(--font-display, 'Sora', 'Inter', system-ui, sans-serif);
  font-size: 3.45rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
  margin: 0 0 3.4rem;
}

/* Function: keeps the first screenshot heading aligned to the left. */
.quick-works h2 {
  text-align: left;
}

/* Function: lays out the three how-it-works cards. */
.works-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Function: recreates the reference step card with DriveHaus surface treatment. */
.work-step {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--sell-line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(26, 55, 123, 0.06);
  min-height: 190px;
  padding: 2.2rem 2.45rem 2rem;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

/* Function: gives each card a subtle interactive lift. */
.work-step:hover {
  border-color: rgba(26, 55, 123, 0.22);
  box-shadow: 0 22px 46px rgba(26, 55, 123, 0.1);
  transform: translateY(-3px);
}

/* Function: positions the icon cluster above each step title. */
.work-step__icon {
  display: inline-grid;
  height: 3.25rem;
  margin: 0 0 1.8rem;
  place-items: center;
  position: relative;
  width: 3.25rem;
}

/* Function: renders the colorful glyphs shown in the reference cards. */
.work-step__emoji {
  display: block;
  font-size: 2.35rem;
  line-height: 1;
}

/* Function: adds a DriveHaus gold coin cue to the first offer icon. */
.work-step__coin {
  align-items: center;
  background: linear-gradient(180deg, #ffd66b 0%, var(--sell-gold) 100%);
  border: 2px solid #d89520;
  border-radius: 999px;
  bottom: 0.15rem;
  box-shadow: 0 8px 14px rgba(216, 149, 32, 0.24);
  color: #4b3200;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 900;
  height: 1.55rem;
  justify-content: center;
  position: absolute;
  right: -0.1rem;
  width: 1.55rem;
}

/* Function: styles the step title with screenshot-like weight. */
.work-step h3 {
  color: var(--sell-ink);
  font-family: var(--font-display, 'Sora', 'Inter', system-ui, sans-serif);
  font-size: 1.33rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0 0 1rem;
}

/* Function: keeps the step description compact and muted. */
.work-step p {
  color: var(--sell-muted);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.45;
  margin: 0;
}

/* Function: recreates the full-width ride voucher note under the step cards. */
.voucher-note {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--sell-line);
  border-radius: 8px;
  display: flex;
  gap: 1.6rem;
  margin-top: 2.2rem;
  padding: 1.6rem 2rem;
}

/* Function: approximates the black Uber badge from the reference. */
.voucher-note__brand {
  align-items: center;
  background: #000000;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.08rem;
  font-weight: 700;
  height: 3rem;
  justify-content: center;
  letter-spacing: 0;
  width: 5.1rem;
}

/* Function: keeps the voucher sentence on one clean line when space allows. */
.voucher-note p {
  color: var(--sell-muted);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.45;
  margin: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  width: 100%;
}

/* Function: emphasizes the voucher value like the screenshot. */
.voucher-note strong {
  color: var(--sell-ink);
  font-weight: 900;
}

/* Function: adds a calm DriveHaus canvas behind the payment area. */
.payment-process {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

/* Function: lays out the payment checklist and payment preview side by side. */
.payment-grid {
  align-items: center;
  display: grid;
  gap: 3.4rem;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.85fr);
}

/* Function: recreates the reference numbered payment list container. */
.payment-steps {
  background: #ffffff;
  border: 1px solid #bfc2c8;
  border-radius: 8px;
  list-style: none;
  margin: 0;
  overflow: hidden;
  padding: 0;
}

/* Function: lays out each payment row with a large number and copy column. */
.payment-step {
  align-items: center;
  display: grid;
  grid-template-columns: 8.8rem minmax(0, 1fr);
  min-height: 8.25rem;
}

/* Function: separates the payment rows with a precise reference-like rule. */
.payment-step + .payment-step {
  border-top: 1px solid var(--sell-line);
}

/* Function: styles the large row numbers from the screenshot. */
.payment-step__number {
  color: var(--sell-ink);
  display: block;
  font-family: var(--font-display, 'Sora', 'Inter', system-ui, sans-serif);
  font-size: 4.25rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

/* Function: adds the vertical divider between number and payment details. */
.payment-step__copy {
  border-left: 1px solid var(--sell-line);
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.8rem 2.2rem;
}

/* Function: styles the payment step title. */
.payment-step__copy strong {
  color: var(--sell-ink);
  font-size: 1.25rem;
  font-weight: 850;
  line-height: 1.2;
}

/* Function: styles the payment step helper text. */
.payment-step__copy small {
  color: var(--sell-muted);
  font-size: 1.04rem;
  font-weight: 500;
  line-height: 1.4;
}

/* Function: frames the payment preview as a soft mobile-wallet device. */
.payout-device {
  margin-left: auto;
  width: min(100%, 365px);
}

/* Function: recreates the payment confirmation card inside the device frame. */
.payout-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 36px rgba(15, 23, 42, 0.08);
  color: var(--sell-ink);
  min-height: 410px;
  padding: 2.4rem 2.1rem;
}

/* Function: styles the green confirmation check. */
.payout-card__check {
  align-items: center;
  border: 2px solid #4bbd1f;
  border-radius: 999px;
  color: #45b51c;
  display: inline-flex;
  font-size: 1.5rem;
  font-weight: 700;
  height: 3.05rem;
  justify-content: center;
  line-height: 1;
  margin-bottom: 2.4rem;
  width: 3.05rem;
}

/* Function: styles the payment confirmation headline. */
.payout-card .paid-title {
  color: var(--sell-ink);
  font-size: 1.25rem;
  font-weight: 850;
  line-height: 1.25;
}

/* Function: adds the divider line under the confirmation headline. */
.payout-card__rule {
  background: var(--sell-line);
  height: 1px;
  margin: 2.1rem 0;
  width: 100%;
}

/* Function: lays out the amount and Interac badge. */
.payout-card__row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 2.4rem;
}

/* Function: normalizes uppercase labels inside the payment card. */
.payout-card__label {
  color: var(--sell-muted);
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

/* Function: makes the example amount match the reference hierarchy. */
.payout-card .amount {
  color: var(--sell-ink);
  display: block;
  font-size: 1.25rem;
  font-weight: 850;
  line-height: 1.15;
}

/* Function: approximates the yellow Interac mark without adding a raster dependency. */
.payout-card__interac {
  align-items: center;
  background: #ffb71b;
  border-radius: 6px;
  color: #111111;
  display: inline-flex;
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 900;
  height: 3.1rem;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
  overflow: hidden;
  padding-left: 0.1rem;
  transform: rotate(-3deg);
  width: 3.75rem;
}

/* Function: stacks the payment sender details. */
.payout-card__from {
  display: grid;
  gap: 0.2rem;
}

/* Function: emphasizes the sender brand. */
.payout-card__from strong {
  color: var(--sell-ink);
  font-size: 1.15rem;
  font-weight: 850;
  line-height: 1.2;
}

/* Function: keeps the payment email readable. */
.payout-card__from small {
  color: var(--sell-ink);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: break-word;
}

/* Function: centers the comparison headline like the reference. */
.comparison-chart h2 {
  margin-inline: auto;
  max-width: 900px;
  text-align: center;
}

/* Function: lays out the three comparison columns. */
.comparison-grid {
  align-items: stretch;
  display: grid;
  gap: 2.1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Function: recreates the comparison card shell. */
.comparison-card {
  background: #ffffff;
  border: 1px solid var(--sell-line);
  border-radius: 8px;
  overflow: hidden;
}

/* Function: gives the featured DriveHaus card extra emphasis. */
.comparison-card--featured {
  border-color: #a9abb0;
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.11);
  transform: translateY(-1px);
}

/* Function: styles the default comparison card heading. */
.comparison-card h3 {
  align-items: center;
  color: var(--sell-ink);
  display: flex;
  font-family: var(--font-display, 'Sora', 'Inter', system-ui, sans-serif);
  font-size: 1.34rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  min-height: 5.5rem;
  margin: 0;
  padding: 0 1.6rem;
}

/* Function: lays out the featured heading and DriveHaus mark. */
.comparison-card__heading {
  align-items: center;
  border-bottom: 1px solid var(--sell-line);
  display: flex;
  justify-content: space-between;
  min-height: 5.5rem;
  padding: 0 1.6rem;
}

/* Function: removes duplicate heading padding inside the featured heading row. */
.comparison-card__heading h3 {
  border: 0;
  min-height: auto;
  padding: 0;
}

/* Function: creates a DriveHaus-colored brand mark in place of the reference logo. */
.comparison-mark {
  flex: 0 0 auto;
  height: 3rem;
  width: 3rem;
  object-fit: contain;
  border-radius: 999px;
  background: transparent;
}

/* Function: resets comparison lists for row-based styling. */
.comparison-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Function: styles each comparison row. */
.comparison-list li {
  align-items: center;
  color: var(--sell-muted);
  display: flex;
  font-size: 1.08rem;
  font-weight: 500;
  min-height: 5.6rem;
  padding: 0 1.6rem;
}

/* Function: separates comparison rows with soft dividers. */
.comparison-list li + li {
  border-top: 1px solid #f1f2f4;
}

/* Function: emphasizes positive DriveHaus comparison rows. */
.comparison-list--positive li {
  color: var(--sell-ink);
  font-weight: 800;
  gap: 1.3rem;
}

/* Function: styles the green check marks in the featured comparison card. */
.comparison-list--positive span {
  color: #43b70f;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

/* Function: hides carousel position dots until the comparison cards become swipeable. */
.comparison-dots {
  display: none;
}

/* Function: keeps testimonials aligned after the redesigned sections. */
.testimonials {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1rem;
  text-align: center;
}

/* Function: lays out testimonial cards and carousel tracks. */
.testimonials-grid {
  --testimonial-gap: 1.5rem;
  display: grid;
  gap: var(--testimonial-gap, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1.5rem;
}

/* Function: styles each testimonial surface. */
.testimonial {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
}

/* Function: colors the testimonial stars. */
.testimonial .stars {
  color: #fbbf24;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

/* Function: keeps testimonial quotes differentiated. */
.testimonial p {
  font-style: italic;
}

/* Function: styles the testimonial author line. */
.testimonial .author {
  font-weight: 600;
  margin-top: 0.75rem;
}

/* Function: enables the testimonial marquee wrapper when JavaScript initializes it. */
.testimonials-grid.is-carousel {
  display: block;
  overflow: hidden;
  position: relative;
}

/* Function: adds the left testimonial fade edge. */
.testimonials-grid.is-carousel::before {
  background: linear-gradient(90deg, var(--light-bg, #fff) 0%, rgba(255, 255, 255, 0));
  bottom: 0;
  content: "";
  left: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  width: 3rem;
  z-index: 1;
}

/* Function: adds the right testimonial fade edge. */
.testimonials-grid.is-carousel::after {
  background: linear-gradient(270deg, var(--light-bg, #fff) 0%, rgba(255, 255, 255, 0));
  bottom: 0;
  content: "";
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  width: 3rem;
  z-index: 1;
}

/* Function: lays out testimonials in the animated track. */
.testimonials-grid .testimonial-track {
  align-items: stretch;
  animation: testimonial-marquee var(--testimonial-marquee-duration, 40s) linear infinite;
  animation-play-state: paused; /* Function: lets motion-controller.js run the marquee only while visible. */
  backface-visibility: hidden;
  display: flex;
  gap: var(--testimonial-gap, 1.5rem);
  transform: translate3d(0,0,0);
  will-change: auto; /* Function: avoids permanently promoting the duplicated testimonial rail. */
  width: max-content;
}

/* Function: fixes the carousel item width on narrow screens. */
.testimonials-grid .testimonial-track > .testimonial {
  flex: 0 0 auto;
  min-width: min(300px, calc(100vw - 4rem));
}

/* Function: moves the testimonial track by half its duplicated width. */
@keyframes testimonial-marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* Function: stacks redesigned sections for tablet widths. */
@media (max-width: 980px) {
  .sell-marketing-section {
    padding: 4rem 0;
  }

  .sell-marketing-section h2 {
    font-size: 2.65rem;
    margin-bottom: 2.4rem;
  }

  /* Function: reduces narrow-screen side gutters for every sell marketing section. */
  .sell-marketing-section__inner {
    max-width: none; /* Function: lets the section use the full narrow viewport instead of staying capped. */
    padding-inline: clamp(1rem, 2.5vw, 1.25rem); /* Function: keeps only a small readable edge gutter. */
  }

  .works-grid,
  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .payment-grid {
    grid-template-columns: 1fr;
  }

  .payout-device {
    margin: 0 auto;
  }
}

/* Function: adjusts dense reference layouts for phones. */
@media (max-width: 640px) {
  .sell-marketing-section {
    padding: 3.25rem 0;
  }

  .sell-marketing-section__inner {
    max-width: none; /* Function: prevents phone layouts from creating artificial side margins. */
    padding-inline: clamp(0.75rem, 3vw, 1rem); /* Function: keeps narrow sections close to the viewport edge. */
  }

  .sell-marketing-section h2 {
    font-size: 2.2rem;
    margin-bottom: 1.8rem;
  }

  .work-step {
    min-height: 0;
    padding: 1.65rem;
  }

  .voucher-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
  }

  .voucher-note p {
    font-size: 1rem;
  }

  .payment-step {
    grid-template-columns: 5.2rem minmax(0, 1fr);
    min-height: 7rem;
  }

  .payment-step__number {
    font-size: 3rem;
  }

  .payment-step__copy {
    padding: 0.8rem 1rem;
  }

  .payment-step__copy strong {
    font-size: 1.05rem;
  }

  .payment-step__copy small {
    font-size: 0.94rem;
  }

  .payout-device {
    /* Removed padding/border-radius for flat card */
  }

  .payout-card {
    min-height: 380px;
    padding: 2rem 1.5rem;
  }

  .comparison-card h3,
  .comparison-card__heading {
    min-height: 4.6rem;
  }

  .comparison-chart {
    background: transparent;
    overflow: visible;
  }

  .comparison-chart .sell-marketing-section__inner {
    max-width: none;
    overflow: visible;
    width: 100%;
  }

  .comparison-chart h2 {
    padding-inline: 1rem;
  }

  /* Function: turns comparison cards into a swipeable mobile carousel. */
  .comparison-grid {
    --comparison-card-width: min(82vw, 360px);
    display: flex;
    gap: 1rem;
    margin-inline: calc(50% - 50vw);
    margin-bottom: -2.5rem; /* Function: offsets the added bottom padding so the layout footprint is unchanged */
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 1rem max(1rem, calc((100vw - var(--comparison-card-width)) / 2)) 3.5rem;
    scroll-behavior: smooth;
    scroll-padding-inline: max(1rem, calc((100vw - var(--comparison-card-width)) / 2));
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    width: 100vw;
    -webkit-overflow-scrolling: touch;
  }

  .comparison-grid::-webkit-scrollbar {
    display: none;
  }

  .comparison-card {
    flex: 0 0 var(--comparison-card-width);
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  .comparison-card--featured {
    transform: none;
  }

  .comparison-list li {
    min-height: 4.5rem;
  }

  .comparison-dots {
    align-items: center;
    display: flex;
    gap: 0.55rem;
    justify-content: center;
    margin-top: 1rem;
  }

  .comparison-dot {
    appearance: none;
    background: rgba(104, 109, 117, 0.32);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    height: 0.55rem;
    padding: 0;
    transition: background 0.18s ease, transform 0.18s ease, width 0.18s ease;
    width: 0.55rem;
  }

  .comparison-dot.is-active {
    background: var(--sell-navy);
    transform: scale(1.05);
    width: 1.45rem;
  }

  .comparison-dot:focus-visible {
    outline: 2px solid rgba(26, 55, 123, 0.45);
    outline-offset: 3px;
  }
}

/* Function: keeps true narrow-phone captures from inheriting wider hero overflow. */
@media (max-width: 520px) {
  .sell-marketing-section__inner {
    max-width: none; /* Function: removes the 358px phone cap that made mid-narrow screens feel inset. */
  }
}

/* Function: respects reduced-motion preferences for hover and carousel movement. */
@media (prefers-reduced-motion: reduce) {
  .work-step {
    transition: none;
  }

  .work-step:hover {
    transform: none;
  }

  .testimonials-grid .testimonial-track {
    animation: none;
    transform: none !important;
  }
}
