/**
 * VinFast US adjustments for the AFTERSALES revamp styles ported from VN (porto).
 *
 * Kept apart from the VN files so those stay identical to the VN theme and
 * can be compared or re-synced.
 */

:root {
  /* Fixed #header of vinfast_v2 (porto's header is 80px). */
  --aftersales-header-height: 89px;
}

@media (max-width: 1199px) {
  :root {
    --aftersales-header-height: 73px;
  }
}

/* #main keeps its margin for the fixed header; the hero starts right under it. */
#main.aftersales-page {
  padding: 0;
}

/* Bootstrap underlines every a:hover; porto does not. */
.aftersales-page a:hover,
.aftersales-page a:focus {
  text-decoration: none;
}

/* Without a configured photo the panel shows its dark colour only. */
.aftersales-repair__parts-card:not([style]) .aftersales-repair__parts-content {
  width: 100%;
}

/* A single process step (no slider, see aftersales-steps-interactive.js). */
.aftersales-steps__item:only-child {
  margin-right: auto;
  margin-left: auto;
}

/* VN sizes the accessory cards for two long items side by side (fixed 400px,
   text scrolls). Grow with the content instead, still capped at 400px. */
@media (min-width: 769px) {
  .aftersales-warranty__accessory-cards .aftersales-warranty__accessory-card {
    height: auto;
    max-height: 400px;
  }
}

/* --- Recall banner (bottom of the aftersales pages, as on /service) --- */
.aftersales-recall {
  font-family: 'Mulish', sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

.aftersales-recall__inner {
  display: flex;
  align-items: stretch;
}

.aftersales-recall__content {
  width: 40%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 56px;
  background-color: #000;
  color: #fff;
}

.aftersales-recall__title {
  margin: 0 0 16px;
  color: #fff;
  font-weight: 600;
  font-size: 2rem;
  line-height: 2.5rem;
}

.aftersales-recall__text,
.aftersales-recall__text p {
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.625rem;
  color: #fff;
}

.aftersales-recall__text p:last-child {
  margin-bottom: 0;
}

.aftersales-recall__text a,
.aftersales-recall__text a:hover,
.aftersales-recall__text a:focus,
.aftersales-recall__phone a,
.aftersales-recall__phone a:hover,
.aftersales-recall__phone a:focus {
  color: #fff;
  text-decoration: none;
}

.aftersales-recall__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

.aftersales-recall__phone {
  font-weight: 500;
}

.aftersales-recall__media {
  width: 60%;
}

.aftersales-recall__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1024px) {
  .aftersales-recall__inner {
    flex-direction: column-reverse;
  }

  .aftersales-recall__content,
  .aftersales-recall__media {
    width: 100%;
  }

  .aftersales-recall__content {
    padding: 32px 40px;
  }
}

@media (max-width: 768px) {
  .aftersales-recall {
    padding: 0 20px 56px;
  }

  .aftersales-recall__content {
    padding: 24px 24px 40px;
  }

  .aftersales-recall__title {
    font-size: 1.5rem;
    line-height: 2rem;
  }

  .aftersales-recall__text,
  .aftersales-recall__text p {
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 148%;
  }

  .aftersales-recall__media img {
    height: 40vh;
  }

  .aftersales-recall__btn {
    width: 100%;
    text-align: center;
  }
}

/* --- Text-only parts carousels (no slide has a picture) ---
   The VN design gives the slides a fixed 287px height to match the picture.
   Without pictures the box follows the slide on screen instead (the active
   slide is the only one in the flow), so short slides leave no empty space. */
.aftersales-warranty__parts-slides-wrapper:not(:has(.aftersales-warranty__parts-slide-image)) {
  height: auto;
}

.aftersales-warranty__parts-slides-wrapper:not(:has(.aftersales-warranty__parts-slide-image)) .aftersales-warranty__parts-slide {
  align-items: stretch;
}

.aftersales-warranty__parts-slides-wrapper:not(:has(.aftersales-warranty__parts-slide-image)) .aftersales-warranty__parts-slide-content {
  height: auto;
  min-height: 120px;
  border-radius: 10px;
}

/* --- Pictures that are not cut to the VN frame ---
   VN crops its photos to the frame (463x421, 398x287). The US photos are 3:2,
   so fill the frame and crop instead of leaving a gap or squashing them. */
.aftersales-warranty__notice-image img,
.aftersales-warranty__parts-slide-image img {
  height: 100%;
  object-fit: cover;
}

/* --- Repair service cards without a picture ---
   The text panel is capped at 287px to sit under the picture; alone it fills
   the card so the card has no empty bottom half. "contain: size" keeps its
   text from making the carousel taller: it takes the height of the other
   cards and scrolls. */
.aftersales-repair__card-body:only-child {
  max-height: none;
  min-height: 287px;
  contain: size;
}

/* --- A single maintenance benefit ---
   VN shows two benefits side by side, each with its picture under the text.
   With only one, use the whole row: text on the left, picture on the right. */
.aftersales-maintenance__benefit:only-child {
  grid-column: 1 / -1;
}

@media (min-width: 769px) {
  .aftersales-maintenance__benefit:only-child {
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
  }

  .aftersales-maintenance__benefit:only-child > .aftersales-maintenance__benefit-text,
  .aftersales-maintenance__benefit:only-child > .aftersales-imgtext__image {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* --- Genuine Accessories Warranty: warranty items table (full width) --- */
.aftersales-warranty__accessory-cards {
  flex-wrap: wrap;
}
.aftersales-warranty__accessory-table {
  flex: 0 0 100%;
  font-family: 'Mulish', sans-serif;
  color: #1f2125;
}
.aftersales-warranty__accessory-table > p {
  font-size: 18px;
  margin: 0 0 12px;
}
.aftersales-warranty__accessory-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* The table (640px wide) scrolls inside its own box instead of widening the page. */
.aftersales-warranty__accessory-table {
  min-width: 0;
  max-width: 100%;
}
/* Mobile: the cards stack in a column. A wrapping column sizes itself to its
   widest item and widens the whole page; do not wrap. */
@media (max-width: 768px) {
  .aftersales-warranty__accessory-cards {
    flex-wrap: nowrap;
  }
  .aftersales-warranty__accessory-table {
    flex: 0 0 auto;
  }
}
/* Tablet / small laptop: the exclusions card is a fixed 847px (384 text + 463
   image), wider than the content area below ~1200px. Stack it as on mobile. */
@media (min-width: 769px) and (max-width: 1199px) {
  .aftersales-page .aftersales-warranty__notice-card {
    flex-direction: column;
    gap: 20px;
  }
  .aftersales-page .aftersales-warranty__notice-text {
    width: 100%;
    height: auto;
    max-height: 389px;
    border-radius: 10px;
  }
  .aftersales-page .aftersales-warranty__notice-image {
    width: 100%;
    height: auto;
    aspect-ratio: 463 / 300;
    border-radius: 10px;
  }
}
.aftersales-warranty__accessory-table table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.4;
}
.aftersales-warranty__accessory-table th,
.aftersales-warranty__accessory-table td {
  border: 1px solid #1f2125;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.aftersales-warranty__accessory-table th {
  font-weight: 600;
  font-size: 18px;
}
.aftersales-warranty__accessory-table td .note {
  display: block;
  font-size: 13px;
}
.aftersales-warranty__accessory-table tr.is-new td {
  background: #e3ecf7;
}
