/* ============================================
   ---------- Footer Styles ----------
   ============================================ */
/* Footer Base */
.site-footer {
  background-color: var(--night);
  color: var(--gray-200);
  font-family: var(--font-body);
}

.footer-container {
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-top: 4rem;
  padding-bottom: 4rem;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Grid Layout */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .footer-col-brand { grid-column: span 3 / span 3; }
  .footer-col-products { grid-column: span 2 / span 2; }
  .footer-col-company { grid-column: span 2 / span 2; }
  .footer-col-contact { grid-column: span 5 / span 5; }
}

/* Cột Thương Hiệu */
.footer-logo-link {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.footer-logo-img {
  height: 2.5rem;
  width: auto;
  color: transparent;
}

.brand-desc {
  font-size: 0.875rem;
  color: var(--gray-500);
  max-width: 20rem;
  line-height: 1.625;
}

.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.social-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background-color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-200);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.social-btn:hover {
  background-color: var(--primary-600);
  color: var(--white);
}

/* Common Headings & Menus */
.footer-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}

.heading-spacing {
  margin-top: 2rem;
}

.footer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--gray-500);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--primary-500);
}

/* Cột Liên Hệ */
.contact-email {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.offices-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .offices-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.office-country {
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.office-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.office-item {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.office-city {
  font-weight: 500;
  color: var(--gray-200);
  margin-bottom: 0.25rem;
}

.office-info {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
}

/* Icons styling */
.icon-mail {
  width: 1rem;
  height: 1rem;
  color: var(--primary-500);
  flex-shrink: 0;
}

.icon-location,
.icon-phone {
  width: 0.75rem;
  height: 0.75rem;
  color: var(--primary-500);
  flex-shrink: 0;
}

.icon-location {
  margin-top: 0.125rem;
}

.icon-phone {
  align-self: center;
}

/* Bottom Footer */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 3rem;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-copyright-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 640px) {
  .footer-copyright-row {
    flex-direction: row;
  }
}

.copyright-text {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.legal-links {
  display: flex;
  gap: 1.5rem;
}

.legal-link {
  font-size: 0.875rem;
  color: var(--gray-500);
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-link:hover {
  color: var(--gray-200);
}

.developer-credit {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-align: center;
}

.credit-link {
  color: var(--gray-200);
  text-decoration: none;
  transition: color 0.2s ease;
}

.credit-link:hover {
  color: var(--primary-500);
}



/* Reset: chặn CSS của theme/footer ghi đè (in hoa, font lạ, ...) */
body .ehfab,
body .ehfab *,
body .zalo-modal,
body .zalo-modal * {
  box-sizing: border-box;
  font-family: var(--font-body, "Ubuntu", system-ui, -apple-system, "Segoe UI", sans-serif);
  font-style: normal;
  text-transform: none;
  letter-spacing: normal;
}

body .ehfab button,
body .zalo-modal button {
  margin: 0;
  background-image: none;
}

/* ==========================================================
   Floating contact + back to top
   Tất cả nằm chung 1 cột flex nên không bao giờ đè lên nhau:
   [ menu liên hệ ] -> [ lên đầu trang ] -> [ nút mở/đóng ]
   ========================================================== */
body .ehfab {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  font-family: var(--font-body);
}

@media (min-width: 640px) {
  body .ehfab {
    right: 1.5rem;
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- Menu liên hệ ---------- */
.ehfab__menu {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.ehfab.is-open .ehfab__menu {
  display: flex;
  animation: ehfab-in 0.2s ease both;
}

.ehfab__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem 0.5rem 0.5rem;
  border: 1px solid var(--bap-line);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--gray-900);
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-board);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ehfab__item:hover {
  transform: translateX(-3px);
  box-shadow: 0 14px 24px -6px rgba(0, 0, 0, 0.25);
}

.ehfab__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ehfab__icon--zalo { background: #0068ff; }
.ehfab__icon--facebook { background: #1877f2; }

.ehfab__text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  line-height: 1.2;
}

.ehfab__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-900);
}

.ehfab__sub {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* ---------- Nút lên đầu trang ---------- */
.ehfab__top {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--bap-dark);
  cursor: pointer;
  box-shadow: var(--shadow-board);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ehfab__top.is-visible {
  display: inline-flex;
  animation: ehfab-in 0.2s ease both;
}

.ehfab__top:hover {
  background: var(--bap);
  border-color: var(--bap);
  color: var(--white);
  transform: translateY(-2px);
}

/* ---------- Nút mở / đóng ---------- */
.ehfab__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--bap);
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 8px 20px var(--primary-shadow-hover);
  transition: background 0.2s ease, transform 0.2s ease;
}

.ehfab__toggle:hover {
  background: var(--bap-dark);
  transform: scale(1.08);
}

.ehfab__toggle .ehfab__icon-close { display: none; }
.ehfab.is-open .ehfab__toggle { background: var(--gray-700); }
.ehfab.is-open .ehfab__toggle .ehfab__icon-chat { display: none; }
.ehfab.is-open .ehfab__toggle .ehfab__icon-close { display: block; }

.ehfab__toggle:focus-visible,
.ehfab__top:focus-visible,
.ehfab__item:focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
}

@keyframes ehfab-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Popup QR Zalo ---------- */
.zalo-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  background: rgba(17, 24, 39, 0.6);
}

.zalo-modal.is-open {
  display: flex;
  animation: ehfab-fade 0.2s ease both;
}

.zalo-modal__box {
  position: relative;
  width: 100%;
  max-width: 22rem;
  padding: 2rem 1.5rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--white);
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.zalo-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-700);
  cursor: pointer;
}

.zalo-modal__close:hover {
  background: var(--gray-200);
}

.zalo-modal__title {
  margin: 0 0 0.375rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
}

.zalo-modal__hint {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.zalo-modal__qr {
  display: block;
  width: 100%;
  max-width: 15rem;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--bap-line);
  border-radius: var(--radius-md);
}

body.ehfab-lock {
  overflow: hidden;
}

@keyframes ehfab-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ehfab.is-open .ehfab__menu,
  .ehfab__top.is-visible,
  .zalo-modal.is-open {
    animation: none;
  }

  .ehfab__item,
  .ehfab__top,
  .ehfab__toggle {
    transition: none;
  }
}