.main-header {
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 1040;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.header-wrap {
  display: flex;
  align-items: center;
  gap: 44px;
  padding: 14px 0;
}
.hamburger {
  display: none;
  background: transparent;
  border: 0;
  color: #111;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.hamburger i {
  font-size: inherit;
}
/* Ensure react-icons sizing matches */
.hamburger svg {
  width: 1em;
  height: 1em;
}

.logo img {
  display: block;
  height: 60px;
  width: auto;
}

.main-nav {
  flex: 1;
}

.menu {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
}

.menu a {
  color: #222;
  text-decoration: none;
  font-weight: 600;
}
.menu a {
  transition: color 0.25s ease;
}

.menu a:hover {
  color: #f5a623;
}

.menu .has-dropdown > a {
  position: relative;
}

.menu .has-dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #e6e6e6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  width:max-content;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease,
    visibility 0.25s step-end;
  padding: 12px;
  z-index: 1050;
}

.menu .has-dropdown:hover .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s;
}

.dropdown-header {
  background: #000;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 700;
  margin-bottom: 10px;
}

.dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dropdown-list a {
  color: #555;
  text-decoration: none;
  display: block;
  padding: 6px 8px;
  border-radius: 4px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.dropdown-list a:hover {
  background: #f5f5f5;
  color: #000;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.search-form {
  display: flex;
  align-items: center;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  overflow: hidden;
}
.search-wrap {
  position: relative;
}

.search-input {
  border: 0;
  outline: none;
  padding: 9px 12px;
  width: 260px;
  font-size: 14px;
}

.search-btn {
  background: #ffb81c;
  border: 0;
  color: #fff;
  width: 46px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-btn i {
  font-size: 18px;
}
.search-btn {
  transition: background-color 0.25s ease;
}

.search-btn:hover {
  background: #ffab00;
}
.search-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s step-end;
  z-index: 1100;
}
.search-wrap:focus-within .search-suggest,
.search-wrap:has(.search-input:not(:placeholder-shown)) .search-suggest {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}
.suggest-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 300px;
  overflow: auto;
  display: grid;
  gap: 4px;
}
.suggest-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #0b1320;
  padding: 8px 8px;
  border-radius: 8px;
}
.suggest-item:hover {
  background: #f6f8ff;
}
.suggest-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #f2f2f2;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.suggest-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.suggest-meta {
  display: grid;
}
.suggest-title {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
}
.suggest-price {
  font-weight: 800;
  color: #0b1320;
  font-size: 12px;
}

.cart {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0a0a0a;
}

.cart .count {
  font-weight: 400;
  font-size: 26px;
}

.cart i {
  font-size: 24px;
}
.cart-ico {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Drawer: checkbox-driven */
.drawer-toggle {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transform: translateX(-100%);
  transition: transform 0.35s ease;
  z-index: 1070;
  display: flex;
  flex-direction: column;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}
.drawer-logo {
  text-decoration: none;
  font-weight: 800;
  color: #6b21a8;
}
.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f4f4f5;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.drawer-close svg {
  width: 22px;
  height: 22px;
}

.drawer-nav {
  display: grid;
  padding: 10px;
}
.drawer-link {
  padding: 10px 12px;
  text-decoration: none;
  color: #111;
  border-radius: 8px;
}
.drawer-link:hover {
  background: #f6f6f6;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s step-end;
  z-index: 1065;
}

.drawer-toggle:checked ~ .drawer-overlay {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0s;
}
.drawer-toggle:checked ~ .drawer {
  transform: translateX(0);
}

/* Tabs inside drawer */
.drawer-tab {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.drawer-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 8px 10px 0;
  background: #f6f6f6;
  border-radius: 8px;
  position: relative;
}
.drawer-tabs .tab {
  text-align: center;
  padding: 10px 0;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 2;
}
.drawer-tabs .active-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50%;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: inset 0 -2px 0 #8b5cf6;
  transition: transform 0.25s ease;
  z-index: 1;
}
#drawerTabCategories:checked ~ .drawer-tabs label[for="drawerTabCategories"],
#drawerTabMenu:checked ~ .drawer-tabs label[for="drawerTabMenu"] {
  color: #4c1d95;
}

/* Panels */
.drawer-panels {
  position: relative;
  overflow: hidden;
}
.panel {
  padding: 8px 10px;
}
.drawer-list {
  list-style: none;
  margin: 0;
  padding: 10px 0 0;
}
.drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  text-decoration: none;
  color: #111;
  border-bottom: 1px solid #f1f1f1;
}
.drawer-row:hover {
  background: #fafafa;
}
.row-ico {
  color: #6b7280;
  display: inline-flex;
  align-items: center;
}
.row-ico svg {
  width: 18px;
  height: 18px;
}

/* Tab selection behavior */
#drawerTabCategories:checked ~ .drawer-tabs .active-bar {
  transform: translateX(0);
}
#drawerTabMenu:checked ~ .drawer-tabs .active-bar {
  transform: translateX(100%);
}
#drawerTabCategories:checked ~ .drawer-panels .panel-categories {
  display: block;
}
#drawerTabCategories:checked ~ .drawer-panels .panel-menu {
  display: none;
}
#drawerTabMenu:checked ~ .drawer-panels .panel-categories {
  display: none;
}
#drawerTabMenu:checked ~ .drawer-panels .panel-menu {
  display: block;
}

/* Defaults */
.panel-categories,
.panel-menu {
  display: none;
}
#drawerTabCategories:checked ~ .drawer-panels .panel-categories {
  display: block;
}

/* Additions for drawer row layout and nested menus */
.drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  text-decoration: none;
  color: #111;
  border-bottom: 1px solid #f1f1f1;
}
.drawer-row .row-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.row-icon svg {
  width: 18px;
  height: 18px;
  color: #6b7280;
  margin-right: 10px;
}
.row-text {
  font-weight: 600;
}

.drawer-item {
  border-bottom: 1px solid #f1f1f1;
}
.drawer-item summary {
  list-style: none;
  cursor: pointer;
}
.drawer-item summary::-webkit-details-marker {
  display: none;
}
.drawer-item[open] .row-ico {
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}
.drawer-item .row-ico {
  transition: transform 0.2s ease;
}
.drawer-sub {
  list-style: none;
  margin: 0;
  padding: 6px 0 10px 32px;
  display: grid;
}
.drawer-sub .drawer-row {
  border: 0;
  padding: 8px 6px;
}

@media (max-width: 992px) {
  .main-nav {
    display: none;
  }
  .search-input {
    width: 180px;
  }
}

/* Tablet layout tweaks: 1199px to 992px */
@media (max-width: 1199px) and (min-width: 992px) {
  .menu {
    gap: 18px;
  }
  .logo img {
    height: 54px;
  }
}

/* Mobile header: <= 992px */
@media (max-width: 992px) {
  .header-wrap {
    gap: 12px;
    justify-content: space-between;
    padding: 2px 0;
  }
  .hamburger {
    display: inline-flex;
  }
  .logo {
    margin: 0 auto;
    order: 2;
  }
  .logo img {
    height: 50px;
  }
  .header-right {
    order: 3;
  }
  .search-form {
    display: none;
  }
}

/* Sticky bottom mobile tabbar */
.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  border-top: 1px solid #e6e6e6;
  display: none;
  z-index: 1060;
}
.mobile-tabbar .tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #222;
  padding: 8px 6px;
  transition: color 0.25s ease, background-color 0.25s ease, transform 0.2s ease;
}
.mobile-tabbar .tab-item i {
  font-size: 20px;
}
.mobile-tabbar .tab-item span {
  font-size: 12px;
  margin-top: 2px;
}
.mobile-tabbar .tab-item:hover {
  color: #00834a;
  background: #f5fef9;
  transform: translateY(-2px);
}
@media (max-width: 992px) {
  .mobile-tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }
  body {
    padding-bottom: 60px;
  }
}
