/* ============================================================
   components.css - button, hero, card, product, about, contact,
   floating contact, modal, toast
   ============================================================ */

/* ---------------- Button ---------------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  --btn-bd: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding-inline: 26px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
    color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  --btn-bg: var(--brand);
  --btn-bd: var(--brand);
}

.btn--primary:hover {
  --btn-bg: var(--brand-dark);
  --btn-bd: var(--brand-dark);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
}

.btn--ghost:hover {
  --btn-bd: var(--ink);
  --btn-bg: rgba(15, 23, 42, 0.04);
}

.btn--light {
  --btn-bg: #fff;
  --btn-fg: var(--ink);
  --btn-bd: #fff;
}

.btn--sm {
  min-height: 38px;
  padding-inline: 18px;
  font-size: 0.875rem;
}

.btn--lg {
  min-height: 54px;
  padding-inline: 34px;
  font-size: 1rem;
}

.btn--block {
  width: 100%;
}

/* Link kieu Samsung: chu + mui ten */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--brand);
}

.link-arrow::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--dur) var(--ease);
}

.link-arrow:hover::after {
  transform: rotate(-45deg) translate(3px, 3px);
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  min-height: clamp(520px, 78vh, 780px);
  display: grid;
  isolation: isolate;
  background: var(--bg-soft);
  overflow: hidden;
}

.hero__slides {
  position: absolute;
  inset: 0;
}

.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 720ms var(--ease), visibility 720ms;
}

.hero__slide.is-active {
  opacity: 1;
  visibility: visible;
}

.hero__media,
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(255, 255, 255, 0.78) 34%,
    rgba(255, 255, 255, 0.1) 66%,
    rgba(255, 255, 255, 0) 100%
  );
}

.hero--dark .hero__scrim {
  background: linear-gradient(
    100deg,
    rgba(6, 8, 15, 0.85) 0%,
    rgba(6, 8, 15, 0.6) 40%,
    rgba(6, 8, 15, 0.05) 78%
  );
}

.hero__stage {
  position: relative;
  z-index: 2;
  min-height: inherit;
  display: flex;
  flex-direction: column;
}

.hero__inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  min-height: inherit;
  padding-block: clamp(72px, 10vw, 120px);
}

.hero__content {
  max-width: 620px;
}

.hero__content > * + * {
  margin-top: 18px;
}

.hero--dark .hero__content {
  color: #fff;
}

.hero--dark .hero__content .t-eyebrow {
  color: #93b4ff;
}

.hero--dark .hero__subtitle {
  color: rgba(255, 255, 255, 0.82);
}

.hero__title {
  white-space: pre-line;
}

.hero__subtitle {
  max-width: 48ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero--center .hero__inner {
  justify-content: center;
  text-align: center;
}

.hero--center .hero__actions {
  justify-content: center;
}

.hero--center .hero__subtitle {
  margin-inline: auto;
}

/* Dieu khien slideshow */
.hero__controls {
  position: absolute;
  z-index: 3;
  left: var(--gutter);
  bottom: 30px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero__dots {
  display: flex;
  gap: 10px;
}

.hero__dot {
  width: 30px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.22);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: background var(--dur) var(--ease);
}

.hero__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 0;
  background: var(--brand);
  border-radius: 4px;
}

.hero__dot.is-active::after {
  width: 100%;
  transition: width linear var(--slide-duration, 6000ms);
}

.hero--paused .hero__dot.is-active::after {
  transition: none;
}

.hero__toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  color: var(--ink);
}

.hero--dark .hero__dot {
  background: rgba(255, 255, 255, 0.3);
}
.hero--dark .hero__dot::after {
  background: #fff;
}
.hero--dark .hero__toggle {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* ---------------- Stats ---------------- */
.stats {
  background: var(--bg-soft);
  padding-block: clamp(40px, 5vw, 64px);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

@media (max-width: 720px) {
  .stats__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat__value {
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--brand);
  line-height: 1.05;
}

.stat__label {
  margin-top: 6px;
  font-size: 0.92rem;
  color: var(--ink-3);
}

/* ---------------- Card chung ---------------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 2.4vw, 32px);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
  height: 100%;
}

.card__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 18px;
}

.card__title {
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.card__text {
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ---------------- Products ---------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.filter-chip {
  min-height: 40px;
  padding-inline: 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.filter-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(16px, 2vw, 28px);
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid transparent;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  text-align: left;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  width: 100%;
}

.product-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #fff;
  overflow: hidden;
}

.product-card__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}

.product-card__body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-card__cat {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.product-card__name {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.product-card__desc {
  font-size: 0.9rem;
  color: var(--ink-3);
  line-height: 1.6;
  flex: 1;
}

.product-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.product-card__price {
  font-weight: 600;
  color: var(--brand);
  font-size: 0.95rem;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

/* ---------------- Features (media + text) ---------------- */
.feature-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}

@media (max-width: 900px) {
  .feature-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.feature-tile {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
}

.feature-tile__media {
  aspect-ratio: 16 / 11;
  overflow: hidden;
}

.feature-tile__body {
  padding: 24px 26px 30px;
}

/* ---------------- About ---------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.about__body > p + p {
  margin-top: 16px;
}

.about__media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-soft);
}

.about__caption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--ink-3);
}

.value-list {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

.value-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.value-item__dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.timeline {
  margin-top: clamp(40px, 5vw, 64px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
  counter-reset: ms;
}

@media (max-width: 900px) {
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .timeline {
    grid-template-columns: minmax(0, 1fr);
  }
}

.timeline__item {
  padding-top: 22px;
  border-top: 2px solid var(--line);
  transition: border-color var(--dur) var(--ease);
}

.timeline__item:hover {
  border-top-color: var(--brand);
}

.timeline__year {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.timeline__title {
  margin-top: 6px;
  font-weight: 600;
}

.timeline__text {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--ink-3);
  line-height: 1.6;
}

.cert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.cert-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--ink-2);
}

/* ---------------- CTA band ---------------- */
.cta-band {
  position: relative;
  overflow: hidden;
}

/* Ba tông màu, chọn trong CMS. Mỗi tông tự lo tương phản chữ/nền cho đủ đọc. */
.cta-band--light {
  background: var(--bg-soft);
  color: var(--ink);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cta-band--brand {
  background: var(--brand);
  color: #fff;
}

.cta-band--dark {
  background: var(--bg-dark);
  color: #fff;
}

.cta-band__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
  padding-block: clamp(48px, 6vw, 80px);
}

.cta-band__bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: 0.16;
}

.cta-band__text {
  max-width: 62ch;
}

.cta-band__title {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cta-band__sub {
  margin-top: 10px;
  color: currentColor;
  opacity: 0.78;
}

/* Ảnh nền mờ: nền sáng cần nhạt hơn nữa để chữ đen vẫn rõ */
.cta-band--light .cta-band__bg {
  opacity: 0.07;
}

/* ---------------- Contact ---------------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

@media (max-width: 900px) {
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.info-list {
  display: grid;
  gap: 4px;
}

.info-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.info-item__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
}

/* Biểu tượng là ẢNH RIÊNG tải lên (thay cho icon SVG có sẵn).
   Ảnh tải lên đủ mọi tỉ lệ nên phải ép về khung vuông và giữ nguyên tỉ lệ,
   nếu không thì logo bị kéo méo hoặc phá vỡ hàng. */
.icon--img {
  object-fit: contain;
  flex: 0 0 auto;
  /* Ảnh có màu sẵn, không ăn theo currentColor như SVG - giữ nguyên màu gốc */
}

/* Tên người phụ trách, đứng sau nhãn: "Bộ phận kinh doanh · Anh Tuấn" */
.info-item__person {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted, #64748b);
}

.info-item__person::before {
  content: ' · ';
}

.info-item__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.info-item__value {
  margin-top: 4px;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.5;
}

.info-item__value a:hover {
  color: var(--brand);
}

.branch-list {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.branch {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.branch__name {
  font-weight: 600;
  font-size: 0.96rem;
}

.branch__meta {
  font-size: 0.88rem;
  color: var(--ink-3);
  margin-top: 4px;
}

/* Form */
.form-card {
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 40px);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 560px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field--full {
  grid-column: 1 / -1;
}

.field__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
}

.field__label .req {
  color: var(--danger);
}

.field__control {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #fff;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

textarea.field__control {
  min-height: 128px;
  resize: vertical;
}

.field__control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20, 40, 160, 0.12);
}

.field__error {
  font-size: 0.8rem;
  color: var(--danger);
  min-height: 1em;
}

.field.has-error .field__control {
  border-color: var(--danger);
}

.form-note {
  font-size: 0.82rem;
  color: var(--ink-3);
  margin-top: 12px;
}

.form-success {
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
  padding: 40px 20px;
}

.form-success__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #e7f6ee;
  color: var(--success);
  display: grid;
  place-items: center;
}

/* Map */
.map-wrap {
  margin-top: clamp(32px, 4vw, 56px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.map-wrap iframe {
  width: 100%;
  border: 0;
  display: block;
}

.map-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 0.9rem;
}

/* ---------------- Floating contact ---------------- */
/*
 * Vung .fab chi to dung bang cai nut.
 * Danh sach kenh va bong bong deu duoc neo tuyet doi phia tren nut, KHONG chiem
 * cho trong bo cuc. Neu de chung nam trong dong chay, khi dong lai chung van tao
 * mot vung vo hinh cao vai tram pixel o goc man hinh, chan het cu nhap cua nguoi dung.
 */
.fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  width: 58px;
  height: 58px;
}

.fab--left {
  right: auto;
  left: 22px;
}

/* Bong bong loi nhan canh nut */
.fab__bubble {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: max-content;
  max-width: 236px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 4px 16px;
  padding: 13px 34px 13px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px) scale(0.94);
  transform-origin: bottom right;
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}

/* Nen kinh mo: thay thoang noi dung phia sau, van doc ro chu */
.fab__bubble--glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
}

/* Nen trang dac */
.fab__bubble--solid {
  background: #fff;
}

/* Khong co nut dong -> khong can chua cho ben phai */
.fab__bubble--bare {
  padding: 13px 18px;
}

/* Trinh duyet cu khong ho tro backdrop-filter: quay ve nen trang gan dac */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .fab__bubble--glass {
    background: rgba(255, 255, 255, 0.96);
  }
}

.fab--left .fab__bubble {
  right: auto;
  left: 0;
  border-radius: 16px 16px 16px 4px;
  transform-origin: bottom left;
}

.fab.has-bubble .fab__bubble {
  opacity: 1;
  transform: none;
}

.fab__bubble::after {
  content: '';
  position: absolute;
  right: 23px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.fab__bubble--solid::after {
  background: #fff;
}

/* Mui nhon cua kieu kinh mo: to lai chinh nen mo, khong dung mau dac */
.fab__bubble--glass::after {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-color: rgba(255, 255, 255, 0.6);
}

.fab--left .fab__bubble::after {
  right: auto;
  left: 23px;
}

.fab__bubble-text {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}

.fab__bubble-close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.fab__bubble-close:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.fab.is-open .fab__bubble {
  display: none;
}

/* Bong bong khong nhan chuot khi dang mo dan ra/thu vao, tranh bam nham */
.fab__bubble {
  pointer-events: none;
}

.fab.has-bubble .fab__bubble {
  pointer-events: auto;
}

.fab__list {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  /* Khi dong: khong nhan chuot, de nguoi dung bam duoc vao noi dung ben duoi */
  pointer-events: none;
}

.fab.is-open .fab__list {
  pointer-events: auto;
}

.fab--left .fab__list {
  right: auto;
  left: 0;
  align-items: flex-start;
}

.fab__item {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}

.fab--left .fab__item {
  flex-direction: row-reverse;
}

.fab.is-open .fab__item {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.fab.is-open .fab__item:nth-child(1) {
  transition-delay: 40ms;
}
.fab.is-open .fab__item:nth-child(2) {
  transition-delay: 80ms;
}
.fab.is-open .fab__item:nth-child(3) {
  transition-delay: 120ms;
}
.fab.is-open .fab__item:nth-child(4) {
  transition-delay: 160ms;
}
.fab.is-open .fab__item:nth-child(5) {
  transition-delay: 200ms;
}

.fab__label {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.fab__btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform var(--dur) var(--ease), filter var(--dur) var(--ease);
  flex: 0 0 auto;
}

.fab__btn:hover {
  transform: scale(1.08);
  filter: brightness(1.06);
}

.fab__btn--phone {
  background: #16a34a;
}
.fab__btn--zalo {
  background: #0068ff;
}
.fab__btn--facebook {
  background: #0866ff;
}
.fab__btn--email {
  background: #ea4335;
}
.fab__btn--custom {
  background: var(--ink-2);
}

.fab__toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(20, 40, 160, 0.34);
  position: relative;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}

.fab__toggle:hover {
  transform: scale(1.06);
}

.fab__toggle svg {
  transition: transform 280ms var(--ease), opacity 200ms var(--ease);
}

.fab__toggle .icon-close {
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg);
}

.fab.is-open .fab__toggle {
  background: var(--ink);
}

.fab.is-open .fab__toggle .icon-chat {
  opacity: 0;
  transform: rotate(90deg);
}

.fab.is-open .fab__toggle .icon-close {
  opacity: 1;
  transform: none;
}

.fab.is-open .fab__pulse {
  display: none;
}

@media (max-width: 560px) {
  .fab {
    right: 16px;
    bottom: 16px;
  }
  .fab__label {
    display: none;
  }
  .fab__bubble {
    max-width: 200px;
    padding: 11px 30px 11px 14px;
  }
  .fab__bubble-text {
    font-size: 0.82rem;
  }
}

/* ---------------- Modal chi tiet san pham ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
}

.modal__dialog {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: var(--radius-lg);
  width: min(980px, 100%);
  max-height: 88vh;
  overflow: auto;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 760px) {
  .modal__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.modal__media {
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__media img {
  width: 100%;
  border-radius: var(--radius);
}

.modal__body {
  padding: clamp(24px, 3vw, 38px);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.92rem;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.spec-table th {
  color: var(--ink-3);
  font-weight: 500;
  width: 46%;
}

.spec-table td {
  font-weight: 600;
}

.gallery-strip {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.gallery-strip img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  cursor: pointer;
}

/* ---------------- Toast ---------------- */
.toast-root {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast--error {
  background: var(--danger);
}
.toast--success {
  background: var(--success);
}

/* Cau truc (hoat hinh nam trong motion.css) */
.product-card__media img,
.feature-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 12, 20, 0.55);
  backdrop-filter: blur(3px);
}

.modal__dialog {
  box-shadow: var(--shadow-lg);
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: 13px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}

.fab__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--brand);
  pointer-events: none;
}

.card:hover {
  border-color: transparent;
}


/* ============================================================
   Khối "Hình ảnh thực tế" — slideshow ảnh thi công
   ============================================================ */
.gallery {
  display: grid;
  gap: 14px;
}

.gallery__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0f172a;
  isolation: isolate;
}

.gallery__stage:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.gallery__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
}

.gallery__slide.is-active {
  opacity: 1;
  visibility: visible;
}

.gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 46px clamp(18px, 3vw, 32px) clamp(16px, 2.4vw, 26px);
  color: #fff;
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  font-weight: 500;
  line-height: 1.5;
  background: linear-gradient(to top, rgba(6, 8, 15, 0.82), rgba(6, 8, 15, 0));
}

/* Nút chuyển ảnh */
.gallery__nav {
  position: absolute;
  top: 50%;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 2;
}

.gallery__nav--prev {
  left: 14px;
}

.gallery__nav--prev svg {
  transform: rotate(180deg);
}

.gallery__nav--next {
  right: 14px;
}

.gallery__counter {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(6, 8, 15, 0.55);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Dải ảnh nhỏ */
.gallery__thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.gallery__thumb {
  flex: 0 0 auto;
  width: 108px;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  cursor: pointer;
  opacity: 0.6;
}

.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__thumb.is-active {
  border-color: var(--brand);
  opacity: 1;
}

@media (max-width: 640px) {
  .gallery__stage {
    aspect-ratio: 4 / 3;
  }

  .gallery__nav {
    width: 38px;
    height: 38px;
    margin-top: -19px;
  }

  .gallery__thumb {
    width: 84px;
  }
}
