/*
Theme Name: thienvan-b4f
Theme URI: https://b4fvina.com
Author: DevVN / Thien Van B4F
Author URI: https://levantoan.com
Description: Theme WordPress cho B4FVINA - Giải pháp truyền điện & linh kiện bán dẫn cho công nghiệp hiện đại.
Version: 1.0.0
Text Domain: thienvan-b4f
*/

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: #081d44;
  background: #fff;
}

.container {
  width: min(1180px, calc(100% - 48px));
  margin: auto;
}

/* TOPBAR */
.topbar {
  background: #08407f;
  color: #eaf4ff;
  font-size: 12px;
}

.topbar-inner {
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-links {
  display: flex;
  gap: 24px;
}

.top-links a,
.top-links span {
  color: #eaf4ff;
  text-decoration: none;
}

/* HEADER & NAV */
.header {
  background: #fff;
  border-bottom: 1px solid #e8eef7;
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 35px;
}

.brand {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  line-height: 0.9;
  flex-shrink: 0;
}

.brand-main {
  font-size: 34px;
  font-weight: 800;
  color: #0757b8;
  letter-spacing: -1.5px;
}

.brand-sub {
  font-size: 10px;
  font-weight: 700;
  color: #0c4586;
  letter-spacing: 2px;
}

.header-search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  height: 44px;
  background: #f3f7fc;
  border: 1px solid #e0e9f5;
  border-radius: 999px;
  padding: 0 6px 0 20px;
}

.header-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: #0a1730;
}

.header-search input::placeholder {
  color: #94a3b8;
}

.header-search button {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #0757b8;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.header-search button:hover {
  background: #044ba1;
}

.menu {
  display: flex;
  gap: 29px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu a,
.menu li > a {
  color: #0a1730;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  height: 76px;
  display: flex;
  align-items: center;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.menu a.active,
.menu a:hover,
.menu li.current-menu-item > a,
.menu li > a:hover {
  color: #0961ca;
  border-bottom-color: #176ee8;
}

/* 2-level dropdown submenu (e.g. SẢN PHẨM) */
.menu li {
  position: relative;
}

.menu li.menu-item-has-children > a::after {
  content: "⌄";
  margin-left: 5px;
  font-size: 10px;
}

.menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(16, 59, 107, 0.12);
  z-index: 100;
}

.menu li.menu-item-has-children:hover > .sub-menu,
.menu li.menu-item-has-children:focus-within > .sub-menu {
  display: block;
}

.menu .sub-menu li {
  width: 100%;
}

.menu .sub-menu a,
.menu .sub-menu li > a {
  height: auto;
  padding: 10px 20px;
  border-bottom: none;
  white-space: nowrap;
  font-weight: 600;
}

.menu .sub-menu a:hover,
.menu .sub-menu li > a:hover {
  background: #f2f7ff;
  color: #0961ca;
  border-bottom: none;
}

.hotline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #0757b8;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.hotline strong,
.hotline small {
  display: block;
}

.hotline strong {
  font-size: 14px;
}

.hotline small {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

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

/* HERO SECTION */
.hero {
  background: linear-gradient(90deg, #f7fbff 0, #eef7ff 46%, #eaf5ff 100%);
  overflow: hidden;
}

.hero-grid {
  min-height: 520px;
  display: grid;
  grid-template-columns: 46% 54%;
  align-items: center;
}

.hero-copy {
  padding: 52px 0;
}

.hero h1 {
  font-size: 40px;
  line-height: 1.18;
  margin: 0 0 20px;
  letter-spacing: -1.7px;
  color: #081d44;
}

.hero h1 span {
  color: #075bc5;
}

.hero p {
  font-size: 14px;
  line-height: 1.75;
  color: #253a55;
  max-width: 550px;
}

.hero-benefits {
  display: flex;
  gap: 23px;
  margin: 28px 0;
}

.hero-benefits > div {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
}

.hero-benefits b {
  grid-row: 1/3;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #0963c8;
  color: #fff;
  display: grid;
  place-items: center;
  font-style: normal;
}

.hero-benefits strong {
  font-size: 11px;
}

.hero-benefits small {
  font-size: 9px;
  color: #52647b;
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: 0 24px;
  border-radius: 3px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
}

.primary {
  background: #0862c8;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 88, 190, 0.18);
}

.primary:hover {
  background: #064ea5;
  color: #fff;
}

.secondary {
  background: #fff;
  color: #0757b8;
  border: 1px solid #176ee8;
}

.secondary:hover {
  background: #f0f7ff;
  color: #0757b8;
}

.btn.small {
  min-height: 38px;
  padding: 0 20px;
  margin-top: 22px;
}

.hero-art {
  height: 520px;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* STATS SECTION */
.stats {
  background: linear-gradient(90deg, #0457bf, #076ddd);
  color: #fff;
}

.stats-grid {
  height: 82px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
}

.stats-grid > div {
  display: grid;
  grid-template-columns: 45px auto;
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: center;
}

.stat-icon {
  grid-row: 1/3;
  font-size: 25px;
  opacity: 0.85;
}

.stats strong {
  font-size: 26px;
  line-height: 1;
}

.stats small {
  font-size: 11px;
  margin-top: 5px;
}

/* SECTION GENERAL */
.section {
  padding: 52px 0;
}

/* ABOUT SECTION */
.about-grid {
  display: grid;
  grid-template-columns: 44% 56%;
  gap: 48px;
  align-items: center;
}

.about-image img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  color: #0a66ce;
  letter-spacing: 0.4px;
}

.about h2,
.section-heading h2 {
  font-size: 29px;
  line-height: 1.08;
  margin: 8px 0 14px;
  letter-spacing: -0.8px;
}

.about-copy > p {
  font-size: 13px;
  line-height: 1.7;
  color: #405168;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 34px;
  margin-top: 25px;
}

.feature-grid > div {
  display: flex;
  gap: 12px;
}

.feature-grid span {
  flex: 0 0 38px;
  height: 38px;
  border: 2px solid #2a7be5;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #0963c8;
}

.feature-grid strong {
  display: block;
  font-size: 12px;
}

.feature-grid small {
  display: block;
  color: #617188;
  font-size: 10px;
  line-height: 1.45;
  margin-top: 3px;
}

/* PRODUCTS SECTION */
.products {
  background: #fbfdff;
}

.section-heading {
  text-align: center;
  margin-bottom: 24px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.product-card {
  position: relative;
  background: #fff;
  border: 1px solid #e7eef8;
  border-radius: 4px;
  padding: 18px 18px 17px;
  min-height: 275px;
  box-shadow: 0 8px 24px rgba(16, 59, 107, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(16, 59, 107, 0.12);
}

.product-image {
  aspect-ratio: 4 / 3;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: -4px -3px 4px;
}

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

.product-card h3 {
  font-size: 16px;
  margin: 6px 0;
  color: #071c43;
}

.product-card p {
  font-size: 10px;
  line-height: 1.45;
  color: #52647c;
  max-width: 88%;
  margin: 0;
}

.product-card > a {
  position: absolute;
  right: 16px;
  bottom: 20px;
  background: #0562cf;
  color: #fff;
  text-decoration: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
}

.product-card > a:hover {
  background: #044ba1;
}

.center {
  text-align: center;
  margin-top: 14px;
}

/* APPLICATIONS SECTION */
.applications {
  padding-top: 18px;
}

.application-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.application-grid article {
  text-align: center;
}

.application-grid img {
  width: 100%;
  aspect-ratio: 1.3 / 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.application-grid strong {
  display: block;
  font-size: 13px;
  margin-top: 9px;
}

/* FOOTER */
.footer {
  background: linear-gradient(135deg, #06448e, #002b66);
  color: #fff;
  padding-top: 38px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 34px;
}

.footer-brand {
  font-size: 27px;
  font-weight: 800;
}

.footer p {
  font-size: 13px;
  line-height: 1.7;
  color: #d8e9ff;
}

.footer h4 {
  font-size: 13px;
  margin: 4px 0 14px;
  text-transform: uppercase;
}

.footer a {
  display: block;
  color: #d8e9ff;
  font-size: 13px;
  margin: 8px 0;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: #ffffff;
}

.socials {
  letter-spacing: 7px;
  font-size: 12px;
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 28px;
  padding: 14px 0;
  text-align: center;
  font-size: 14px;
  color: #aac8e9;
}

.copyright a {
  display: inline;
  color: #aac8e9;
  text-decoration: underline;
}

.copyright a:hover {
  color: #ffffff;
}

/* DEFAULT PAGE / POST STYLES */
.page-content,
.post-content {
  padding: 0px 0;
  line-height: 1.8;
  min-width: 0;
  max-width: 100%;
}

/* Prevent oversized inline images/tables from old imported content
   (fixed px width/height attributes) from blowing out the layout. */
.entry-content img,
.entry-content video,
.entry-content iframe {
  max-width: 100%;
  height: auto;
}

.entry-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* NEWS LAYOUT (archive.php: content + right sidebar widget area) */
.news-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

.news-layout.no-sidebar {
  grid-template-columns: 1fr;
}

.news-sidebar {
  padding-top: 40px;
  min-width: 0;
  max-width: 100%;
}

.news-sidebar img {
  max-width: 100%;
  height: auto;
}

.news-sidebar .widget {
  background: #fff;
  border: 1px solid #e7eef8;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(16, 59, 107, 0.04);
}

.news-sidebar .widget-title {
  font-size: 15px;
  color: #071c43;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e7eef8;
}

.news-sidebar .widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-sidebar .widget li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f4fa;
  font-size: 13px;
}

.news-sidebar .widget li:last-child {
  border-bottom: none;
}

.news-sidebar .widget a {
  color: #253a55;
  text-decoration: none;
}

.news-sidebar .widget a:hover {
  color: #0961ca;
}

/* RELATED POSTS ("Có thể bạn quan tâm") on single.php */
.related-posts {
  margin-top: 50px;
  padding-top: 40px;
  border-top: 1px solid #e7eef8;
}

.related-title {
  font-size: 22px;
  color: #081d44;
  margin: 0 0 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.related-card {
  border: 1px solid #e7eef8;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(16, 59, 107, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(16, 59, 107, 0.12);
}

.related-thumb {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.related-card h4 {
  font-size: 15px;
  margin: 14px 16px 8px;
  color: #071c43;
}

.related-card h4 a {
  color: inherit;
  text-decoration: none;
}

.related-card h4 a:hover {
  color: #0961ca;
}

.related-excerpt {
  font-size: 13px;
  color: #52647c;
  line-height: 1.6;
  margin: 0 16px 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 980px) {
  .news-layout {
    grid-template-columns: 1fr;
  }
}

.page-title,
.post-title {
  font-size: 32px;
  margin-bottom: 20px;
  color: #0757b8;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 980px) {
  .menu {
    display: none;
  }
  .header-search {
    display: none;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-art {
    height: 400px;
  }
  .hero-copy {
    padding-bottom: 20px;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .application-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 28px, 1180px);
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  .top-links {
    display: none;
  }
  .hotline {
    display: none;
  }
  .brand-main {
    font-size: 28px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .hero-benefits {
    flex-direction: column;
  }
  .hero-art {
    height: 300px;
  }
  .stats-grid {
    height: auto;
    grid-template-columns: 1fr 1fr;
    padding: 16px 0;
    gap: 20px;
  }
  .about-image img {
    height: 250px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .product-grid {
    grid-template-columns: 1fr;
  }
  .application-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 38px 0;
  }
}
