/* =========================================================
 * MUSK - KHÁCH HÀNG NÓI VỀ MUSKIS
 * Đặt trong Section, marquee tràn full width
 * ========================================================= */

.musk-customer-testimonials {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  padding: 100px 0px 50px 0px;
  color: #111a33;
}

.musk-customer-testimonials,
.musk-customer-testimonials *,
.musk-customer-testimonials *::before,
.musk-customer-testimonials *::after {
  box-sizing: border-box;
}

/* =========================================================
 * HEADER
 * ========================================================= */

.musk-customer-testimonials__header {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(100% - 40px);
  max-width: 1240px;
  margin: 0 auto 58px;
  text-align: center;
}

.musk-customer-testimonials__header-description {
  max-width: 720px;
  margin: 10px auto 0;
  color: #29394f;
  font-weight: 400;
  line-height: 1.6;
}

/* =========================================================
 * MARQUEE
 * ========================================================= */

.musk-customer-testimonials__marquee {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow: hidden;
  /*
    * Làm mờ nhẹ hai mép nhưng vẫn thấy một phần card.
    */
    -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000000 3.5%,
    #000000 96.5%,
    transparent 100%
    );
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000000 3.5%,
    #000000 96.5%,
    transparent 100%
    );
}

.musk-customer-testimonials__track {
  display: flex;
  align-items: stretch;
  width: max-content;
  transform: translate3d(0, 0, 0);
  animation: musk-customer-testimonials-scroll 44s linear infinite;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/*
 * Mỗi group có cùng chiều rộng.
 * Padding phải tạo ra khoảng cách chính xác tại điểm nối.
 */

.musk-customer-testimonials__group {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  padding-right: 22px;
  gap: 22px;
}

/* Dừng khi rê chuột */

.musk-customer-testimonials[data-pause-hover="1"] .musk-customer-testimonials__marquee:hover .musk-customer-testimonials__track {
  animation-play-state: paused;
}

/* JavaScript dừng khi section ra khỏi màn hình */

.musk-customer-testimonials.is-paused .musk-customer-testimonials__track {
  animation-play-state: paused;
}

@keyframes musk-customer-testimonials-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-50%, 0, 0);
  }
}

/* =========================================================
 * ITEM
 * ========================================================= */

.musk-customer-testimonials__item {
  display: flex;
  flex: 0 0 340px;
  width: 340px;
  min-width: 340px;
  padding: 0;
}

/* =========================================================
 * CARD
 * ========================================================= */

.musk-customer-testimonials__card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 380px;
  padding: 34px 31px 27px;
  overflow: hidden;
  border-radius: 15px;
  color: #111a33;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.musk-customer-testimonials__card--light {
  background: linear-gradient(145deg, #f7f8fa, #efefef);
}

.musk-customer-testimonials__card--blue {
  background: linear-gradient(145deg, #2d69ff, #1d57ed);
  color: #ffffff;
}

.musk-customer-testimonials__card--pink {
  background: linear-gradient(145deg, #fceaf5, #f9e2ef);
}

.musk-customer-testimonials__card--purple {
  background: linear-gradient(145deg, #f3eaff, #eee1ff);
}

/* =========================================================
 * QUOTE ICON
 * ========================================================= */

.musk-customer-testimonials__quote-icon {
  display: flex;
  align-items: center;
  width: 35px;
  height: 30px;
  margin-bottom: 19px;
  color: #2464f4;
}

.musk-customer-testimonials__card--blue .musk-customer-testimonials__quote-icon {
  color: #ffffff;
}

.musk-customer-testimonials__quote-icon svg {
  display: block;
  width: 32px;
  height: 25px;
}

/* =========================================================
 * QUOTE CONTENT
 * ========================================================= */

.musk-customer-testimonials__quote {
  flex: 1;
  color: inherit;
  line-height: 1.85;
}

.musk-customer-testimonials__quote p {
  margin: 0;
}

/* =========================================================
 * AUTHOR
 * ========================================================= */

.musk-customer-testimonials__author {
  display: flex;
  align-items: center;
  margin-top: 28px;
  gap: 13px;
}

.musk-customer-testimonials__avatar {
  display: flex;
  flex: 0 0 50px;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: #e6edf8;
}

.musk-customer-testimonials__avatar img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: cover;
  object-position: center;
}

.musk-customer-testimonials__avatar-placeholder {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #7590b9;
}

.musk-customer-testimonials__card--blue .musk-customer-testimonials__avatar-placeholder {
  color: #5a78aa;
}

.musk-customer-testimonials__avatar-placeholder svg {
  width: 80%;
  height: 80%;
}

.musk-customer-testimonials__meta {
  min-width: 0;
}

.musk-customer-testimonials__name {
  margin: 0 0 4px;
  color: inherit;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  font-size: 16px !important;
  text-transform: uppercase;
}

.musk-customer-testimonials__role {
  color: rgba(17, 26, 51, 0.72);
  font-weight: 500;
  font-size: 13px !important;
  line-height: 1.4;
}

.musk-customer-testimonials__card--blue .musk-customer-testimonials__role {
  color: rgba(255, 255, 255, 0.82);
}

/* ---------------------------------------------------------
 * MOBILE NHỎ
 * --------------------------------------------------------- */

@media (hover: hover) {
  .musk-customer-testimonials__card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(21, 45, 90, 0.1);
  }
}

/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 767px) {
  .musk-customer-testimonials {
    padding-top: 62px;
    padding-bottom: 68px;
    padding: 50px 0;
  }

  .musk-customer-testimonials__group {
    padding-right: 14px;
    gap: 14px;
  }

  .musk-customer-testimonials__item {
    flex: 0 0 285px;
    width: 285px;
    min-width: 285px;
  }

  .musk-customer-testimonials__card {
    min-height: 350px;
    padding: 28px 24px 24px;
    border-radius: 13px;
  }

  .musk-customer-testimonials__header {
    margin-bottom: 34px;
    width: calc(100% - 32px);
  }

  .musk-customer-testimonials__header-description {
    margin-top: 7px;
    font-size: 14px !important;
    line-height: 1.6;
  }

  .musk-customer-testimonials__marquee {
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0,
      #000000 6%,
      #000000 94%,
      transparent 100%
      );
    mask-image: linear-gradient(
      to right,
      transparent 0,
      #000000 6%,
      #000000 94%,
      transparent 100%
      );
  }

  .musk-customer-testimonials__quote {
    line-height: 1.75;
  }

  .musk-customer-testimonials__author {
    margin-top: 23px;
  }

  .musk-customer-testimonials__avatar {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .musk-customer-testimonials__marquee {
    overflow-x: auto;
    padding-right: 16px;
    padding-left: 16px;
    -webkit-mask-image: none;
    mask-image: none;
    scrollbar-width: none;
  }

  .musk-customer-testimonials__marquee::-webkit-scrollbar {
    display: none;
  }

  .musk-customer-testimonials__track {
    transform: none;
    animation: none;
  }

  .musk-customer-testimonials__group[aria-hidden="true"] {
    display: none;
  }

  .musk-customer-testimonials__card {
    transition: none;
  }
}
