/*
 * ECAR Why Choose Us — six labelled reasons, namespaced under .ecar-why.
 *
 * Cards, not a ledger: the previous dotted-leader list read as one grey
 * paragraph, which meant the warranty and the same-day promise — the two
 * facts that actually win the job — were no more visible than "parts on
 * the truck". Each reason now gets its own cell and its own gold icon.
 *
 * The card is a hairline box on the raised band with a gold-washed icon
 * plate, the same plate used by .ecar-trust__icon in the hero. Hover lifts
 * the border to gold rather than moving the card: a 6-cell grid where every
 * cell translates on hover is the exact restless "template" feel this theme
 * avoids elsewhere.
 *
 * The optional image/illustration sits in its own contained, bordered frame
 * (not full-bleed like the hero photo) — deliberately a different treatment
 * so this section doesn't read as a repeat of the hero split.
 */

.ecar-why {
  background-color: var(--ecar-bg-raised);
  border-top: 1px solid var(--ecar-border);
  padding-block: var(--sp-section);
}

.ecar-why__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.ecar-why__inner--media {
  max-width: var(--shell);
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* --- Image / illustration (optional, user-supplied) --- */
.ecar-why__media {
  position: relative;
  aspect-ratio: 4 / 5;
  background-color: var(--ecar-surface);
  border: 1px solid var(--ecar-border);
  overflow: hidden;
}

.ecar-why__media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Head ---
   Centred only in the no-image layout: with a photo in the left column a
   centred heading would float unanchored between the two. */
.ecar-why__head {
  margin-bottom: 40px;
}

.ecar-why__inner:not(.ecar-why__inner--media) .ecar-why__head {
  max-width: 620px;
  margin-inline: auto;
  text-align: center;
}

.ecar-why__title {
  font-size: var(--fs-h2);
  margin-bottom: 14px;
}

.ecar-why__description {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ecar-text-secondary);
  max-width: 520px;
}

.ecar-why__inner:not(.ecar-why__inner--media) .ecar-why__description {
  margin-inline: auto;
}

/* --- Card grid --- */
.ecar-why__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0 0 40px;
  padding: 0;
}

.ecar-why__card {
  position: relative;
  padding: 26px 24px 24px;
  background-color: var(--ecar-surface);
  border: 1px solid var(--ecar-hairline);
  border-radius: 12px;
  transition: border-color var(--transition), background-color var(--transition);
}

.ecar-why__card:hover {
  border-color: var(--ecar-gold-line);
  background-color: var(--ecar-surface-2);
}

.ecar-why__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  margin-bottom: 18px;
  color: var(--ecar-gold);
  background-color: var(--ecar-gold-quiet);
  border: 1px solid var(--ecar-gold-line);
  border-radius: 11px;
  transition: color var(--transition), border-color var(--transition);
}

.ecar-why__card:hover .ecar-why__icon {
  color: var(--ecar-gold-strong);
  border-color: var(--ecar-gold);
}

.ecar-why__icon svg,
.ecar-why__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Overrides the 1.6 the inline SVGs declare as an attribute: the same
   readability fix applied to the hero trust icons — a 1.6px stroke in the
   orange plate disappeared on a phone screen. */
.ecar-why__icon svg {
  stroke-width: 1.85;
}

.ecar-why__card-title {
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ecar-text-primary);
}

.ecar-why__card-text {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ecar-text-secondary);
}

/* --- Responsive --- */

@media (max-width: 1439px) {
  .ecar-why__inner--media {
    gap: 40px;
  }
}

@media (max-width: 1199px) {
  .ecar-why__inner--media {
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
    gap: 32px;
  }

  /* Three cards beside a photo leaves ~200px per cell, which breaks the
     longer titles onto three lines — the media layout drops to two. */
  .ecar-why__inner--media .ecar-why__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .ecar-why__inner--media {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .ecar-why__inner--media .ecar-why__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ecar-why__media {
    aspect-ratio: 16 / 9;
    max-width: 480px;
  }
}

@media (max-width: 899px) {
  .ecar-why__grid,
  .ecar-why__inner--media .ecar-why__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 599px) {
  .ecar-why__media {
    aspect-ratio: 4 / 3;
    max-width: none;
  }

  .ecar-why__head {
    margin-bottom: 28px;
  }

  .ecar-why__grid,
  .ecar-why__inner--media .ecar-why__grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ecar-why__card {
    padding: 20px 18px;
  }

  .ecar-why__icon {
    width: 40px;
    height: 40px;
    margin-bottom: 14px;
  }

  .ecar-why__content .ecar-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecar-why__card,
  .ecar-why__icon {
    transition: none;
  }
}
