/* =========================================================
   common.css – reset, layout chung, header, footer, component
   Dùng chung cho các trang (index, news...). Mobile-first.
   Breakpoint: xs 460 | sm 640 | md 768 | lg 1024 | xl 1280
   ========================================================= */

:root {
  /* màu thương hiệu lấy từ logo Chinalink */
  --color-main: #f0a824;          /* vàng kim – màu phụ */
  --color-second: #9c0a0f;        /* đỏ logo – màu chính */
  --color-primary-dark: #7a0000;  /* đỏ đậm khi hover */
  --color-primary-light: #c8161d; /* đỏ sáng cho gradient */
  --color-gold-light: #fccc48;
  --color-cream: #fdf8ee;         /* nền kem ấm */
  --color-tint: #fbeec9;          /* nền nhãn/chip vàng nhạt */
  --text-black: #3e3e44;
  --color-border: #d4d4d8;
  --color-muted: #e5e7eb;
  --shadow-card: 0 2px 25px 0 rgba(0, 0, 142, 0.15);
  --overlay-dark: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7));
  /* nền tối có sọc chéo mờ – dùng cho topbar và footer */
  --bg-dark: #1e1e1e repeating-linear-gradient(-60deg, transparent 0 120px, rgba(255, 255, 255, 0.025) 120px 240px);
  --container: 1280px;
  --gutter: 16px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
}

body {
  margin: 0;
  font-family: Inter, Verdana, Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-black);
  background: #fff;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
ul,
ol {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

address {
  font-style: normal;
}

/* chặn phần tử lòi ra mép màn hình (vd: hiệu ứng trượt ngang trước khi chạy).
   clip không tạo vùng cuộn nên không làm hỏng position: sticky */
main {
  overflow-x: clip;
}

:focus-visible {
  outline: 2px solid var(--color-main);
  outline-offset: 2px;
}

/* ---------- Utilities ---------- */
.hidden {
  display: none !important;
}

.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;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.line-clamp-1,
.line-clamp-2,
.line-clamp-3,
.line-clamp-4 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-1 {
  -webkit-line-clamp: 1;
}

.line-clamp-2 {
  -webkit-line-clamp: 2;
}

.line-clamp-3 {
  -webkit-line-clamp: 3;
}

.line-clamp-4 {
  -webkit-line-clamp: 4;
}

/* ---------- Section / heading ---------- */
.section {
  padding-block: 64px;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
  text-align: center;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-second);
}

.section-title--center {
  margin-bottom: 40px;
  text-align: center;
}

.section-desc {
  max-width: 640px;
  margin-inline: auto;
}

/* section nền tối: tiêu đề vàng để đủ tương phản */
.section-head--light .section-title {
  color: var(--color-gold-light);
}

.section-head--light .section-desc {
  color: rgba(255, 255, 255, 0.8);
}

@media (min-width: 640px) {
  .section-title {
    font-size: 36px;
  }
}

@media (min-width: 768px) {
  .section {
    padding-block: 80px;
  }
}

/* ---------- Button / input ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding-inline: 20px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}

.btn--primary {
  background: var(--color-second);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-primary-dark);
}

.input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding-inline: 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}

.input::placeholder {
  color: #999;
}

.input:focus {
  outline: none;
  border-color: var(--color-main);
  box-shadow: 0 0 0 2px rgba(240, 168, 36, 0.3);
}

/* ---------- Card ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.card__icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.card__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

@media (min-width: 640px) {
  .card__title {
    font-size: 20px;
  }
}

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

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  background: var(--bg-dark);
}

/* topbar: chỉ hiện từ md */
.topbar {
  display: none;
}

/* tỉ giá: nhãn trắng, số vàng */
.topbar__rates {
  display: flex;
  align-items: center;
  gap: 32px;
  font-weight: 600;
}

.topbar__rate {
  color: var(--color-gold-light);
}

a.topbar__rate:hover {
  color: #fff;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* icon mạng xã hội: hình tròn trắng */
.topbar__social {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: #1e1e1e;
  font-size: 12px;
  transition: background-color 0.2s;
}

.topbar__social a:hover {
  background: var(--color-main);
}

.topbar__auth {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-transform: uppercase;
}

.topbar__auth a:hover,
.account-menu__toggle:hover {
  color: var(--color-main);
}

.account-menu {
  position: relative;
  padding: 8px 12px;
}

.account-menu__toggle i {
  margin-right: 8px;
}

.account-menu__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  width: max-content;
  max-width: 320px;
  padding: 16px;
  border-radius: 6px;
  background: var(--color-second);
}

.account-menu:hover .account-menu__dropdown,
.account-menu:focus-within .account-menu__dropdown {
  display: block;
}

.account-card {
  display: flex;
  gap: 16px;
}

.account-card__avatar {
  width: 80px;
  height: 80px;
  object-fit: cover;
}

.account-card__info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.vip-badge {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eab308;
}

.account-links {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
  font-size: 14px;
}

.account-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 4px;
}

.account-links a:hover {
  background: var(--color-primary-dark);
}

.account-links .is-logout {
  color: #fca5a5;
}

/* navbar trắng */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  background: #fff;
}

.site-logo {
  display: flex;
  flex-shrink: 0;
  align-items: center;
}

/* logo tròn ChinaLink */
.site-logo__img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.main-nav {
  display: none;
}

.main-nav__list {
  display: flex;
  justify-content: center;
  height: 100%;
  font-size: 16px;
  font-weight: 500;
}

.main-nav__item {
  position: relative;
  height: 100%;
}

.main-nav__link {
  display: flex;
  align-items: center;
  height: 100%;
  padding-inline: 12px;
  border-bottom: 4px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

/* chữ đỏ + gạch chân vàng như logo */
.main-nav__link:hover,
.main-nav__link[aria-current="page"] {
  color: var(--color-second);
  border-bottom-color: var(--color-main);
}

.main-nav__sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  padding-block: 8px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  font-size: 14px;
  font-weight: 600;
}

.main-nav__item:hover .main-nav__sub,
.main-nav__item:focus-within .main-nav__sub {
  display: block;
}

.main-nav__sub a {
  display: block;
  padding: 8px 16px;
}

.main-nav__sub a:hover {
  color: var(--color-second);
  background: var(--color-cream);
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border-radius: 6px;
  background: var(--color-second);
  color: #fff;
  font-size: 22px;
}


@media (min-width: 768px) {
  .site-header {
    height: 80px;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 48px;
    color: #fff;
  }

  /* menu cao hơn để logo to rõ; bo góc, nổi cách mép màn hình */
  .navbar {
    width: calc(100% - var(--gutter) * 2);
    max-width: calc(var(--container) - var(--gutter) * 2);
    height: 80px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  }

  .site-logo__img {
    width: 68px;
    height: 68px;
  }
}

@media (min-width: 1024px) {
  .navbar {
    align-items: stretch;
    padding-inline: 24px;
  }

  .main-nav {
    display: block;
    flex: 1;
  }

  .menu-toggle {
    display: none;
  }
}

@media (min-width: 1280px) {
  .main-nav__link {
    padding-inline: 24px;
  }
}

/* =========================================================
   MENU MOBILE – ngăn kéo trượt từ phải (JS bật class .is-open)
   ========================================================= */
.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(340px, 88vw);
  background: #fff;
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0.3s;
}

.mobile-nav.is-open {
  transform: none;
  visibility: visible;
}

.mobile-nav__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 16px 20px;
  background: var(--bg-dark);
  color: #fff;
}

.mobile-nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-nav__brand img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.mobile-nav__brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.mobile-nav__brand strong {
  font-size: 18px;
  font-weight: 800;
}

.mobile-nav__brand small {
  font-size: 12px;
  color: var(--color-gold-light);
}

.mobile-nav__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 18px;
  transition: background-color 0.2s;
}

.mobile-nav__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* tỉ giá + hotline (topbar bị ẩn trên mobile) */
.mobile-nav__info {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-cream);
  border-bottom: 1px solid #f1e4c8;
}

.mobile-nav__info p {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  color: #6b6b73;
}

.mobile-nav__info strong,
.mobile-nav__info a {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-second);
  white-space: nowrap;
}

/* lớp phủ sau menu mobile đậm hơn mặc định (main.css) */
.main-overlay {
  background: rgba(15, 15, 15, 0.55);
}

.mobile-nav__body {
  flex: 1;
  overflow-y: auto;
  padding-block: 8px;
}

.mobile-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #2b2b30;
  text-align: left;
  transition: background-color 0.2s, color 0.2s;
}

.mobile-nav__link:hover,
.mobile-nav__link:active {
  background: var(--color-cream);
}

.mobile-nav__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f6f6f8;
  color: var(--color-second);
  font-size: 15px;
  transition: background-color 0.2s, color 0.2s;
}

.mobile-nav__chev {
  margin-left: auto;
  font-size: 12px;
  color: #b9b9c0;
  transition: transform 0.2s;
}

/* trang đang xem: chữ đỏ, icon nền đỏ, vạch vàng bên trái */
.mobile-nav__link[aria-current="page"] {
  color: var(--color-second);
  background: var(--color-cream);
}

.mobile-nav__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--color-main);
}

.mobile-nav__link[aria-current="page"] .mobile-nav__icon {
  background: var(--color-second);
  color: var(--color-gold-light);
}

.mobile-navbar-parent[aria-expanded="true"] .mobile-nav__chev {
  transform: rotate(180deg);
}

.mobile-navbar-children {
  margin: 0 20px 6px 70px;
  padding-left: 12px;
  border-left: 2px solid #f1e4c8;
}

.mobile-navbar-children a {
  display: block;
  padding: 8px 0;
  font-size: 14px;
  color: #6b6b73;
}

.mobile-navbar-children a:hover {
  color: var(--color-second);
}

.mobile-nav__foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--color-muted);
}

.mobile-nav__auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn--outline {
  border: 1.5px solid var(--color-second);
  background: #fff;
  color: var(--color-second);
}

.btn--outline:hover {
  background: var(--color-second);
  color: #fff;
}

.mobile-nav__user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-nav__user img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.mobile-nav__user span {
  display: flex;
  flex: 1;
  flex-direction: column;
  font-size: 12px;
  color: #6b6b73;
}

.mobile-nav__user strong {
  font-size: 15px;
  color: #1e1e1e;
}

.mobile-nav__user a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f6f6f8;
  color: var(--color-second);
}

.mobile-nav__social {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.mobile-nav__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f6f6f8;
  color: #3e3e44;
  transition: background-color 0.2s, color 0.2s;
}

.mobile-nav__social a:hover {
  background: var(--color-second);
  color: #fff;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  padding-top: 64px;
  padding-bottom: 48px;
  background: var(--bg-dark);
  color: #fff;
  font-size: 16px;
}

.site-footer__top {
  display: grid;
  gap: 40px;
  padding-bottom: 48px;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.site-footer__brand img {
  width: 112px;
  height: 112px;
  border-radius: 50%;
}

.site-footer__slogan {
  max-width: 420px;
  font-weight: 700;
}

.social-list {
  display: flex;
  gap: 16px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: 20px;
  transition: background-color 0.2s;
}

.social-btn:hover {
  background: var(--color-main);
}

.site-footer__links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.footer-col__title {
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 700;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a:hover {
  color: var(--color-main);
}

.footer-col i {
  margin-right: 8px;
}

.site-footer__fanpage {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-page-frame {
  display: block;
  width: 100%;
  max-width: 340px;
  height: 130px;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.contact-bar {
  display: grid;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
}

.contact-bar__item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid #000;
}

.contact-bar__item i {
  display: none;
  width: 40px;
  font-size: 32px;
  text-align: center;
}

.contact-bar__value {
  font-weight: 700;
  word-break: break-word;
}

a.contact-bar__value:hover {
  color: var(--color-main);
}

@media (min-width: 460px) {
  .contact-bar__item i {
    display: inline-block;
  }
}

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

  .site-footer__links {
    order: 3;
    grid-column: 1 / -1;
    max-width: 480px;
  }
}

@media (min-width: 1280px) {
  .site-footer__top {
    grid-template-columns: 1.2fr 1fr 1fr;
  }

  .site-footer__links {
    order: 0;
    grid-column: auto;
  }

  .contact-bar {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact-bar__item {
    border-bottom: 0;
    border-right: 1px solid #000;
  }

  .contact-bar__item:last-child {
    border-right: 0;
  }
}

/* ---------- Back to top (JS bật class .active) ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 64px;
  z-index: 30;
  display: none;
  font-size: 32px;
  line-height: 1;
  color: var(--color-second);
}

.back-to-top.active {
  display: block;
}

@media (min-width: 768px) {
  .back-to-top {
    right: 40px;
    font-size: 40px;
  }
}
