/* =========================================================
   Vật Liệu 365 – Frontend Stylesheet
   Màu sắc: xanh chủ đạo, cam đất làm điểm nhấn, trắng/xám nhạt nền
   Font: Google Fonts Inter + Be Vietnam Pro (hỗ trợ tiếng Việt)
   ========================================================= */

:root {
  --primary: #0066A2;
  --primary-dark: #004F7E;
  --primary-light: #E6F2FA;
  --accent: #C75B3A;
  --accent-hover: #A84A2E;
  --text: #333333;
  --text-muted: #666666;
  --bg: #FFFFFF;
  --bg-gray: #F5F7FA;
  --border: #E2E8F0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --container: 1200px;
  --header-height: 80px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
small {
  font-family: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer small { color: rgba(255,255,255,.7); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.logo img {
  max-height: 60px;
  width: auto;
  transition: transform .2s;
}
.logo:hover img { transform: scale(1.02); }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
}
.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav > .nav-item > a {
  position: relative;
  padding: 10px 16px;
  color: var(--text);
  font-weight: 600;
  font-size: .92rem;
  white-space: nowrap;
  border-radius: 30px;
  transition: color .2s, background .2s;
}
.nav > .nav-item > a:hover { color: var(--primary); background: rgba(0,102,162,.06); }
.nav > .nav-item.active > a,
.nav > .nav-item > a.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}
.dropdown-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0 8px;
  color: var(--text);
  font-size: .8rem;
  cursor: pointer;
}
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 1001;
}
.has-dropdown:hover .dropdown,
.has-dropdown.open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown a {
  display: block;
  padding: 10px 18px;
  color: var(--text);
  font-weight: 500;
  font-size: .9rem;
  white-space: nowrap;
}
.dropdown a:hover { background: var(--primary-light); color: var(--primary); }
.dropdown-all {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 8px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.header-cta {
  padding: 10px 22px;
  border-radius: 30px;
  font-weight: 700;
  font-size: .92rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,102,162,.25);
}
.header-cta i { margin-right: 6px; }

.mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  background: var(--primary-light);
  border: none;
  border-radius: 8px;
  font-size: 1.3rem;
  color: var(--primary);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: .85rem; }

/* Hero Banner */
.hero {
  position: relative;
  background: #f2f5f8;
  overflow: hidden;
}
.hero picture,
.hero img {
  display: block;
  width: 100%;
  height: auto;
}

/* Section */
.section { padding: 64px 0; }
.section-title {
  text-align: center;
  margin-bottom: 40px;
}
.section-title h2 {
  font-size: 1.9rem;
  color: var(--primary-dark);
  margin: 0 0 10px;
  position: relative;
  display: inline-block;
}
.section-title p { color: var(--text-muted); max-width: 600px; margin: 0 auto; }
.section-title h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent);
  margin: 10px auto 0;
  border-radius: 2px;
}
.bg-light { background: var(--bg-gray); }

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}
.category-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  text-align: center;
}
.category-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,.1); }
.category-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.category-card h3 {
  font-size: 1rem;
  padding: 16px;
  margin: 0;
  color: var(--text);
}

/* Product Grid / Card */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.product-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s;
}
.product-card:hover { transform: translateY(-4px); }
.product-card .thumb { position: relative; overflow: hidden; aspect-ratio: 1 / 1; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.product-card:hover .thumb img { transform: scale(1.05); }
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.product-card .info { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.product-card .brand { font-size: .8rem; color: var(--primary); font-weight: 600; text-transform: uppercase; }
.product-card h3 { font-size: 1.05rem; margin: 6px 0; color: var(--text); }
.product-card .sku { font-size: .8rem; color: var(--text-muted); }
.product-card .price {
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  margin: 10px 0;
}
.product-card .actions { margin-top: auto; }
.product-card .actions .btn { width: 100%; }

/* Brands */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  align-items: center;
}
.brand-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  transition: border-color .2s;
}
.brand-item:hover { border-color: var(--primary); }
.brand-item img { max-height: 60px; max-width: 100%; object-fit: contain; }

/* About teaser */
.about-teaser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.about-teaser img { border-radius: var(--radius); box-shadow: var(--shadow); }
.about-teaser h2 { color: var(--primary-dark); }

/* Service list */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.service-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.service-card img { width: 100%; height: 180px; object-fit: cover; }
.service-card .info { padding: 20px; }
.service-card h3 { margin-top: 0; color: var(--primary-dark); }

/* Project list */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.project-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.project-card img { width: 100%; height: 220px; object-fit: cover; }
.project-card .info { padding: 18px; }
.project-card h3 { margin: 0 0 8px; color: var(--primary-dark); }
.project-card .meta { color: var(--text-muted); font-size: .9rem; }

/* News list */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.news-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.news-card img { width: 100%; height: 180px; object-fit: cover; }
.news-card .info { padding: 18px; }
.news-card .date { color: var(--text-muted); font-size: .85rem; }
.news-card h3 { margin: 6px 0 10px; font-size: 1.05rem; color: var(--text); }

/* Contact CTA */
.contact-cta {
  background: linear-gradient(100deg, var(--primary), var(--primary-dark));
  color: #fff;
  text-align: center;
  padding: 60px 20px;
  border-radius: var(--radius);
}
.contact-cta h2 { margin-bottom: 12px; }
.contact-cta p { opacity: .95; margin-bottom: 24px; }

/* Page Banner */
.page-banner {
  background: var(--primary-light);
  padding: 50px 0;
  text-align: center;
}
.page-banner h1 { color: var(--primary-dark); margin: 0 0 8px; font-size: 2rem; }
.breadcrumb { color: var(--text-muted); font-size: .9rem; }
.breadcrumb a { color: var(--text-muted); }

/* Product list page layout */
.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}
.sidebar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.sidebar h3 {
  font-size: 1.1rem;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-light);
  color: var(--primary-dark);
}
.filter-group { margin-bottom: 24px; }
.filter-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: .95rem;
}
.filter-group input[type="checkbox"] { accent-color: var(--primary); }
.shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.shop-toolbar select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
}
.filter-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-tag {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .85rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.filter-tag a { color: var(--accent); font-weight: 700; }
.mobile-filter-btn { display: none; }

/* Product detail */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.product-gallery .main-image {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.product-gallery .main-image img { width: 100%; height: 420px; object-fit: contain; background: #fff; }
.thumbnail-list { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbnail-list img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
}
.thumbnail-list img.active, .thumbnail-list img:hover { border-color: var(--primary); }
.product-info h1 { font-size: 1.8rem; color: var(--primary-dark); margin-bottom: 12px; }
.product-meta { color: var(--text-muted); margin-bottom: 16px; }
.product-meta span { display: inline-block; margin-right: 16px; }
.product-info .price {
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
}
.product-info .summary { margin-bottom: 24px; }
.product-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.product-actions .btn { flex: 1; min-width: 160px; }

.product-tabs { margin-top: 40px; }
.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-nav button {
  background: transparent;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab-nav button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content h3 { color: var(--primary-dark); margin-top: 0; }

.specs-table {
  width: 100%;
  border-collapse: collapse;
}
.specs-table th, .specs-table td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}
.specs-table th { background: var(--primary-light); color: var(--primary-dark); width: 30%; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: .95rem;
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-message { padding: 12px; border-radius: 6px; margin-bottom: 20px; }
.form-message.success { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
.form-message.error { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; }

/* Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
}
.contact-info h2 { color: var(--primary-dark); }
.contact-item { margin-bottom: 20px; }
.contact-item strong { color: var(--primary); display: block; margin-bottom: 4px; }
.warehouse-list { list-style: none; padding: 0; margin: 0; }
.warehouse-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Fixed contact buttons */
.fixed-contact {
  position: fixed;
  right: 16px;
  bottom: 80px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fixed-contact a {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.fixed-contact .zalo { background: #0068FF; }
.fixed-contact .phone { background: var(--accent); }
.fixed-contact a img {
  width: 62%;
  height: 62%;
  object-fit: contain;
}

/* Mobile bottom bar */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  z-index: 1001;
  padding: 8px 0;
}
.mobile-bottom-bar-inner {
  display: flex;
  justify-content: space-around;
  max-width: var(--container);
  margin: 0 auto;
}
.mobile-bottom-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  color: var(--text);
}
.mobile-bottom-bar a.phone { color: var(--accent); }
.mobile-bottom-bar a.zalo { color: var(--primary); }
.mobile-bottom-bar a img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* Footer */
.footer {
  background: #0A2E45;
  color: #fff;
  padding: 56px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 32px;
}
.footer h4 { color: #fff; margin: 0 0 16px; font-size: 1.05rem; }
.footer p, .footer a { color: rgba(255,255,255,.8); font-size: .95rem; }
.footer a:hover { color: #fff; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 40px;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255,255,255,.6);
  font-size: .9rem;
}
.footer-bottom a { color: rgba(255,255,255,.6); }
.footer-visits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.85);
  font-weight: 600;
}
.footer-visits i { color: var(--primary-light); }

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state h3 { color: var(--primary-dark); margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 16px; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; list-style: none; padding: 0; margin-top: 32px; }
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}
.pagination a:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.pagination .active span { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Responsive */
@media (max-width: 1100px) {
  .header-inner { gap: 16px; }
  .nav > .nav-item > a { padding: 10px 10px; font-size: .88rem; }
}

@media (max-width: 992px) {
  .header-actions { display: none; }
  .nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 12px 20px 20px;
    box-shadow: 0 12px 24px rgba(0,0,0,.08);
    border-top: 1px solid var(--border);
    align-items: stretch;
    gap: 0;
  }
  .nav.open { display: flex; }
  .nav-item {
    width: 100%;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
  }
  .nav > .nav-item > a {
    flex: 1;
    padding: 14px 0;
    border-bottom: none;
    border-radius: 0;
    font-size: 1rem;
  }
  .nav > .nav-item > a::after { display: none; }
  .nav > .nav-item > a:hover,
  .nav > .nav-item.active > a,
  .nav > .nav-item > a.active { background: transparent; color: var(--primary); }
  .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
  }
  .dropdown-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
  .dropdown {
    position: static;
    width: 100%;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0 0 8px 12px;
  }
  .has-dropdown.open .dropdown { display: block; }
  .mobile-toggle { display: block; }
  .about-teaser, .contact-grid, .product-detail, .shop-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: block; }
  .mobile-filter-btn { display: inline-flex; margin-bottom: 16px; }
}

@media (max-width: 576px) {
  :root { --header-height: 70px; }
  .section { padding: 44px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .fixed-contact { bottom: 70px; right: 10px; }
  .fixed-contact a { width: 46px; height: 46px; font-size: 1.1rem; }
  .mobile-bottom-bar { display: block; }
  body { padding-bottom: 64px; }

  .category-grid,
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .category-card h3,
  .product-card h3 { font-size: .9rem; }
  .category-card h3 { padding: 10px; }
  .product-card .info { padding: 12px; }
  .product-card .brand { font-size: .7rem; }
  .product-card .price { font-size: .9rem; }
  .product-card .actions .btn { padding: 6px 12px; font-size: .8rem; }
}
