/* --- Repair Service Cards (carousel slides) --- */
.aftersales-carousel__slide {
  display: flex;
}

.aftersales-repair__card {
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  border: 1px solid #D9E1E2;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.aftersales-repair__card-image {
  flex-shrink: 0;
}

.aftersales-repair__card-image img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 398 / 287;
  object-fit: cover;
}

.aftersales-repair__card-body {
  background: var(--aftersales-bg-light);
  padding: 16px;
}

.aftersales-repair__card-body h3 {
  font-family: 'Mulish', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--aftersales-text);
  margin: 0 0 12px;
  line-height: 1.5;
}

.aftersales-repair__card-body p {
  font-family: 'Mulish', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--aftersales-text);
  margin: 0 0 12px;
}

.aftersales-repair__card-body ul {
  padding-left: 20px;
  margin: 0;
}

.aftersales-repair__card-body li {
  font-family: 'Mulish', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--aftersales-text);
  margin-bottom: 6px;
}

/* --- Card Body Scroll (Figma: body h-287px, scrollable) --- */
.aftersales-repair__card-body {
  flex: 1;
  min-height: 0;
  max-height: 287px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #1464F4 #D9E1E2;
}

.aftersales-repair__card-body::-webkit-scrollbar {
  width: 5px;
}

.aftersales-repair__card-body::-webkit-scrollbar-track {
  background: #D9E1E2;
  border-radius: 200px;
}

.aftersales-repair__card-body::-webkit-scrollbar-thumb {
  background: #1464F4;
  border-radius: 200px;
}

/* --- Cam ket section: text above, image below (column layout per Figma) --- */
.aftersales-page--repair .aftersales-imgtext {
  flex-direction: column;
}

.aftersales-page--repair .aftersales-imgtext__image {
  flex: none;
  width: 100%;
  max-width: 100%;
}

.aftersales-page--repair .aftersales-imgtext__image img {
  aspect-ratio: 847 / 398;
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* --- FAQ anchor div (invisible, used as scroll target for xe-may #faq sidebar link) --- */
.aftersales-repair__faq-anchor {
  display: block;
  height: 0;
  scroll-margin-top: calc(var(--aftersales-header-height) + 24px);
}

/* --- CMS Paragraph Spacing (CMS-driven content only) --- */
.aftersales-repair__categories .paragraph {
  margin-bottom: 40px;
}

.aftersales-repair__categories .paragraph:last-child {
  margin-bottom: 0;
}

.aftersales-repair__commitment .paragraph {
  margin-bottom: 24px;
}

/* --- EBus: 2-column static grid (Figma node 7929:93304, gap-[32px]) --- */
.aftersales-repair__cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

/* Grid card: top corners rounded only (image clips to card top-radius) */
.aftersales-repair__cards-grid .aftersales-repair__card {
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  border: 1px solid var(--aftersales-border);
}

.aftersales-repair__cards-grid .aftersales-repair__card-image img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 398 / 287;
  object-fit: cover;
}

/* Grid card body: bg #F8F9FA, p-16px, max-h-287px with scrollbar (Figma spec) */
.aftersales-repair__cards-grid .aftersales-repair__card-body {
  background: var(--aftersales-bg-light);
  padding: 16px;
  max-height: 287px;
  overflow-y: auto;
}

.aftersales-repair__cards-grid .aftersales-repair__card-body::-webkit-scrollbar {
  width: 5px;
}

.aftersales-repair__cards-grid .aftersales-repair__card-body::-webkit-scrollbar-track {
  background: #D9E1E2;
  border-radius: 200px;
}

.aftersales-repair__cards-grid .aftersales-repair__card-body::-webkit-scrollbar-thumb {
  background: #1464F4;
  border-radius: 200px;
}


/* --- Single-slide carousel (xe-may: 1 card per view, horizontal layout) --- */
.aftersales-carousel--single .aftersales-carousel__slide {
  flex: 0 0 100%;
  max-width: 100%;
}

.aftersales-carousel--single .aftersales-repair__card {
  display: flex;
  flex-direction: row;
  border-radius: 10px;
  height: 265px;
}

.aftersales-carousel--single .aftersales-repair__card-image {
  flex: 0 0 398px;
  width: 398px;
}

.aftersales-carousel--single .aftersales-repair__card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: auto;
  border-radius: 10px 0 0 10px;
}

.aftersales-carousel--single .aftersales-repair__card-body {
  flex: 1;
  min-width: 0;
  max-height: 265px;
  overflow-y: auto;
  border-radius: 0 10px 10px 0;
}

/* --- Phụ tùng chính hãng card (background image, text overlay 50% left) --- */
.aftersales-repair__parts-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background-color: #1F2125;
  background-size: cover;
  background-position: right center;
  min-height: 260px;
}

.aftersales-repair__parts-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: rgba(31, 33, 37, 0.85);
  border-radius: 10px;
  z-index: 1;
}

.aftersales-repair__parts-content {
  position: relative;
  z-index: 2;
  width: 50%;
  padding: 32px;
  color: #fff;
  font-family: 'Mulish', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.aftersales-repair__parts-content p {
  margin: 0 0 16px;
  color: #fff;
}

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

.aftersales-repair__parts-content strong {
  font-weight: 700;
}

.aftersales-repair__parts-content .aftersales-footnote {
  font-size: 13px;
  color: #fff;
  margin-top: 8px;
}

.aftersales-repair__parts-content .aftersales-section__title {
  color: #fff;
}

.aftersales-repair__parts-content .aftersales-section__icon {
  color: #fff;
}

/* Sub heading for quy-trinh section */
.aftersales-section__subtitle {
  font-family: 'VinFast', 'Mulish', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: #1f2125;
  margin: 0 0 24px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .aftersales-repair__cards-grid {
    grid-template-columns: 1fr;
  }

  /* On mobile: grid cards show all content */
  .aftersales-repair__cards-grid .aftersales-repair__card-body {
    max-height: none;
    overflow-y: visible;
  }

  /* Carousel slides: aspect-ratio-based height with scroll */
  .aftersales-repair__card-body {
    flex: none;
    max-height: none;
    height: auto;
    aspect-ratio: 398 / 287;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Single-slide carousel: stack vertically on mobile */
  .aftersales-carousel--single .aftersales-repair__card {
    flex-direction: column;
  }

  .aftersales-carousel--single .aftersales-repair__card-image {
    flex: none;
    width: 100%;
  }

  .aftersales-carousel--single .aftersales-repair__card-image img {
    border-radius: 10px 10px 0 0;
    height: auto;
    aspect-ratio: 398 / 287;
  }

  .aftersales-carousel--single .aftersales-repair__card-body {
    border-radius: 0 0 10px 10px;
  }

  .aftersales-repair__categories .paragraph {
    margin-bottom: 24px;
  }

  .aftersales-page--repair .aftersales-imgtext__image img {
    aspect-ratio: 400 / 270;
  }

  .aftersales-repair__parts-content {
    width: 100%;
    padding: 20px 16px;
  }

  .aftersales-repair__parts-card::before {
    width: 100%;
  }

}

@media (max-width: 480px) {
  .aftersales-repair__card-body {
    padding: 12px;
  }

  .aftersales-repair__card-body h3 {
    font-size: 18px;
  }
}
