@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&display=swap');

:root {
  --navy:       #0a2342;
  --navy-light: #163966;
  --gold:       #d4b26a;
  --gold-light: #f5edcc;
  --cream:      #f9f7f2;
  --white:      #ffffff;
  --gray-100:   #f2f1ef;
  --gray-200:   #e2e0db;
  --gray-400:   #9e9b94;
  --text-main:  #1a1917;
  --text-muted: #6b6861;
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --shadow-sm:  0 2px 10px rgba(0,0,0,.06);
  --shadow-md:  0 8px 24px rgba(0,0,0,.12);
  --transition: .3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Be Vietnam Pro', Arial, sans-serif;
  background: var(--cream);
  color: var(--text-main);
  overflow-x: hidden;
}

a { text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* -------- TOP BAR -------- */
#top {
  background: var(--navy);
  color: #d8e6f0;
  font-size: 13px;
  padding: 8px 0;
}
#topcontent {
  width: 80%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#topcontent-right { display: flex; align-items: center; gap: 8px; }
.list-cate a {
  color: #d8e6f0;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.list-cate a:hover { background: var(--gold); color: var(--white); }

/* -------- BANNER -------- */
#banner {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
#banner-content {
  width: 80%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  min-height: 110px;
}
#logo img {
  width: 120px;
  border-radius: 18px;
  border: 2px solid var(--gold-light);
  transition: var(--transition);
}
#logo img:hover { transform: scale(1.03); }
#deliver, #support, #time { display: flex; align-items: center; gap: 10px; }
#deliver img, #support img, #time img { width: 45px; height: 45px; object-fit: contain; }
#cart a {
  height: 52px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--navy-light), var(--navy));
  color: var(--white);
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
#cart a:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* -------- SEARCH -------- */
.search-section { background: #f4f7fb; padding: 24px 0; }
.search-box {
  max-width: 820px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 8px;
  transition: var(--transition);
}
.search-box:focus-within { border-color: var(--navy); box-shadow: 0 6px 24px rgba(10,35,66,.15); }
.search-category { border: none; outline: none; background: #f7f9fc; height: 46px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.search-input { flex: 1; border: none; outline: none; font-size: 14px; height: 46px; padding: 0 12px; }
.search-btn {
  width: 46px; height: 46px;
  border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; transition: var(--transition);
}
.search-btn:hover { transform: scale(1.05); }

/* -------- MENU -------- */
#menu {
  background: linear-gradient(90deg, var(--navy), var(--navy-light));
  position: sticky; top: 0; z-index: 1000; overflow: visible;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
#menu ul { display: flex; justify-content: center; width: 80%; margin: 0 auto; overflow: visible; }
#menu ul li a {
  display: block;
  padding: 16px 22px;
  color: #d8e6f0;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  transition: var(--transition);
}
#menu ul li a::after {
  content: '';
  position: absolute; left: 50%; bottom: 0;
  width: 0; height: 3px;
  background: var(--gold);
  transition: var(--transition);
}
#menu ul li a:hover { color: var(--gold-light); }
#menu ul li a:hover::after { width: 100%; left: 0; }

.dropdown { position: relative; }
.submenu {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 260px;
  background: #fff;
  border-radius: 18px;
  padding: 10px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  opacity: 0; visibility: hidden;
  transition: .3s ease; z-index: 9999;
  display: flex; flex-direction: column;
  pointer-events: none;
}
.dropdown:hover .submenu {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.submenu li a {
  display: flex; align-items: center;
  min-height: 48px; padding: 0 20px;
  font-size: 14px; color: #1a1917;
  background: #fff; white-space: nowrap;
}
.submenu li a:hover { background: #f5edcc; color: #0a2342; padding-left: 28px; }
.submenu li a::after { display: none; }

/* -------- BREADCRUMB -------- */
.breadcrumb {
  width: 80%;
  margin: 20px auto 0;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb a { color: var(--navy); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { color: var(--text-muted); }

/* -------- CATEGORY HEADER -------- */
.cate-hero {
  width: 80%;
  margin: 24px auto 0;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow-md);
}
.cate-hero-icon { font-size: 56px; }
.cate-hero h1 { color: #fff; font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.cate-hero p { color: rgba(255,255,255,.75); font-size: 15px; }
.cate-hero-bar {
  width: 48px; height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin-top: 10px;
}

/* -------- FILTER BAR -------- */
.filter-bar {
  width: 80%;
  margin: 28px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-bar span { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.filter-btn {
  padding: 8px 18px;
  border: 1px solid var(--gray-200);
  border-radius: 30px;
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.sort-select {
  margin-left: auto;
  padding: 8px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--white);
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
}

/* -------- PRODUCT GRID -------- */
.product-section {
  width: 80%;
  margin: 28px auto 60px;
}
.product-count {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.product-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}
.product-card.hidden { display: none; }

.badge-new, .badge-hot, .badge-sale {
  position: absolute;
  top: 14px; left: 14px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  color: #fff;
}
.badge-new  { background: #2196F3; }
.badge-hot  { background: #e53935; }
.badge-sale { background: #43a047; }

.product-card img {
  width: 160px; height: 160px;
  object-fit: contain;
  margin: 0 auto 14px;
  transition: var(--transition);
}
.product-card:hover img { transform: scale(1.07); }

.product-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.4;
}
.product-card .brand {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.product-card .price {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}
.product-card .old-price {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-bottom: 14px;
}
.stars { color: #f5a623; font-size: 13px; margin-bottom: 14px; }

.btn-add {
  width: 100%;
  padding: 10px 0;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-add:hover { opacity: .85; transform: translateY(-1px); }

/* -------- EMPTY STATE -------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  display: none;
}
.empty-state .icon { font-size: 56px; margin-bottom: 14px; }
.empty-state p { font-size: 16px; }

/* -------- TOAST -------- */
#toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--navy);
  color: #fff;
  padding: 13px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: var(--shadow-md);
  transition: transform .3s ease, opacity .3s ease;
  opacity: 0;
  white-space: nowrap;
}

/* -------- SCROLL TOP -------- */
#scroll-top {
  position: fixed;
  bottom: 80px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

/* -------- FOOTER -------- */
#footer {
  background: linear-gradient(135deg, var(--navy), #061c38);
  color: #d8e6f0;
  padding: 50px 0 25px;
}
#footer-content {
  width: 80%;
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-col { flex: 1 1 calc(25% - 30px); }
.footer-col b { color: var(--gold-light); font-size: 15px; display: block; margin-bottom: 14px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: #d8e6f0; transition: var(--transition); font-size: 14px; }
.footer-col ul li a:hover { color: var(--gold-light); padding-left: 5px; }
.footer-col p { line-height: 1.9; font-size: 14px; }

/* -------- RESPONSIVE -------- */
@media (max-width: 1200px) {
  #banner-content, .breadcrumb, .cate-hero,
  .filter-bar, .product-section, #footer-content { width: 95%; }
  #menu ul { width: 95%; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .cate-hero { padding: 24px; }
  .cate-hero h1 { font-size: 22px; }
  #deliver, #support, #time { display: none; }
}
@media (max-width: 600px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card img { width: 120px; height: 120px; }
  .cate-hero-icon { font-size: 36px; }
  #banner-content { flex-wrap: wrap; justify-content: center; }
  #cart a { width: auto; }
  .filter-bar { gap: 8px; }
  #footer-content { flex-direction: column; }
}

/* === FIX SUBMENU HIỂN THỊ === */
#menu {
  overflow: visible !important;
}
#menu > ul,
#menu ul {
  overflow: visible !important;
}
.dropdown {
  position: relative;
  overflow: visible !important;
}
.submenu {
  z-index: 99999 !important;
  position: absolute !important;
}