/* =============================================
   TOP BAR + HEADER + NAV MENU
============================================= */

.topbar {
  background: var(--violet-700);
  color: var(--white);
  font-size: 0.82rem;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  text-align: center;
}

.topbar-spacer {
  display: none;
}

.topbar-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.topbar-msg {
  opacity: 0.95;
  margin: 0;
  text-align: center;
}

.header {
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 10px 24px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.logo-mark {
  color: var(--violet-700);
}

.logo-sub {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}

.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-100);
  border-radius: 999px;
  padding: 11px 18px;
  color: var(--gray-500);
  max-width: 520px;
  position: relative;
}

.search-bar form {
  width: 100%;
  display: flex;
  align-items: center;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.92rem;
  font-family: inherit;
}

/* Live Search Autocomplete Dropdown Overlay */
.live-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border: 1px solid #e2e8f0;
  z-index: 1050;
  overflow: hidden;
  max-height: 380px;
  overflow-y: auto;
  padding: 8px 6px;
}

.live-search-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  margin: 3px 4px;
  border-radius: 10px;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease, transform 0.15s ease;
}

.live-search-item:last-of-type {
  border-bottom: none;
}

.live-search-item:hover {
  background: #f8fafc;
}

.live-search-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  background: #f1f5f9;
  flex-shrink: 0;
}

.live-search-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.live-search-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-search-category {
  font-size: 0.75rem;
  color: #64748b;
}

.live-search-price {
  font-size: 0.88rem;
  font-weight: 800;
  color: #9333ea;
  flex-shrink: 0;
}

.live-search-all {
  display: block;
  padding: 14px 18px;
  margin: 6px 4px 2px;
  border-radius: 10px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #9333ea;
  background: #faf5ff;
  text-decoration: none;
  transition: background 0.15s ease;
}

.live-search-all:hover {
  background: #f3e8ff;
}

.live-search-empty {
  padding: 20px 18px;
  text-align: center;
  font-size: 0.88rem;
  color: #64748b;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--ink-soft);
  transition: color 0.2s ease, transform 0.15s ease;
}

.icon-btn:hover {
  color: var(--violet-700);
}

.icon-btn svg {
  width: 22px !important;
  height: 22px !important;
  display: block;
  stroke-width: 2;
  flex-shrink: 0;
}

.icon-btn .badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--violet-700);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
  box-sizing: border-box;
  line-height: 1;
}

.account-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--violet-700);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.navmenu {
  border-top: 1px solid var(--gray-200);
}

.navmenu-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 24px;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 30px;
}

.navlinks a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s ease;
  white-space: nowrap;
  position: relative;
  padding: 6px 0;
}

.navlinks a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--violet-700);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.navlinks a:hover::after,
.navlinks a.active::after {
  transform: scaleX(1);
}

.navlinks a:hover,
.navlinks a.active {
  color: var(--violet-700);
}

.promo-link {
  color: var(--red-500);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mobile-only-nav-item {
  display: none;
}

@media (max-width: 992px) {
  .search-bar {
    display: none;
  }

  .account-link span {
    display: none;
  }
}

@media (max-width: 992px) {
  .menu-toggle {
    display: flex;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .header-inner {
    padding: 10px 16px;
  }

  /* Hide wishlist, cart and account buttons from the main header bar on mobile */
  .header-actions>.icon-btn,
  .header-actions>.account-link {
    display: none !important;
  }

  .navmenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-top: 1px solid var(--gray-100);
  }

  .navmenu.open {
    display: block;
  }

  .navmenu-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 12px 16px;
  }

  .navlinks {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .navlinks li {
    width: 100%;
  }

  .navlinks a {
    display: block;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
  }

  .navlinks a::after {
    display: none;
  }

  /* Show mobile-only list items */
  .mobile-only-nav-item {
    display: block;
    width: 100%;
  }

  .mobile-search-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
  }

  .mobile-search-bar {
    display: flex !important;
    max-width: 100%;
    margin: 8px 0;
    background: var(--gray-100);
    border-radius: 999px;
    padding: 10px 16px;
    position: relative;
  }

  .mobile-search-bar .live-search-results {
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: 100%;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-radius: 14px;
    padding: 6px;
  }

  .mobile-action-link {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--gray-100);
  }

  .mobile-action-link svg {
    color: var(--ink-soft);
  }

  .mobile-action-link .badge {
    background: var(--violet-700);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .promo-link {
    display: flex !important;
    align-items: center;
    width: 100%;
    padding: 10px 0 0 0;
    font-size: 0.92rem;
    line-height: 1.4;
  }
}