#escooter-warranty-book,
#ebus-warranty-book,
#car-warranty-book,
#warranty-book-dropdown {
  scroll-margin-top: calc(var(--aftersales-header-height) + 24px);
}

/* Figma: sidebar has pt-80px on warranty pages */
.aftersales-page--warranty .aftersales-sidebar {
  padding-top: 8px;
}

@media (max-width: 768px) {
  .aftersales-page--warranty .aftersales-sidebar {
    padding-top: 0;
  }
}

.aftersales-page--warranty .aftersales-section .paragraph {
  margin-bottom: 32px;
}

.aftersales-page--warranty .aftersales-section .paragraph:last-child {
  margin-bottom: 0;
}

/* Content-level prose: paragraphs, lists */
.aftersales-page--warranty .aftersales-section p {
  font-family: 'Mulish', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: #1f2125;
  margin: 0 0 16px;
}

.aftersales-page--warranty .aftersales-section p:last-child {
  margin-bottom: 0;
}

.aftersales-page--warranty .aftersales-section p.aftersales-section__subtitle {
  font-family: 'VinFast', 'Mulish', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: #1f2125;
  margin: 0 0 12px;
}

.aftersales-page--warranty .aftersales-section ul:not(.aftersales-doc-dropdown__list) {
  padding-left: 24px;
  margin: 0 0 16px;
  list-style: disc;
}

.aftersales-page--warranty .aftersales-section ul:not(.aftersales-doc-dropdown__list):last-child {
  margin-bottom: 0;
}

.aftersales-page--warranty .aftersales-section li:not(.aftersales-doc-dropdown__list li) {
  font-family: 'Mulish', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: #1f2125;
  margin-bottom: 8px;
}

.aftersales-page--warranty .aftersales-section li:last-child {
  margin-bottom: 0;
}

.aftersales-warranty__links {
  margin-top: 16px;
}

.aftersales-warranty__links a {
  display: inline-block;
  padding: 16px 24px;
  background: var(--aftersales-primary);
  color: var(--aftersales-white);
  text-decoration: none;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-right: 8px;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.aftersales-warranty__links a:hover {
  background: var(--aftersales-primary-dark);
  color: var(--aftersales-white);
}

.aftersales-warranty__docs {
  margin-top: 24px;
  border-top: 1px solid var(--aftersales-border);
}

.aftersales-warranty__doc-group {
  border-bottom: 1px solid var(--aftersales-border);
}

.aftersales-warranty__doc-links {
  list-style: none;
  margin: 0;
  padding: 0 0 16px 16px;
}

.aftersales-warranty__doc-links li {
  margin-bottom: 8px;
}

.aftersales-warranty__doc-links a {
  color: var(--aftersales-primary);
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.aftersales-warranty__doc-links a::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  /* icon fill updated to match --aftersales-primary (#1464F4) from design system */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%231464F4' viewBox='0 0 16 16'%3E%3Cpath d='M14 4.5V14a2 2 0 01-2 2H4a2 2 0 01-2-2V2a2 2 0 012-2h5.5L14 4.5zM9.5 3A1.5 1.5 0 018 1.5V0H4a1 1 0 00-1 1v14a1 1 0 001 1h8a1 1 0 001-1V4.5H9.5z'/%3E%3C/svg%3E") no-repeat center;
  flex-shrink: 0;
}

.aftersales-warranty__doc-links a:hover {
  text-decoration: underline;
}

.aftersales-warranty__sub {
  margin-top: 24px;
  padding: 24px;
  background: var(--aftersales-bg-light);
  border-radius: 8px;
}

.aftersales-warranty__sub .paragraph {
  margin-bottom: 16px;
}

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

/* Desktop doc buttons visible by default; hidden on mobile */
.aftersales-doc-buttons--mobile {
  display: none;
}

@media (max-width: 768px) {
  /* CTA link buttons stack full-width on mobile */
  .aftersales-warranty__links a {
    display: block;
    text-align: center;
    margin-right: 0;
  }

  .aftersales-warranty__sub {
    padding: 16px;
  }

  /* Doc-button row already has flex-direction: column via common.css;
     ensure doc-links text stays legible at mobile widths */
  .aftersales-warranty__doc-links a {
    font-size: 13px;
  }

  /* Exclusion items: slightly tighter gap at tablet */
  .aftersales-warranty__exclusion-item {
    gap: 8px;
    margin-bottom: 10px;
  }

}

/* --- Exclusion items (Section 3 Lưu ý bảo hành) --- */
.aftersales-warranty__exclusion-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.aftersales-warranty__exclusion-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

/* --- Responsive: small phones (≤480px) --- */
@media (max-width: 480px) {
  .aftersales-warranty__links {
    margin-top: 12px;
  }

  .aftersales-warranty__links a {
    padding: 12px 16px;
    font-size: 11px;
    letter-spacing: 1px;
  }

  .aftersales-warranty__sub {
    padding: 12px;
    margin-top: 16px;
    border-radius: 6px;
  }

  .aftersales-warranty__sub .paragraph {
    margin-bottom: 12px;
  }

  .aftersales-warranty__docs {
    margin-top: 16px;
  }

  .aftersales-warranty__doc-links {
    padding: 0 0 12px 12px;
  }

  .aftersales-warranty__doc-links a {
    font-size: 12px;
  }

  /* Exclusion items: smaller icon, reduced gap on small phones */
  .aftersales-warranty__exclusion-item {
    gap: 6px;
    margin-bottom: 8px;
  }

  .aftersales-warranty__exclusion-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
}

/* --- Sidebar dropdown (Sổ bảo hành ô tô) --- */
.aftersales-sidebar__cta-dropdown {
  margin: 16px 0 0;
}

.aftersales-sidebar__cta-dropdown-toggle {
  width: 100%;
  cursor: pointer;
  text-align: left;
}

.aftersales-sidebar__cta-dropdown-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.aftersales-sidebar__cta-dropdown-toggle svg {
  transition: transform 0.3s ease;
}

.aftersales-sidebar__cta-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #1464f4;
  border-top: none;
  background: white;
  border-radius: 0 0 3px 3px;
}

.aftersales-sidebar__cta-dropdown-list li {
  border-bottom: 1px solid #e8eef9;
}

.aftersales-sidebar__cta-dropdown-list li:last-child {
  border-bottom: none;
}

.aftersales-sidebar__cta-dropdown-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  color: #1F2125;
  text-decoration: none;
  font-family: 'Mulish', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  transition: background 0.2s;
}

.aftersales-sidebar__cta-dropdown-list a:hover {
  background: #F5F7F8;
  color: #1464F4;
}

.aftersales-sidebar__cta-dropdown-list a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #3C3C3C;
}

.aftersales-sidebar__cta-dropdown-toggle[aria-expanded="true"] {
  border-radius: 3px 3px 0 0;
}

/* --- Warranty duration accordions (Section 1) --- */
.aftersales-warranty__duration-accordions {
  margin-top: 32px;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aftersales-warranty__duration-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 0 16px;
  background: none;
  border: none;
  border-bottom: 1px solid #d9e1e2;
  cursor: pointer;
  font-family: 'VinFast', 'Mulish', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--aftersales-text, #1A1A1A);
  text-align: left;
  gap: 24px;
}

/* Both accordion toggles show bottom border per Figma design */

.aftersales-warranty__duration-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.aftersales-warranty__duration-toggle svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.aftersales-warranty__duration-content {
  padding: 16px 0;
}

.aftersales-warranty__duration-content p {
  font-family: 'Mulish', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--aftersales-text, #1A1A1A);
  margin-bottom: 8px;
}

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

.aftersales-warranty__duration-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Mulish', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1F2125;
}
.aftersales-warranty__duration-table th:first-child,
.aftersales-warranty__duration-table td:first-child {
  width: 100%;
}
.aftersales-warranty__duration-table th {
  text-align: left;
  font-weight: 600;
  font-size: 16px;
  color: #1F2125;
  padding: 0 16px 16px 0;
  border-bottom: 1px solid #D9E1E2;
}
.aftersales-warranty__duration-table td {
  padding: 16px 16px 16px 0;
  font-weight: 500;
  border-bottom: 1px solid #D9E1E2;
  vertical-align: top;
}
.aftersales-warranty__duration-table td:last-child,
.aftersales-warranty__duration-table th:last-child {
  padding-right: 0;
  white-space: nowrap;
}
.aftersales-warranty__duration-table tbody tr:last-child td {
  border-bottom: none;
}

/* Section 1: full-width image at bottom of duration section */
/* Figma: aspect-ratio 865/375, border-radius 10px */
.aftersales-warranty__section-image {
  margin-top: 32px;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 865 / 375;
}

.aftersales-warranty__section-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}

@media (max-width: 768px) {
  .aftersales-warranty__duration-toggle {
    font-size: 15px;
    padding: 0 0 12px;
  }

  .aftersales-warranty__duration-content {
    padding: 12px 0;
  }
}

@media (max-width: 480px) {
  .aftersales-warranty__duration-toggle {
    font-size: 14px;
    padding: 0 0 10px;
  }
}

/* --- Section 3: Notice Card (Lưu ý bảo hành) --- */
/* Figma: text 384px + image 463px = 847px (exact content width), no gap between them */
.aftersales-warranty__notice-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 32px;
}

.aftersales-warranty__notice-text {
  background: #f8f9fa;
  width: 384px;
  height: 421px;
  padding: 16px;
  border-radius: 10px 0 0 10px;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Custom scrollbar for notice text */
.aftersales-warranty__notice-text {
  scrollbar-width: thin;
  scrollbar-color: #1464f4 #D9E1E2;
}
.aftersales-warranty__notice-text::-webkit-scrollbar {
  width: 5px;
}
.aftersales-warranty__notice-text::-webkit-scrollbar-track {
  background: #D9E1E2;
  border-radius: 200px;
}
.aftersales-warranty__notice-text::-webkit-scrollbar-thumb {
  background: #1464f4;
  border-radius: 200px;
}

.aftersales-warranty__notice-text p {
  font-family: 'Mulish', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  color: #1f2125;
  margin: 0;
}

.aftersales-warranty__notice-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.aftersales-warranty__notice-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.aftersales-warranty__notice-item span {
  font-family: 'Mulish', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  color: #1f2125;
}

.aftersales-warranty__notice-image {
  width: 463px;
  height: 421px;
  flex-shrink: 0;
  border-radius: 0 10px 10px 0;
  overflow: hidden;
}

.aftersales-warranty__notice-image img {
  width: 100%;
  /*height: 100%;*/
  /*object-fit: cover;*/
  display: block;
}

/* --- Section 4: Parts Slide Card (Bảo hành phụ tùng) --- */
/* Figma: gap-16px between section-header and carousel within each group */
#replacement-parts .aftersales-section__header {
  margin-bottom: 16px;
}

/* Figma: 40px gap between the two carousel groups (body gap-40px) */
#replacement-parts .aftersales-section__header:not(:first-child) {
  margin-top: 40px;
}

/* Carousel header: contains prev/next nav buttons, aligned to the right */
.aftersales-warranty__parts-carousel-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0;
}

/* Gap between two adjacent carousels within the same section */
.aftersales-warranty__parts-carousel + .aftersales-warranty__parts-carousel {
  margin-top: 32px;
}

/* Gap between an intro paragraph and the carousel that follows */
.aftersales-warranty__parts-carousel + p,
p + .aftersales-warranty__parts-carousel {
  margin-top: 16px;
}

.aftersales-warranty__parts-carousel {
  margin-top: 0;
}

.aftersales-warranty__parts-slide {
  /* Layout props shared by hidden and active states */
  align-items: center;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  /* Visibility controlled below via display: none / is-active override */
}

.aftersales-warranty__parts-slide-image {
  flex: none;
  width: 398px;
  height: 287px;
  border-radius: 10px 0 0 10px;
  overflow: hidden;
}

.aftersales-warranty__parts-slide-image img {
  width: 100%;
  height: 100%;
  /*object-fit: cover;*/
  display: block;
}

.aftersales-warranty__parts-slide-content {
  flex: 1;
  background: #f8f9fa;
  height: 287px;
  padding: 16px;
  border-radius: 0 10px 10px 0;
  overflow-y: auto;
  position: static;
}

/* Custom scrollbar for parts content */
.aftersales-warranty__parts-slide-content {
  scrollbar-width: thin;
  scrollbar-color: #1464f4 transparent;
}
.aftersales-warranty__parts-slide-content::-webkit-scrollbar {
  width: 5px;
}
.aftersales-warranty__parts-slide-content::-webkit-scrollbar-track {
  background: #D9E1E2;
  border-radius: 200px;
}
.aftersales-warranty__parts-slide-content::-webkit-scrollbar-thumb {
  background: #1464f4;
  border-radius: 200px;
}

.aftersales-warranty__parts-slide-nav {
  position: static;
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.aftersales-warranty__parts-nav-btn {
  width: 28px;
  height: 28px;
  border: 1.4px solid rgba(0, 0, 0, 0.16);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  padding: 0;
}

.aftersales-warranty__parts-nav-btn:hover {
  background: #F5F7F8;
  border-color: rgba(0, 0, 0, 0.3);
}

.aftersales-warranty__parts-slide-content h4 {
  font-family: 'Mulish', sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  padding-right: 0;
  color: #1f2125;
  line-height: 1.5;
}

.aftersales-warranty__parts-slide-content p {
  font-family: 'Mulish', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  margin: 0 0 0;
  color: #1f2125;
}

.aftersales-warranty__parts-slide-content ul {
  padding-left: 24px;
  margin: 0 0 8px;
  list-style: disc;
}

.aftersales-warranty__parts-slide-content li {
  font-family: 'Mulish', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 0;
  color: #1f2125;
}

/* Slides wrapper: fixed height prevents layout shifts when switching slides */
.aftersales-warranty__parts-slides-wrapper {
  position: relative;
  height: 287px;
  overflow: hidden;
}

/* All slides stacked via absolute positioning; only active one visible */
.aftersales-warranty__parts-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.aftersales-warranty__parts-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}

/* Dots pagination — hidden when there is only 1 slide (JS removes from DOM) */
.aftersales-warranty__parts-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

/* Support template class name "parts-pagination" used by Twig template */
.aftersales-warranty__parts-pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.aftersales-warranty__parts-dot {
  width: 8px;
  height: 8px;
  border-radius: 50px;
  background: rgba(46, 67, 143, 0.2);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: width 0.2s ease, background 0.2s ease, border-radius 0.2s ease;
}

.aftersales-warranty__parts-dot--active,
.aftersales-warranty__parts-dot.is-active {
  background: #1464F4;
  width: 20px;
  height: 8px;
  border-radius: 4px;
}

/* --- Section 5: Accessory Icon Cards (Bảo hành phụ kiện) --- */
.aftersales-warranty__accessory-cards {
  display: flex;
  gap: 32px;
  margin-top: 32px;
}

.aftersales-warranty__accessory-card {
  flex: 1;
  padding: 0;
  height: 400px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Remove any border inherited from Porto/Bootstrap on all cards */
  border: none !important;
  border-left: none !important;
}

/* Scrollable content wrapper — icon stays fixed, only text scrolls */
.aftersales-warranty__accessory-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #1464f4 transparent;
  -webkit-overflow-scrolling: touch;
}

.aftersales-warranty__accessory-content::-webkit-scrollbar {
  width: 5px;
}
.aftersales-warranty__accessory-content::-webkit-scrollbar-track {
  background: transparent;
}
.aftersales-warranty__accessory-content::-webkit-scrollbar-thumb {
  background: #1464f4;
  border-radius: 200px;
}


.aftersales-warranty__accessory-icon {
  margin-bottom: 12px;
}

.aftersales-warranty__accessory-icon img {
  display: block;
  width: 56px;
  height: 56px;
}

.aftersales-warranty__accessory-card p {
  font-family: 'Mulish', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: #1f2125;
  margin: 0 0 8px;
}

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

.aftersales-warranty__accessory-card p:first-of-type {
  font-size: 18px;
}

@media (max-width: 768px) {
  .aftersales-page--warranty .aftersales-hero__actions .aftersales-btn--primary,
  .aftersales-warranty-hero-mobile-hide {
    display: none !important;
  }

  .aftersales-page--warranty .aftersales-hero__actions .aftersales-btn--outline {
    white-space: normal;
    max-width: 191px;
    padding: 16px;
  }

  .aftersales-warranty__notice-card {
    flex-direction: column;
    gap: 20px;
  }
  .aftersales-warranty__notice-text {
    width: 100%;
    height: auto;
    max-height: 389px;
    border-radius: 0;
    gap: 16px;
    padding: 16px;
    overflow-y: auto;
  }
  .aftersales-warranty__notice-image {
    width: 100%;
    height: auto;
    aspect-ratio: 400 / 270;
    border-radius: 10px;
  }
  .aftersales-warranty__parts-carousel {
    gap: 16px;
  }
  .aftersales-warranty__parts-slides-wrapper {
    height: auto;
    overflow: visible;
  }
  .aftersales-warranty__parts-slide {
    display: none;
    flex-direction: column;
    position: relative;
    opacity: 1;
  }
  .aftersales-warranty__parts-slide.is-active {
    display: flex;
    flex-direction: column;
    position: relative;
  }
  .aftersales-warranty__parts-slide-image {
    width: 100%;
    aspect-ratio: 398 / 287;
    height: auto;
    border-radius: 10px 10px 0 0;
  }
  .aftersales-warranty__parts-slide-content {
    flex: none;
    height: auto;
    aspect-ratio: 398 / 287;
    border-radius: 0 0 10px 10px;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .aftersales-warranty__parts-slide-nav {
    gap: 14px;
  }
  .aftersales-warranty__parts-pagination {
    margin-top: 16px;
  }
  .aftersales-warranty__accessory-cards {
    flex-direction: column;
    gap: 32px;
  }
  .aftersales-warranty__accessory-card {
    height: auto;
  }
  .aftersales-warranty__duration-accordions {
    margin-top: 20px;
    margin-bottom: 20px;
  }
  .aftersales-warranty__duration-table th:first-child,
  .aftersales-warranty__duration-table td:first-child {
    width: 50%;
  }
  .aftersales-warranty__duration-table th:last-child,
  .aftersales-warranty__duration-table td:last-child {
    white-space: normal;
  }
  .aftersales-warranty__section-image {
    margin-top: 20px;
  }
}
