/* ==========================================================================
   MiSol Home — trang mô phỏng thiết bị, ngôn ngữ "Đêm ấm".
   Giữ nguyên DOM và logic của device-experience.js; chỉ thay lớp trình bày.
   Dùng cùng token với misol.css (nạp trước file này).
   ========================================================================== */

html {
  background: var(--mx-ink);
}

body.mx-device {
  background:
    radial-gradient(900px 520px at 85% -4%, rgba(210, 181, 125, 0.12), transparent 70%),
    radial-gradient(700px 480px at 0% 30%, rgba(26, 67, 56, 0.55), transparent 70%),
    var(--mx-ink);
  color: var(--mx-ivory);
  min-height: 100vh;
}

/* ---------- header ---------- */
.mx-device .mx-header__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
}

.mx-device .mx-header__bar .mx-btn {
  justify-self: end;
}

.mx-dx-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.mx-device .mx-language__toggle {
  border-color: rgba(14, 23, 20, 0.24);
  color: var(--mx-ink);
}

.mx-dx-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.mx-device .back-home {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(14, 23, 20, 0.28);
  border-radius: 50%;
  background: transparent;
  color: var(--mx-ink);
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s;
}

.mx-device .back-home:hover {
  border-color: var(--mx-ink);
  background: rgba(14, 23, 20, 0.06);
}

.mx-device .back-home svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mx-device .experience-product-title {
  max-width: 34ch;
  overflow: hidden;
  color: var(--mx-ink);
  font: 700 1.15rem/1.25 var(--mx-font-heading);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .mx-device .mx-header__bar {
    grid-template-columns: 1fr auto;
  }

  .mx-device .experience-product-title {
    display: none;
  }

  .mx-device .mx-header__bar .mx-btn {
    display: inline-flex;
    min-height: 40px;
    padding: 0 16px;
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .mx-device .mx-logo__word {
    display: none;
  }
}

/* ---------- khung trang ---------- */
.mx-device .experience-page {
  width: min(var(--mx-container), 100% - var(--mx-gutter) * 2);
  margin: calc(var(--mx-header-h) + clamp(24px, 4vw, 48px)) auto 0;
  padding-bottom: clamp(56px, 8vw, 104px);
  min-height: 100svh; /* giữ chỗ để footer không nhảy khi mô phỏng dựng xong */
}

/* Bài viết giải thích: dải ivory sáng nổi trên nền ink, chữ tối để dễ đọc. */
.mx-dx-guide {
  background: var(--mx-ivory);
  color: var(--mx-text);
  padding: clamp(44px, 6vw, 88px) 0 clamp(56px, 8vw, 104px);
  border-radius: clamp(24px, 3vw, 40px) clamp(24px, 3vw, 40px) 0 0;
}
.mx-dx-guide:empty { display: none; }
.mx-dx-guide__inner {
  width: min(820px, 100% - var(--mx-gutter) * 2);
  margin: 0 auto;
}
.mx-dx-guide__intro {
  margin: 0;
  padding-left: 20px;
  border-left: 3px solid var(--mx-champagne);
  color: var(--mx-ink);
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  line-height: 1.6;
}
.mx-dx-guide__inner > section,
.mx-dx-guide__related {
  margin-top: clamp(32px, 4.5vw, 52px);
  padding-top: clamp(28px, 4vw, 44px);
  border-top: 1px solid rgba(14, 23, 20, 0.1);
}
.mx-dx-guide .mx-h2 { margin-top: 0; font-size: clamp(1.375rem, 1.15rem + 0.9vw, 1.875rem); }
.mx-dx-guide .mx-body { max-width: none; margin-top: 14px; }
.mx-dx-guide__list {
  margin-top: 14px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.mx-dx-guide__list li {
  position: relative;
  padding: 14px 18px 14px 44px;
  border-radius: 14px;
  background: #fffdf8;
  border: 1px solid rgba(14, 23, 20, 0.08);
  color: var(--mx-text);
  line-height: 1.6;
}
.mx-dx-guide__list li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 1.35em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mx-champagne);
  box-shadow: 0 0 0 3px rgba(210, 181, 125, 0.25);
}
.mx-dx-guide a { color: var(--mx-bronze); text-decoration: underline; text-underline-offset: 3px; }
.mx-dx-guide .mx-faq { max-width: none; margin-top: 16px; }
.mx-dx-guide .mx-faq summary { color: var(--mx-ink); }
.mx-dx-guide__related ul {
  list-style: none;
  padding: 0;
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.mx-dx-guide__related li a {
  display: block;
  height: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(14, 23, 20, 0.1);
  background: #fffdf8;
  color: var(--mx-forest, var(--mx-ink));
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.mx-dx-guide__related li a:hover { border-color: var(--mx-champagne); transform: translateY(-2px); }

.mx-device .sk02-first-screen,
.mx-device .datic-first-screen,
.mx-device .entec-first-screen {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.8fr);
  align-items: start;
  gap: clamp(20px, 3vw, 40px);
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mx-device .sk02-device-block,
.mx-device .datic-device-block,
.mx-device .entec-device-block {
  gap: 28px;
  padding: clamp(28px, 4vw, 56px) clamp(20px, 3.4vw, 48px) clamp(32px, 4vw, 52px);
  border: 1px solid rgba(210, 181, 125, 0.22);
  border-radius: 32px;
  background:
    radial-gradient(520px 360px at 50% 0%, rgba(210, 181, 125, 0.16), transparent 70%),
    linear-gradient(165deg, #1a4338, #0f1c18 70%);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.4);
}

.mx-device .sk02-experience-intro,
.mx-device .datic-experience-intro,
.mx-device .entec-experience-intro {
  width: min(100%, 560px);
  padding: 0;
}

.mx-device .sk02-experience-intro p,
.mx-device .datic-experience-intro p,
.mx-device .entec-experience-intro p {
  margin: 0 0 14px;
  color: var(--mx-champagne);
  font: 600 12px/1.4 var(--mx-sans);
  letter-spacing: 0.2em !important;
  text-transform: uppercase;
}

.mx-device .sk02-experience-intro h1,
.mx-device .datic-experience-intro h1,
.mx-device .entec-experience-intro h1 {
  max-width: 16ch;
  margin: 0;
  color: var(--mx-ivory);
  font: 800 clamp(2rem, 1.5rem + 2.2vw, 3.25rem) / 1.1 var(--mx-font-heading);
  letter-spacing: -0.012em !important;
  text-wrap: balance;
}

.mx-device .sk02-experience-intro > span,
.mx-device .datic-experience-intro > span,
.mx-device .entec-experience-intro > span {
  display: block;
  max-width: 48ch;
  margin-top: 18px;
  color: var(--mx-muted-light);
  font-size: 1rem;
  line-height: 1.7;
}

.mx-device .sk02-phone-wrap,
.mx-device .door-phone-wrap,
.mx-device .entec-phone-wrap {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-inline: auto;
}

/* điện thoại / thiết bị mô phỏng giữ nền sáng để nổi trên sân khấu tối */
.mx-device .sk02-phone,
.mx-device .door-phone,
.mx-device .entec-phone,
.mx-device .washer-unit {
  max-width: 100%;
  border-radius: 34px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.mx-device .sk02-phone,
.mx-device .door-phone,
.mx-device .entec-phone {
  width: min(100%, 440px);
}

/* màu chữ của màn hình mô phỏng (nền sáng) không kế thừa từ nền tối của trang */
.mx-device .sk02-phone,
.mx-device .door-phone,
.mx-device .entec-phone,
.mx-device .washer-phone {
  color: #12332b;
}

/* máy giặt đặt thẳng lên sân khấu tối nên chữ phụ phải sáng */
.mx-device .washer-unit {
  color: var(--mx-ivory);
}

.mx-device .washer-unit__status {
  color: var(--mx-champagne-soft);
}

.mx-device [data-washer-add],
.mx-device [data-washer-add] small {
  color: #12332b;
}

.mx-device [data-washer-primary]:disabled {
  opacity: 0.6;
}

.mx-device .button-dark,
.mx-device [data-washer-primary] {
  color: #fff;
}

/* khung hướng dẫn */
.mx-device .sk02-support,
.mx-device .datic-support,
.mx-device .entec-support {
  align-self: start;
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(245, 241, 232, 0.14);
  border-radius: 28px;
  background: rgba(245, 241, 232, 0.05);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: none;
}

.mx-device .sk02-support-head {
  align-items: flex-start;
  gap: 14px;
}

.mx-device .sk02-support-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--mx-champagne);
  color: var(--mx-ink);
  box-shadow: none;
}

.mx-device .sk02-support-head h2 {
  color: var(--mx-ivory);
  font: 700 clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem) / 1.25 var(--mx-font-heading);
  letter-spacing: normal !important;
}

.mx-device .sk02-video-frame {
  margin-top: 22px;
  border-radius: 20px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
}

.mx-device .phone-more-features {
  color: #7d8a82;
}

.mx-device .washer-phone-column {
  display: grid;
  align-content: start;
  gap: 22px;
}

.mx-device .washer-phone-column .sk02-support {
  align-self: start;
}

/* ---------- thẻ chọn thiết bị (desktop) ---------- */
.mx-dx-buy {
  display: none;
}

@media (min-width: 921px) {
  .mx-device .sk02-device-block,
  .mx-device .datic-device-block,
  .mx-device .entec-device-block {
    grid-row: span 2;
  }

  .mx-dx-buy {
    position: sticky;
    top: calc(var(--mx-header-h) + 24px);
    display: block;
    grid-column: 2;
    align-self: start;
    padding: clamp(24px, 2.6vw, 36px);
    border: 1px solid rgba(210, 181, 125, 0.32);
    border-radius: 28px;
    background:
      radial-gradient(360px 220px at 100% 0%, rgba(210, 181, 125, 0.18), transparent 70%),
      rgba(245, 241, 232, 0.04);
  }

  .mx-dx-cta {
    display: none;
  }
}

.mx-dx-buy__tag {
  color: var(--mx-champagne);
  font: 600 12px/1.4 var(--mx-sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.mx-dx-buy h2 {
  margin-top: 12px;
  color: var(--mx-ivory);
  font: 700 clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem) / 1.2 var(--mx-font-heading);
}

.mx-dx-buy ul {
  margin-top: 18px;
}

.mx-dx-buy li {
  position: relative;
  padding: 11px 0 11px 26px;
  border-top: 1px solid var(--mx-line-light);
  color: var(--mx-muted-light);
  font-size: 15px;
}

.mx-dx-buy li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--mx-champagne);
  transform: translateY(-50%) rotate(45deg);
}

.mx-dx-buy__actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.mx-dx-buy small {
  display: block;
  margin-top: 16px;
  color: rgba(245, 241, 232, 0.5);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---------- CTA sau khi thử ---------- */
.mx-dx-cta {
  padding: clamp(64px, 9vw, 120px) 0;
  background:
    radial-gradient(900px 400px at 50% 0%, rgba(210, 181, 125, 0.16), transparent 70%),
    var(--mx-forest);
  color: var(--mx-ivory);
}

.mx-dx-cta[hidden] {
  display: none;
}

.mx-dx-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px 64px;
  width: min(var(--mx-container), 100% - var(--mx-gutter) * 2);
  margin-inline: auto;
}

.mx-dx-cta__title {
  margin-top: 16px;
  font: 700 clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem) / 1.15 var(--mx-font-heading);
  text-wrap: balance;
}

.mx-dx-cta__lead {
  max-width: 52ch;
  margin-top: 16px;
  color: var(--mx-muted-light);
  line-height: 1.7;
}

.mx-dx-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .mx-device .sk02-first-screen,
  .mx-device .datic-first-screen,
  .mx-device .entec-first-screen {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .mx-device {
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* bỏ khung lồng khung: mô phỏng tràn gần hết chiều ngang */
  .mx-device .sk02-device-block,
  .mx-device .datic-device-block,
  .mx-device .entec-device-block {
    gap: 22px;
    /* nở đều hai bên: width phải tăng bằng đúng phần margin âm, nếu không thẻ bị lệch trái */
    width: calc(100% + var(--mx-gutter));
    max-width: none;
    margin-inline: calc(var(--mx-gutter) * -0.5);
    padding: 28px 12px 28px;
    border-radius: 26px;
  }

  .mx-device .sk02-experience-intro,
  .mx-device .datic-experience-intro,
  .mx-device .entec-experience-intro {
    padding-inline: 8px;
  }

  .mx-device .sk02-experience-intro h1,
  .mx-device .datic-experience-intro h1,
  .mx-device .entec-experience-intro h1 {
    font-size: clamp(2.3rem, 10.4vw, 3rem);
  }

  .mx-device .sk02-experience-intro > span,
  .mx-device .datic-experience-intro > span,
  .mx-device .entec-experience-intro > span {
    font-size: 0.95rem;
  }

  .mx-device .sk02-phone,
  .mx-device .door-phone,
  .mx-device .entec-phone,
  .mx-device .washer-unit {
    width: 100%;
    border-radius: 28px;
  }

  .mx-device .sk02-support,
  .mx-device .datic-support,
  .mx-device .entec-support {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .mx-dx-cta__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .mx-dx-cta__actions {
    flex-direction: column;
  }

  .mx-dx-cta__actions .mx-btn {
    min-height: 56px;
  }

  .mx-device .mx-footer__bottom {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
}
