/**
 * AutoMart Canada homepage.
 *
 * Runs inside the Foxiz theme, so every rule is scoped to .amvi-index to keep
 * it away from the news templates. Headings inherit the theme's Coustard and
 * body copy its Bitter rather than declaring families here.
 */

/*
 * Border-box is declared here rather than inherited from the shop stylesheet,
 * so the fixed card and rail dimensions hold even if that file is not present.
 */
.amvi-index,
.amvi-index *,
.amvi-index *::before,
.amvi-index *::after {
  box-sizing: border-box;
}

.amvi-index {
  --amvi-w: 1016px;
  --amvi-card: #f4f4f4;
  --amvi-band: #f8f8f8;
  --amvi-line: #e3e3e3;
  --amvi-ink: #111;
  --amvi-muted: #707070;
  --amvi-accent: #0066cc;
  color: var(--amvi-ink);
}

.amvi-index__wrap {
  max-width: var(--amvi-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Do not rely on the theme supplying a responsive image reset. */
.amvi-index img {
  max-width: 100%;
}

.amvi-index h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  color: #000;
}

/* ---------------------------------------------------------------- hero --- */

.amvi-hero2 {
  position: relative;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 20px 32px;
  background-color: #9fb0bd;
  background-position: center bottom;
  background-size: cover;
  background-repeat: no-repeat;
  color: #fff;
}

/* Keeps the headline legible over the lighter part of the photo. */
.amvi-hero2::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.34) 0%, rgba(0, 0, 0, 0.10) 38%, rgba(0, 0, 0, 0) 62%);
  pointer-events: none;
}

.amvi-hero2 > * {
  position: relative;
  z-index: 1;
}

.amvi-hero2__title {
  margin: 0 0 10px;
  max-width: 1174px;
  font-size: 48px;
  line-height: 56px;
  font-weight: 700;
  color: #fff;
}

.amvi-hero2__sub {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  color: #fff;
}

.amvi-hero2__sub strong {
  font-weight: 700;
}

.amvi-hero2__search {
  width: 100%;
  max-width: 606px;
}

.amvi-hero2__search input {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 100px;
  padding: 0 22px 0 48px;
  font: inherit;
  font-size: 16px;
  color: var(--amvi-ink);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20' fill='none' stroke='%23707070' stroke-width='2'><circle cx='8' cy='8' r='6'/><path d='M13 13l5 5' stroke-linecap='round'/></svg>") 20px center no-repeat;
}

.amvi-hero2__search input::placeholder {
  color: var(--amvi-muted);
}

.amvi-hero2__tabs {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: auto;
  padding-top: 40px;
}

.amvi-hero2__tabs a {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  padding-bottom: 5px;
  border-bottom: 2px solid transparent;
}

.amvi-hero2__tabs a.is-active,
.amvi-hero2__tabs a:hover {
  border-bottom-color: #fff;
}

/* ------------------------------------------------------- brands + types --- */

.amvi-shopby {
  padding: 48px 0 8px;
}

.amvi-shopby__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.amvi-postal2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: var(--amvi-ink);
  text-decoration: underline;
  cursor: pointer;
}

.amvi-rail2 {
  position: relative;
  margin-bottom: 24px;
}

.amvi-rail2__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 4px;
  /* Touch scrolling is the only way through these rails once the arrow is
   * hidden on small screens, so make it feel deliberate rather than loose. */
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}

.amvi-rail2__track > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
}

.amvi-rail2__track::-webkit-scrollbar {
  display: none;
}

.amvi-rail2__next {
  position: absolute;
  top: 48px;
  right: -18px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--amvi-line);
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.amvi-brand2 {
  flex: 0 0 140px;
  text-decoration: none;
  color: var(--amvi-ink);
  text-align: center;
}

.amvi-brand2__disc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 96px;
  margin-bottom: 12px;
  border-radius: 9999px;
  background: var(--amvi-card);
  font-size: 15px;
  font-weight: 600;
  color: var(--amvi-muted);
}

.amvi-brand2__disc img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.amvi-brand2__name {
  font-size: 15px;
}

.amvi-type2 {
  position: relative;
  flex: 0 0 205px;
  height: 162px;
  padding: 24px;
  border-radius: 12px;
  background: var(--amvi-card);
  text-decoration: none;
  color: var(--amvi-ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.amvi-type2__label {
  font-size: 15px;
  font-weight: 500;
}

.amvi-type2 img {
  width: 157px;
  height: 79px;
  object-fit: contain;
  align-self: center;
}

/* ---------------------------------------------------------------- budget --- */

.amvi-budget2 {
  background: var(--amvi-band);
  padding: 48px 0;
  margin-top: 24px;
}

.amvi-budget2 h2 {
  margin-bottom: 28px;
}

.amvi-budget2__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 32px;
}

.amvi-budget2__car {
  width: 100%;
  max-width: 420px;
  height: auto;
  justify-self: center;
}

.amvi-budget2__card {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.amvi-field {
  position: relative;
  display: block;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  padding: 6px 12px 4px;
  background: #fff;
}

.amvi-field--wide {
  grid-column: 1 / -1;
}

.amvi-field > span {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  color: var(--amvi-muted);
}

.amvi-field input,
.amvi-field select {
  width: 100%;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 15px;
  color: var(--amvi-ink);
  background: transparent;
  appearance: none;
}

.amvi-field input:focus,
.amvi-field select:focus {
  outline: none;
}

.amvi-budget2__cta {
  grid-column: 1 / -1;
  height: 48px;
  border: 0;
  border-radius: 100px;
  background: #000;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.amvi-budget2__cta:hover {
  background: #222;
}

/* ------------------------------------------------------------- resources --- */

.amvi-res2 {
  padding: 56px 0 64px;
  text-align: center;
}

.amvi-res2 h2 {
  margin-bottom: 28px;
}

.amvi-res2__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.amvi-res2__tabs {
  display: flex;
  justify-content: center;
  gap: 56px;
  border-bottom: 1px solid var(--amvi-line);
  margin-bottom: 8px;
}

.amvi-res2__tabs label {
  padding: 8px 4px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--amvi-ink);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}

#amvi-r1:checked ~ .amvi-res2__tabs label[for="amvi-r1"],
#amvi-r2:checked ~ .amvi-res2__tabs label[for="amvi-r2"],
#amvi-r3:checked ~ .amvi-res2__tabs label[for="amvi-r3"] {
  border-bottom-color: var(--amvi-accent);
}

.amvi-res2__panel {
  display: none;
  text-align: left;
}

#amvi-r1:checked ~ .amvi-res2__panel--1,
#amvi-r2:checked ~ .amvi-res2__panel--2,
#amvi-r3:checked ~ .amvi-res2__panel--3 {
  display: block;
}

.amvi-acc2 {
  border-bottom: 1px solid var(--amvi-line);
}

.amvi-acc2 > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 4px;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.amvi-acc2 > summary::-webkit-details-marker {
  display: none;
}

.amvi-acc2 > summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 1.5px solid #555;
  border-bottom: 1.5px solid #555;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.15s ease;
}

.amvi-acc2[open] > summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.amvi-acc2__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding: 0 4px 20px;
}

.amvi-acc2__links a {
  font-size: 14px;
  color: #333;
}

/* ------------------------------------------------------------------ news --- */

.amvi-news2 {
  background: var(--amvi-ink);
  padding: 40px 0 48px;
  color: #fff;
}

.amvi-news2__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}

.amvi-news2 h2 {
  font-size: 20px;
  color: #fff;
}

.amvi-news2__all {
  font-size: 14px;
  color: #8ab4f8;
  text-decoration: none;
}

.amvi-news2__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.amvi-news2__card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #fff;
}

.amvi-news2__thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
  background: #222;
  margin-bottom: 12px;
}

.amvi-news2__cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8384f;
  margin-bottom: 6px;
}

.amvi-news2__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 8px;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.amvi-news2__date {
  font-size: 12px;
  color: #9a9a9a;
}

/* -------------------------------------------------------------- ad slots --- */

.amvi-ad {
  display: flex;
  justify-content: center;
  padding: 20px 16px;
}

.amvi-ad__box {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
}

.amvi-ad__box.is-empty {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}

.amvi-ad__label {
  font-size: 10px;
  line-height: 1;
  color: #6b7280;
}

/* ---------------------------------------------------------------- footer --- */

/*
 * The homepage carries its own footer, so the theme's is hidden here only.
 * Every other template keeps the Foxiz footer untouched.
 */
.amvi-index-page .footer-wrap {
  display: none;
}

.amvi-foot {
  background: #000;
  color: #fff;
  padding: 48px 0 32px;
}

.amvi-foot__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.amvi-foot__col h3 {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  color: #fff;
}

.amvi-foot__col a {
  display: block;
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.4;
  color: #999;
  text-decoration: none;
}

.amvi-foot__col a:hover {
  color: #fff;
}

.amvi-foot__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 36px;
}

.amvi-foot__social {
  display: flex;
  gap: 22px;
}

.amvi-foot__social a {
  color: #fff;
  line-height: 0;
}

.amvi-foot__social a:hover {
  color: #999;
}

.amvi-foot__apps {
  display: flex;
  gap: 12px;
}

.amvi-foot__apps img {
  width: 130px;
  height: 37px;
}

.amvi-foot__legal {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: #fff;
}

.amvi-foot__legal p {
  margin: 0 auto 4px;
  max-width: 880px;
}

.amvi-foot__legal a {
  color: #fff;
  text-decoration: underline;
}

.amvi-foot__links span {
  margin: 0 8px;
  color: #666;
}

.amvi-foot__copy {
  margin-top: 18px;
}

/* ------------------------------------------------- theme override guard --- */

/*
 * Foxiz styles form controls globally with selectors that outrank the component
 * rules above, which flattened the search pill and the budget fields into the
 * theme's own input treatment. These re-assert only the properties the design
 * depends on, scoped to the homepage so nothing else on the site is affected.
 */

.amvi-index-page .amvi-hero2__search input[type="search"] {
  height: 48px !important;
  padding: 0 22px 0 48px !important;
  border: none !important;
  border-radius: 100px !important;
  background-color: #fff !important;
  font-size: 16px !important;
  line-height: 48px !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* The bordered box is the label wrapper; the control inside must stay invisible
 * so the floating-label treatment reads as one field. */
.amvi-index-page .amvi-field {
  border: 1px solid #c9c9c9 !important;
  border-radius: 4px !important;
  background-color: #fff !important;
  padding: 6px 12px 4px !important;
}

.amvi-index-page .amvi-field input,
.amvi-index-page .amvi-field select {
  height: auto !important;
  width: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.amvi-index-page .amvi-budget2__cta {
  height: 48px !important;
  border: none !important;
  border-radius: 100px !important;
  background-color: #000 !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.amvi-index-page .amvi-index a {
  text-decoration: none;
  box-shadow: none;
}

/* ----------------------------------------------------------- responsive --- */

@media (max-width: 900px) {
  .amvi-hero2 {
    min-height: 460px;
    padding: 40px 20px 24px;
  }

  .amvi-hero2__title {
    font-size: 32px;
    line-height: 38px;
  }

  .amvi-budget2__row {
    grid-template-columns: 1fr;
  }

  .amvi-news2__grid,
  .amvi-foot__cols {
    grid-template-columns: repeat(2, 1fr);
  }

  .amvi-rail2__next {
    display: none;
  }
}

@media (max-width: 900px) {
  /*
   * The social row and store badges total roughly 460px, so side by side they
   * force the whole page to scroll sideways on a phone.
   */
  .amvi-foot__bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
  }

  /*
   * Ad slots carry their pixel size inline for desktop fidelity, which a phone
   * cannot honour -- override it so a 970px unit cannot overflow the viewport.
   */
  .amvi-ad__box {
    width: 100% !important;
  }

  .amvi-ad__box.is-empty {
    height: 120px !important;
  }
}

@media (max-width: 560px) {
  .amvi-hero2__title {
    font-size: 26px;
    line-height: 32px;
  }

  .amvi-budget2__card,
  .amvi-news2__grid,
  .amvi-foot__cols {
    grid-template-columns: 1fr;
  }

  .amvi-foot__apps img {
    width: 120px;
    height: 34px;
  }
}
