:root {
  --vi-preview-navy: #071f32;
  --vi-preview-green: #8fba45;
}

html[lang="vi"] {
  scroll-behavior: smooth;
}

html[lang="vi"] body {
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

html[lang="vi"] p,
html[lang="vi"] li,
html[lang="vi"] td,
html[lang="vi"] th,
html[lang="vi"] label,
html[lang="vi"] small {
  hyphens: auto;
  overflow-wrap: break-word;
}

html[lang="vi"] h1,
html[lang="vi"] h2,
html[lang="vi"] h3,
html[lang="vi"] h4 {
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
}

html[lang="vi"] a,
html[lang="vi"] button,
html[lang="vi"] input,
html[lang="vi"] select,
html[lang="vi"] textarea {
  font: inherit;
}

.language-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  line-height: 1;
}

.language-select__control {
  min-width: 92px;
  margin: 0;
  padding: 2px 18px 2px 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
}

.language-select__control:focus-visible {
  outline: 2px solid #8ab83f;
  outline-offset: 3px;
  border-radius: 2px;
}

.language-select__control option {
  background: #ffffff;
  color: #071f32;
}

.language-select .language-select__chevron {
  position: absolute;
  right: 0;
  width: 14px;
  height: 14px;
  margin: 0;
  pointer-events: none;
}

.language-select--mobile {
  display: none;
  color: #071f32;
}

@media (max-width: 1279.98px) {
  .language-select--mobile {
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
  }

  .language-select--mobile > svg:first-child {
    width: 18px;
    height: 18px;
    margin: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
  }

  .language-select--mobile .language-select__control {
    min-width: 86px;
  }
}

@media (max-width: 767.98px) {
  .language-select--mobile > svg:first-child {
    display: none;
  }

  .language-select--mobile .language-select__control {
    width: 76px;
    min-width: 76px;
    padding-right: 16px;
    font-size: 12px;
  }
}

/* Keep the localized home hero on the same responsive image and crop system as English. */
@media (min-width: 768px) {
  html[lang="vi"] .hero--figma-crop {
    --hero-bg-url: url("assets/hero/home-hero-responsive-normal-v2-2400.webp?v=20260713a&v=20260715asset1");
    --hero-bg-position: center center;
    --hero-stat-height: min(100px, 5.2083vw);
    --hero-stat-bottom: 0px;
    --hero-side-pad: max(24px, 16.6667vw);
    --hero-image-extra: 0px !important;
    --hero-image-shift: 0px !important;
    height: clamp(600px, 48.75vw, 936px) !important;
    background: #071f36 !important;
  }

  html[lang="vi"] .hero--figma-crop::before {
    display: block !important;
    z-index: 1 !important;
    background: linear-gradient(74.376deg, rgba(6, 32, 59, 0.84) 9.4605%, rgba(6, 32, 59, 0.72) 40.475%, rgba(6, 32, 59, 0) 72.758%) !important;
  }

  html[lang="vi"] .hero--figma-crop::after {
    display: block !important;
    z-index: 1 !important;
    top: auto !important;
    height: 28% !important;
    background: linear-gradient(180deg, rgba(6, 32, 59, 0), rgba(6, 32, 59, 0.34)) !important;
  }

  html[lang="vi"] .hero--figma-crop .hero__bg {
    inset: 0 !important;
    overflow: hidden !important;
    background-image: var(--hero-bg-url) !important;
    background-position: var(--hero-bg-position) !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
  }

  html[lang="vi"] .hero--figma-crop .hero__bg::before,
  html[lang="vi"] .hero--figma-crop .hero__bg::after {
    content: none !important;
  }

  html[lang="vi"] .hero--figma-crop .hero__content {
    display: flex !important;
    align-items: center !important;
    width: min(1440px, calc(100% - 48px)) !important;
    height: calc(100% - var(--hero-stat-height)) !important;
  }

  html[lang="vi"] .hero--figma-crop .hero__copy {
    padding-top: 0 !important;
    transform: translateY(5%) !important;
  }

  html[lang="vi"] .hero--figma-crop .hero-stats {
    right: 0 !important;
    bottom: var(--hero-stat-bottom) !important;
    left: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: center !important;
    width: auto !important;
    height: var(--hero-stat-height) !important;
    padding: 0 var(--hero-side-pad) !important;
    transform: none !important;
    background: rgba(6, 32, 59, 0.18) !important;
    backdrop-filter: blur(4px) !important;
  }

  html[lang="vi"] .hero--figma-crop .hero-stats div,
  html[lang="vi"] .hero--figma-crop .hero-stats div:nth-child(1),
  html[lang="vi"] .hero--figma-crop .hero-stats div:nth-child(2),
  html[lang="vi"] .hero--figma-crop .hero-stats div:nth-child(3),
  html[lang="vi"] .hero--figma-crop .hero-stats div:nth-child(4) {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    padding: 0 0 0 min(48px, 2.5vw) !important;
  }

  html[lang="vi"] .hero--figma-crop .hero-stats div:not(:first-child)::before {
    top: 50% !important;
    left: 0 !important;
    width: 1px !important;
    height: min(40px, 2.0833vw) !important;
    transform: translateY(-50%) !important;
    background: rgba(255, 255, 255, 0.18) !important;
  }

  html[lang="vi"] .hero--figma-crop .hero-stats span {
    white-space: nowrap !important;
  }
}

@media (min-width: 1280px) and (max-width: 1919.98px) {
  html[lang="vi"] .hero--figma-crop .hero__content {
    width: min(1440px, calc(100% - clamp(192px, 20vw, 360px))) !important;
  }
}

@media (min-width: 1920px) {
  html[lang="vi"] .hero--figma-crop {
    --hero-bg-url: url("assets/hero/home-hero-responsive-wide-v2-3200.webp?v=20260713a&v=20260715asset1");
    --hero-bg-position: center center;
  }

  html[lang="vi"] .hero--figma-crop .hero__content {
    width: min(75vw, 1920px) !important;
  }
}

html[lang="vi"] a[class*="button"],
html[lang="vi"] button,
html[lang="vi"] .pdp-cta,
html[lang="vi"] .whatsapp-pill,
html[lang="vi"] .contact-actions a,
html[lang="vi"] .catalog-card__button {
  min-height: 44px;
  height: auto;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
}

html[lang="vi"] .product-card,
html[lang="vi"] .catalog-card,
html[lang="vi"] .proof-card,
html[lang="vi"] .pdp-payment-card {
  height: auto;
  min-height: 0;
}

html[lang="vi"] .pdp-info__title,
html[lang="vi"] .catalog-card__title,
html[lang="vi"] .product-card__title,
html[lang="vi"] .pdp-quick-spec__value,
html[lang="vi"] .pdp-price-box__amount,
html[lang="vi"] [class*="price"],
html[lang="vi"] a[href^="tel:"],
html[lang="vi"] a[href^="mailto:"] {
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
}

html[lang="vi"] .catalog-card__meta,
html[lang="vi"] .catalog-card__price,
html[lang="vi"] .pdp-quick-spec__label,
html[lang="vi"] .pdp-cert-row__body,
html[lang="vi"] .pdp-trust-item {
  white-space: normal;
}

.vi-preview-banner {
  position: fixed;
  z-index: 100000;
  left: 16px;
  bottom: 16px;
  display: grid;
  gap: 2px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 10px 14px;
  color: #fff;
  background: rgba(7, 31, 50, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(7, 31, 50, 0.25);
  font: 500 12px/1.35 Inter, Arial, sans-serif;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.vi-preview-banner strong {
  color: #b8dd74;
  font-weight: 800;
}

.vi-preview-toast {
  position: fixed;
  z-index: 100001;
  left: 50%;
  bottom: 24px;
  width: min(520px, calc(100vw - 32px));
  padding: 14px 18px;
  color: #fff;
  background: #071f32;
  border-radius: 12px;
  box-shadow: 0 16px 45px rgba(7, 31, 50, 0.32);
  transform: translate(-50%, 24px);
  opacity: 0;
  transition: 180ms ease;
  text-align: center;
  pointer-events: none;
}

.vi-preview-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 767.98px) {
  html[lang="vi"] p,
  html[lang="vi"] li,
  html[lang="vi"] label,
  html[lang="vi"] small {
    hyphens: none;
  }

  html[lang="vi"] h1,
  html[lang="vi"] h2,
  html[lang="vi"] h3,
  html[lang="vi"] h4 {
    hyphens: none;
    overflow-wrap: normal;
    word-break: normal;
  }

  html[lang="vi"] .brand,
  html[lang="vi"] .icon-button,
  html[lang="vi"] .menu-button {
    min-width: 44px;
  }

  html[lang="vi"] .nav-links a,
  html[lang="vi"] .nav-submenu a {
    white-space: normal;
  }

  html[lang="vi"] .hero,
  html[lang="vi"] .home-hero,
  html[lang="vi"] .about-hero,
  html[lang="vi"] .catalog-hero {
    height: auto;
  }

  html[lang="vi"] .hero--figma-crop {
    height: 732px !important;
  }

  html[lang="vi"] .hero--figma-crop .hero__bg {
    background: none;
  }

  html[lang="vi"] .hero--figma-crop .hero__copy,
  html[lang="vi"] .hero--figma-crop .hero__copy p:not(.eyebrow),
  html[lang="vi"] .hero--figma-crop .hero__actions {
    width: 100%;
    max-width: 100%;
  }

  html[lang="vi"] .hero--figma-crop h1 {
    width: 100%;
    max-width: 100%;
    font-size: clamp(29px, 8.2vw, 32px);
    line-height: 1.08;
  }

  html[lang="vi"] .hero__actions,
  html[lang="vi"] .cta-actions,
  html[lang="vi"] .contact-actions,
  html[lang="vi"] .pdp-ctas,
  html[lang="vi"] .inquiry-actions,
  html[lang="vi"] .form-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  html[lang="vi"] .proof-metrics,
  html[lang="vi"] .company-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[lang="vi"] .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 20px;
  }

  html[lang="vi"] .pdp-quick-spec {
    min-width: 0;
  }

  html[lang="vi"] .pdp-cert-row,
  html[lang="vi"] .pdp-trust-item {
    align-items: flex-start;
  }

  html[lang="vi"] .blog-detail__table-wrap,
  html[lang="vi"] .article-table-wrap,
  html[lang="vi"] .vi-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  html[lang="vi"] .vi-table-scroll {
    width: 100%;
    margin-block: 18px;
    padding-bottom: 4px;
    border-radius: 8px;
    overscroll-behavior-inline: contain;
  }

  html[lang="vi"] .vi-table-scroll table {
    min-width: 720px;
    margin: 0;
  }

  html[lang="vi"] .product-card .price-row a,
  html[lang="vi"] .proof-card a,
  html[lang="vi"] .catalog-detail-button {
    min-height: 44px;
  }
}

@media (max-width: 430px) {
  html[lang="vi"] h1 {
    font-size: clamp(29px, 8.2vw, 32px);
    line-height: 1.08;
  }

  html[lang="vi"] h2 {
    font-size: clamp(27px, 7.7vw, 30px);
    line-height: 1.12;
  }

  html[lang="vi"] .hero__actions,
  html[lang="vi"] .cta-actions,
  html[lang="vi"] .contact-actions,
  html[lang="vi"] .pdp-ctas,
  html[lang="vi"] .inquiry-actions,
  html[lang="vi"] .form-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 10px;
  }

  html[lang="vi"] .hero__actions > *,
  html[lang="vi"] .cta-actions > *,
  html[lang="vi"] .contact-actions > *,
  html[lang="vi"] .pdp-ctas > *,
  html[lang="vi"] .inquiry-actions > *,
  html[lang="vi"] .form-actions > * {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  html[lang="vi"] .pdp-form .form-row,
  html[lang="vi"] .inquiry-form .form-row,
  html[lang="vi"] .contact-inquiry__form .form-row,
  html[lang="vi"] form .form-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  html[lang="vi"] .catalog-card__price-row,
  html[lang="vi"] .price-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  html[lang="vi"] .product-main .price-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  html[lang="vi"] .product-main .price-row > div,
  html[lang="vi"] .product-main .price-row > a {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    align-self: stretch;
  }

  html[lang="vi"] .catalog-price b {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }

  html[lang="vi"] .pdp-cert-row__body {
    min-width: 0;
  }

  .vi-preview-banner {
    left: 10px;
    bottom: 10px;
    max-width: 250px;
    padding: 8px 10px;
    font-size: 10px;
  }
}

html[lang="vi"] .product-card .price-row span::before {
  content: "Giá tham khảo";
}

@media (min-width: 768px) {
  /* Preserve the English baseline grid: compact cards fill their assigned row,
     while the short Vietnamese specification leaves room for price and CTA. */
  html[lang="vi"] .product-layout .product-card {
    height: 100%;
  }
}

@media (min-width: 1280px) and (max-width: 1599.98px) {
  html[lang="vi"] .catalog-promise {
    padding-block: 12px;
  }

  html[lang="vi"] .catalog-promise h2 {
    margin-bottom: 10px;
  }

  html[lang="vi"] .catalog-promise dl {
    gap: 6px;
  }

  html[lang="vi"] .catalog-promise__button {
    margin-top: 6px;
  }
}

@media (min-width: 1181px) and (max-width: 1919.98px) {
  html[lang="vi"] body.product-detail-preview .pdp-overview {
    align-items: stretch;
  }

  html[lang="vi"] body.product-detail-preview .pdp-gallery__main {
    flex: 1 1 0;
    min-height: 0;
    aspect-ratio: auto;
  }
}

@media (min-width: 1280px) {
  html[lang="vi"] body.about-page .about-overview__grid {
    align-items: stretch;
  }

  html[lang="vi"] body.about-page .about-collage {
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
    align-self: stretch;
  }

  html[lang="vi"] body.contact-page .contact-grid {
    align-items: stretch;
  }

  html[lang="vi"] body.contact-page .contact-map-card {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-self: stretch;
  }

  html[lang="vi"] body.contact-page .contact-map__media {
    min-height: 0;
    aspect-ratio: auto;
  }

  html[lang="vi"] body.contact-page .contact-map__media img {
    height: 100%;
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[lang="vi"] {
    scroll-behavior: auto;
  }

  .vi-preview-toast {
    transition: none;
  }
}

@media (max-width: 767.98px) {
  html[lang="vi"] .blog-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: 100%;
    overflow: visible;
  }

  html[lang="vi"] .category-card,
  html[lang="vi"] .category-card a,
  html[lang="vi"] .product-category,
  html[lang="vi"] .product-category a {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html[lang="vi"] .detail-content .vi-table-scroll {
    max-width: 100%;
    overflow-x: auto;
  }

  html[lang="vi"] .detail-content .vi-table-scroll table {
    max-width: none;
  }
}

/* Footer subscribe polish: keep the input and green button as one full-height pill. */
html[lang="vi"] .footer-newsletter {
  align-items: center;
}

html[lang="vi"] .footer-newsletter .subscribe-form,
html[lang="vi"] .subscribe-form {
  --subscribe-button-min: clamp(136px, 10vw, 184px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0;
  width: min(560px, 100%);
  height: 60px;
  min-height: 60px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

html[lang="vi"] .subscribe-form input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding-inline: 28px 18px;
  color: #fff;
  font-size: clamp(15px, 1vw, 18px);
  line-height: 1;
  outline: none;
}

html[lang="vi"] .subscribe-form input::placeholder {
  color: rgba(255, 255, 255, 0.92);
}

html[lang="vi"] .subscribe-form button {
  min-width: var(--subscribe-button-min);
  height: 100%;
  align-self: stretch;
  border: 0;
  border-radius: 0;
  background: #84b442;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-inline: 26px;
  font-size: clamp(15px, 1vw, 18px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}

html[lang="vi"] .subscribe-form button::after {
  content: "\2192";
  width: 1.1em;
  height: 1.1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 38, 53, 0.16);
  font-size: 1.1em;
  line-height: 1;
}

html[lang="ar"] .subscribe-form {
  direction: rtl;
}

html[lang="ar"] .subscribe-form input {
  text-align: right;
}

@media (max-width: 1180px) {
  html[lang="vi"] .footer-newsletter .subscribe-form,
  html[lang="vi"] .subscribe-form {
    width: min(560px, 100%);
    height: 56px;
    min-height: 56px;
  }
}

@media (max-width: 767.98px) {
  html[lang="vi"] .footer-newsletter .subscribe-form,
  html[lang="vi"] .subscribe-form {
    --subscribe-button-min: 112px;
    width: 100%;
    height: 54px;
    min-height: 54px;
  }

  html[lang="vi"] .subscribe-form input {
    padding-inline: 18px 12px;
    font-size: 14px;
  }

  html[lang="vi"] .subscribe-form button {
    padding-inline: 18px;
    font-size: 14px;
  }
}

@media (max-width: 389.98px) {
  html[lang="vi"] .footer-newsletter .subscribe-form,
  html[lang="vi"] .subscribe-form {
    --subscribe-button-min: 104px;
    height: 52px;
    min-height: 52px;
  }

  html[lang="vi"] .subscribe-form input {
    padding-inline: 16px 10px;
    font-size: 13px;
  }

  html[lang="vi"] .subscribe-form button {
    padding-inline: 14px;
    gap: 8px;
    font-size: 13px;
  }
}

/* Footer newsletter layout alignment: match the centered Figma footer. */
html[lang="vi"] .footer-newsletter {
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: center;
  align-content: center;
  min-height: clamp(132px, 9vw, 172px);
  padding-block: clamp(44px, 4.6vw, 72px) clamp(36px, 3.5vw, 56px);
}

html[lang="vi"] .footer-newsletter > div {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

html[lang="vi"] .footer-newsletter .subscribe-form {
  justify-self: center;
  width: min(552px, calc(100vw - 48px));
}

@media (max-width: 767.98px) {
  html[lang="vi"] .footer-newsletter {
    min-height: 0;
    padding: 32px 0 28px;
  }

  html[lang="vi"] .footer-newsletter .subscribe-form {
    width: 100%;
  }
}

/* Footer subscribe button fill correction: the green side must fill the full pill height. */
html[lang="vi"] .footer-newsletter .subscribe-form {
  display: flex !important;
  align-items: stretch !important;
}

html[lang="vi"] .footer-newsletter .subscribe-form input {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 100% !important;
}

html[lang="vi"] .footer-newsletter .subscribe-form button {
  flex: 0 0 var(--subscribe-button-min) !important;
  width: auto !important;
  height: auto !important;
  min-height: 100% !important;
  align-self: stretch !important;
  border-radius: 0 !important;
  padding-block: 0 !important;
}
