/* Đầu trang cửa hàng: logo, ô tìm kiếm, dịch vụ, giỏ hàng; thanh điều hướng có nút Shopee. */
/* Thuộc tính hidden luôn thắng các lớp có display riêng (.empty-state, .cart-layout...). */
[hidden] { display: none !important; }
.store-header .topbar { gap: 22px; min-height: 86px; }
.store-header .brand { flex: none; }
.store-header svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.store-search { flex: 1; display: flex; min-width: 0; max-width: 560px; margin-right: auto; height: 44px; border: 2px solid var(--orange); border-radius: 6px; overflow: hidden; background: #fff; }
.store-search input { flex: 1; min-width: 0; padding: 0 14px; border: 0; font: inherit; font-size: 14px; color: var(--dark); background: transparent; }
.store-search input:focus { outline: none; }
.store-search:focus-within { box-shadow: 0 0 0 3px #f65d1830; }
.store-search button { width: 56px; flex: none; border: 0; background: var(--orange); color: #fff; cursor: pointer; }
.store-search button:hover { background: #e14f0f; }
.store-search button svg { width: 22px; height: 22px; stroke-width: 2.4; }

.store-header .header-service { color: var(--dark); }
.store-header .header-service strong { display: block; font-size: 13px; }
.store-header .header-service > span:last-child { color: var(--muted); }
.store-header .header-service:hover strong { color: var(--orange); }
.store-header .service-icon { width: 34px; height: 34px; border: 0; color: var(--orange); }
.store-header .service-icon svg { width: 30px; height: 30px; }

.header-cart { position: relative; display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; color: var(--orange); }
.header-cart:hover { background: #fff1e6; }
.header-cart svg { width: 30px; height: 30px; }
.cart-count { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--dark); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; }
.cart-count.is-bump { animation: cart-bump .4s ease; }
@keyframes cart-bump { 40% { transform: scale(1.35); } }

/* Menu chính (từ Menu website) với menu con nhiều cấp */
.store-header .nav { position: relative; z-index: 30; }
.nav-menu { display: flex; align-items: stretch; margin: 0; padding: 0; list-style: none; }
.nav-menu > li { position: relative; display: flex; }
.nav-caret { margin-left: 5px; font-size: 10px; opacity: .8; }
.nav-sub { position: absolute; top: 100%; left: 0; z-index: 40; min-width: 220px; margin: 0; padding: 6px 0; list-style: none; border-radius: 0 0 8px 8px; background: #fff; box-shadow: 0 12px 30px #0d172033; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s; }
.nav-sub .nav-sub { top: -6px; left: 100%; border-radius: 8px; }
.nav-sub li { position: relative; }
.nav-inner .nav-sub a { display: flex; justify-content: space-between; min-height: 0; padding: 9px 16px; color: var(--dark); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.nav-inner .nav-sub a:hover { background: #fff4ec; color: var(--orange); }
.has-sub:hover > .nav-sub, .has-sub:focus-within > .nav-sub { opacity: 1; visibility: visible; transform: none; }

/* Mega menu "Danh mục sản phẩm" */
.mega { display: flex; }
.nav-inner .nav-category { display: flex; align-items: center; gap: 12px; min-width: 210px; padding: 0 15px; border: 0; background: var(--orange); color: #fff; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.mega.is-open .nav-category { background: #e14f0f; }
.mega-panel { position: absolute; top: 100%; left: 0; right: 0; z-index: 45; width: min(1240px, 100%); margin: 0 auto; padding: 18px 20px 14px; border-radius: 0 0 12px 12px; background: #fff; box-shadow: 0 18px 40px #0d172040; color: var(--dark); }
.mega-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 18px; max-height: min(70vh, 620px); overflow-y: auto; }
.mega-col { min-width: 0; }
.mega-root { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; }
.mega-root:hover { background: #fff4ec; }
.mega-root img, .mega-noimg { width: 44px; height: 44px; flex: none; border: 1px solid #f0e2d8; border-radius: 8px; background: #fff; object-fit: contain; }
.mega-noimg { display: grid; place-items: center; color: var(--orange); }
.mega-root strong { display: block; font-size: 14px; line-height: 1.3; }
.mega-root small { display: block; color: var(--muted); font-size: 12px; }
.mega-col ul { margin: 4px 0 0 60px; padding: 0; list-style: none; }
.mega-col li a { display: block; padding: 3px 0; color: #4b5661; font-size: 13px; }
.mega-col li a:hover { color: var(--orange); }
.mega-all { display: block; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--orange); font-size: 13px; font-weight: 700; text-align: right; }

.nav-inner .nav-shopee { margin-left: auto; gap: 8px; background: var(--orange); color: #fff; }
.nav-inner .nav-shopee:hover { background: #e14f0f; color: #fff; }
.nav-inner .nav-shopee svg { width: 18px; height: 18px; }

@media (max-width: 850px) {
  .store-header .topbar { flex-wrap: wrap; gap: 10px 14px; padding-top: 12px; padding-bottom: 12px; }
  .store-header .brand { margin-right: auto; }
  .store-search { order: 3; flex-basis: 100%; max-width: none; margin-right: 0; height: 42px; }
  .nav-inner .nav-shopee { margin-left: 0; }
  /* Điện thoại: thanh menu cuộn ngang nên không mở menu con; danh mục mở thành bảng toàn màn hình. */
  .nav-sub, .nav-caret { display: none; }
  .nav-inner .nav-category { min-width: auto; white-space: nowrap; }
  .mega-panel { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 75vh; border-radius: 14px 14px 0 0; overflow-y: auto; }
  .mega-grid { grid-template-columns: 1fr; max-height: none; }
  .nav-inner .mega-panel a { min-height: 0; white-space: normal; }
  .mega-col li a { padding: 6px 0; }
}
@media (prefers-reduced-motion: reduce) { .cart-count.is-bump { animation: none; } }

/* Chỉ dành cho trình đọc màn hình (nhãn ô tìm kiếm...). */
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
