/* =========================================================
 * MUSK HOME HERO
 * ========================================================= */

.musk-featured-hero {
  /* Kích thước controls */
  position: relative;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
  background: #0d0d0d;
  color: #fff;
}

/* =========================================================
 * RESET RIÊNG CHO ELEMENT
 * ========================================================= */

.musk-featured-hero,
.musk-featured-hero *,
.musk-featured-hero *::before,
.musk-featured-hero *::after {
  box-sizing: border-box;
}

.musk-featured-hero a {
  font: inherit;
}

.musk-featured-hero button {
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  font: inherit;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  background-image: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
}

.musk-featured-hero button:hover,
.musk-featured-hero button:focus,
.musk-featured-hero button:active {
  box-shadow: none !important;
  transform: none;
}

/* =========================================================
 * SLIDE MASK
 * ========================================================= */

.musk-featured-hero__mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 620px;
  opacity: 0;
  transform-origin: center;
  -webkit-font-smoothing: auto;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 400%;
  mask-size: 400%;
}

.musk-featured-hero__mask.is-active {
  z-index: 2;
  opacity: 1;
}

.musk-featured-hero__container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: center;
}

/* =========================================================
 * VIDEO
 * ========================================================= */

.musk-featured-hero__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 620px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(17, 91, 122, 0.3), transparent 45%),
    #101722;
}

.musk-featured-hero__video video,
.musk-featured-hero__poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.musk-featured-hero__video video {
  z-index: 1;
}

.musk-featured-hero__poster {
  z-index: 0;
}

/* =========================================================
 * OVERLAY
 * ========================================================= */

.musk-featured-hero__gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 25%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.78), transparent 48%);
}

.musk-featured-hero__gradient--dark::before,
.musk-featured-hero__gradient--veil::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.musk-featured-hero__gradient--dark::before {
  background: rgba(0, 0, 0, 0.3);
}

.musk-featured-hero__gradient--veil::after {
  background: rgba(0, 0, 0, 0.48);
}

/* =========================================================
 * TEXT
 * ========================================================= */

.musk-featured-hero__text-container {
  position: absolute;
  left: 0;
  bottom: 48%;
  z-index: 4;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 24px;
  transform: translateY(50%);
  pointer-events: none;
}

.musk-featured-hero__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1120px;
  color: #fff;
  text-align: center;
  pointer-events: auto;
}

.musk-featured-hero__heading {
  max-width: 1100px;
  margin: 0 0 30px;
  color: #fff;
  font-weight: 700;
  line-height: 1.12;
  font-size: 70px !important;
  letter-spacing: 1px !important;
  text-transform: capitalize;
  text-shadow: 0 0 15px rgba(0, 0, 0, 0.25);
}

.musk-featured-hero__subheading {
  max-width: 850px;
  margin: 0;
  font-size: 25px !important;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 400;
  line-height: 1.35;
  text-wrap: balance;
}

/* =========================================================
 * BOTTOM BLUR
 * ========================================================= */

.musk-featured-hero__blur {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: block;
  height: 150px;
  pointer-events: none;
}

/*
 * KHÔNG dùng backdrop-filter ở đây: lớp mờ nằm đè lên video, mỗi
 * khung hình video trình duyệt phải làm mờ lại toàn bộ dải này -
 * bốn lớp chồng nhau là nguyên nhân chính khiến hero giật dần.
 * Thay bằng dải tối chuyển màu tĩnh, nhìn gần giống mà gần như
 * không tốn gì.
 */

.musk-featured-hero__blur {
  background: linear-gradient(
    to top,
    rgba(8, 14, 24, 0.55) 0%,
    rgba(8, 14, 24, 0.22) 45%,
    rgba(8, 14, 24, 0) 100%
  );
}

.musk-featured-hero__blur-layer {
  display: none;
  position: absolute;
  inset: 0;
  background: transparent;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.musk-featured-hero__blur-layer--1 {
  -webkit-mask-image: linear-gradient(
    to top,
    transparent 0 40%,
    #000 60% 80%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to top,
    transparent 0 40%,
    #000 60% 80%,
    transparent 100%
  );
}

.musk-featured-hero__blur-layer--2 {
  -webkit-mask-image: linear-gradient(
    to top,
    transparent 0 20%,
    #000 40% 60%,
    transparent 80% 100%
  );
  mask-image: linear-gradient(
    to top,
    transparent 0 20%,
    #000 40% 60%,
    transparent 80% 100%
  );
}

.musk-featured-hero__blur-layer--3 {
  -webkit-mask-image: linear-gradient(
    to top,
    transparent 0,
    #000 20% 40%,
    transparent 60% 100%
  );
  mask-image: linear-gradient(
    to top,
    transparent 0,
    #000 20% 40%,
    transparent 60% 100%
  );
}

.musk-featured-hero__blur-layer--4 {
  -webkit-mask-image: linear-gradient(to top, #000 0 20%, transparent 40% 100%);
  mask-image: linear-gradient(to top, #000 0 20%, transparent 40% 100%);
}

/* =========================================================
 * CONTROLS
 * ========================================================= */

.musk-featured-hero__controls {
  position: absolute;
  right: 0;
  bottom: 45px;
  left: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  touch-action: manipulation;
}

/* =========================================================
 * NÚT MŨI TÊN
 * ========================================================= */

.musk-featured-hero__button {
  display: inline-flex !important;
  flex: 0 0 56px;
  align-items: center;
  justify-content: center;
  width: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #fff !important;
  line-height: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;
}

.musk-featured-hero__button::before,
.musk-featured-hero__button::after {
  display: none !important;
  content: none !important;
}

.musk-featured-hero__button svg {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.musk-featured-hero__button--next svg {
  transform: rotate(180deg);
}

.musk-featured-hero__button:focus-visible:not(:disabled) {
  border-color: #f3efea !important;
  background: #f3efea !important;
  color: #323232 !important;
  outline: 3px solid rgba(255, 255, 255, 0.35);
  outline-offset: 3px;
}

.musk-featured-hero__button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* =========================================================
 * PROGRESS CONTAINER
 * ========================================================= */

.musk-featured-hero__progress-container {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 56px;
  padding: 18px 32px;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.musk-featured-hero__progress-container::-webkit-scrollbar {
  display: none;
}

/* =========================================================
 * PROGRESS BUTTON
 * Reset mạnh để Flatsome không biến dot thành button lớn
 * ========================================================= */

.musk-featured-hero__progress {
  position: relative;
  display: block !important;
  flex: 0 0 8px;
  width: 8px !important;
  min-width: 8px !important;
  max-width: none !important;
  height: 8px !important;
  min-height: 8px !important;
  max-height: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  white-space: nowrap;
  box-shadow: none !important;
  cursor: pointer;
  transition:
    width 0.3s ease,
    flex-basis 0.3s ease,
    background-color 0.3s ease;
}

.musk-featured-hero__progress::before,
.musk-featured-hero__progress::after {
  display: none !important;
  content: none !important;
}

.musk-featured-hero__progress[data-active="true"] {
  flex-basis: 120px;
  width: 120px !important;
  min-width: 120px !important;
}

.musk-featured-hero__progress:hover,
.musk-featured-hero__progress:focus,
.musk-featured-hero__progress:active {
  min-height: 8px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.musk-featured-hero__progress:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

.musk-featured-hero__progress-background,
.musk-featured-hero__progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  pointer-events: none;
}

.musk-featured-hero__progress-background {
  width: 100%;
  background: #fff;
}

.musk-featured-hero__progress[data-active="true"]
  .musk-featured-hero__progress-background {
  opacity: 0.25;
}

.musk-featured-hero__progress-fill {
  width: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

/* =========================================================
 * ACCESSIBILITY
 * ========================================================= */

.musk-featured-hero__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Firefox: mask + transform không kết hợp ổn định */

@-moz-document url-prefix() {
  .musk-featured-hero__mask,
  .musk-featured-hero__container {
    transform: none !important;
  }
}

/* =========================================================
 * GHI ĐÈ HỆ DÙNG CHUNG
 *
 * Chỉnh .musk-title / .musk-btn cho riêng element này.
 * File element luôn nạp sau style.css nên thắng cascade.
 * ========================================================= */

.musk-featured-hero .musk-btn {
  margin-top: 70px;
}

@media (hover: hover) {
  .musk-featured-hero__button:hover:not(:disabled) {
    border-color: #f3efea !important;
    background: #f3efea !important;
    color: #323232 !important;
    box-shadow: none !important;
  }
}

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

@media (max-width: 767px) {
  .musk-featured-hero__button {
    flex: 0 0 42px;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
  }

  .musk-featured-hero__button svg {
    width: 18px;
    height: 18px;
  }

  .musk-featured-hero__progress[data-active="true"] {
    flex-basis: 68px;
    width: 68px !important;
    min-width: 68px !important;
  }

  .musk-featured-hero__progress-container {
    padding-right: 13px;
    padding-left: 13px;
    flex: 0 1 auto;
    height: 44px;
    padding: 14px 18px;
    gap: 8px;
  }

  .musk-featured-hero {
    min-height: 560px;
  }

  .musk-featured-hero__mask,
  .musk-featured-hero__video {
    min-height: 560px;
  }

  .musk-featured-hero__text-container {
    bottom: 50%;
    padding: 0 20px;
  }

  .musk-featured-hero__heading {
    max-width: 680px;
    margin-bottom: 14px;
    font-size: 40px !important;
    line-height: 1.04;
    text-transform: none;
  }

  .musk-featured-hero__subheading {
    max-width: 560px;
    font-size: 15px !important;
    line-height: 1.45;
  }

  .musk-featured-hero__controls {
    bottom: 24px;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0;
    padding: 0 16px;
  }

  .musk-featured-hero .musk-btn {
    margin-top: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .musk-featured-hero__mask {
    -webkit-mask: none !important;
    mask: none !important;
  }

  .musk-featured-hero *,
  .musk-featured-hero *::before,
  .musk-featured-hero *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
