/* ==========================================================================
   NAVBAR — Header, Search, Category Navigation
   ========================================================================== */

/* ── Main Header ───────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #131921;
  border: none;
  color: #ffffff;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo { display: flex; align-items: center; }

.brand-logo {
  height: 80px;
  object-fit: contain;
  margin-top: 4px;
}

/* ── Search Bar ────────────────────────────────────────── */
.search-container {
  flex: 2;
  max-width: 800px;
  position: relative;
}

.search-bar-wrapper {
  display: flex;
  align-items: center;
  border: none;
  border-radius: 4px;
  overflow: hidden;
  height: 44px;
  background: #fff;
}

.search-bar-wrapper:focus-within {
  border-radius: 4px 4px 0 0;
}

.search-input {
  flex: 1;
  border: none;
  padding: 0 1.5rem;
  font-size: 1rem;
  outline: none;
  height: 100%;
  font-family: var(--font-sans);
}

.clear-btn {
  padding: 0 10px;
  height: 100%;
  cursor: pointer;
  background: #fff;
  border: none;
  display: flex;
  align-items: center;
  color: #999;
}

.search-submit-btn {
  height: 100%;
  padding: 0 2rem;
  background: var(--accent-color);
  color: #111;
  border: none;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.search-submit-btn:hover { background: var(--accent-hover); }

/* ── Search Suggestions Dropdown (Amazon-style) ────────── */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08);
  z-index: 200;
  max-height: 420px;
  overflow-y: auto;
  border-top: 1px solid #e3e6e6;
  scrollbar-width: thin;
}

.search-suggestions::-webkit-scrollbar { width: 6px; }
.search-suggestions::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.95rem;
  color: #0f1111;
  border-bottom: 1px solid #f5f5f5;
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
  background: #f0f2f2;
}

.search-suggestion-item .suggestion-icon {
  color: #888;
  font-size: 18px;
  flex-shrink: 0;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-suggestion-item .suggestion-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggestion-item .suggestion-text strong {
  font-weight: 600;
  color: #0f1111;
}

.search-suggestion-item .suggestion-category {
  font-size: 0.8rem;
  color: #565959;
  flex-shrink: 0;
  font-style: italic;
}

.search-suggestion-item .suggestion-fill {
  color: #565959;
  font-size: 16px;
  flex-shrink: 0;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.search-suggestion-item:hover .suggestion-fill {
  opacity: 1;
}

.search-suggestions-divider {
  padding: 6px 16px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #565959;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fafafa;
  border-bottom: 1px solid #e3e6e6;
}

/* ── Search Loading State ──────────────────────────────── */
.search-bar-wrapper.searching {
  box-shadow: 0 0 0 2px var(--accent-color);
  animation: searchPulse 1.5s ease-in-out infinite;
}

@keyframes searchPulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent-color); }
  50% { box-shadow: 0 0 0 3px rgba(246, 139, 30, 0.5); }
}

.search-submit-btn.loading {
  pointer-events: none;
  position: relative;
  color: transparent;
}

.search-submit-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2.5px solid rgba(17, 17, 17, 0.25);
  border-top-color: #111;
  border-radius: 50%;
  animation: searchSpin 0.6s linear infinite;
}

@keyframes searchSpin {
  to { transform: rotate(360deg); }
}

/* Search progress bar below navbar */
.search-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  overflow: hidden;
  z-index: 101;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.search-progress-bar.active {
  opacity: 1;
}

.search-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-color), #FFD814, var(--accent-color), transparent);
  border-radius: 2px;
  animation: searchProgressSlide 1.2s ease-in-out infinite;
}

@keyframes searchProgressSlide {
  0% { left: -40%; }
  100% { left: 100%; }
}


/* ── Nav Action Icons ──────────────────────────────────── */
.nav-actions { display: flex; gap: 1rem; }

.icon-btn {
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  width: 48px;
  height: 48px;
  color: #fff;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  background: transparent;
  border: 1px solid #fff;
  box-shadow: none;
  transform: none;
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent-color);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes cartPulse { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
.cart-badge.pulse { animation: cartPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

/* ── Category Discovery Nav ────────────────────────────── */
.category-nav-wrapper {
  background: #232F3E;
  border: none;
  box-shadow: none;
}

.category-list {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 0.75rem;
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-list::-webkit-scrollbar { display: none; }

.category-pill {
  flex-shrink: 0;
  border-radius: 2px;
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  font-weight: 500;
  padding: 6px 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* FIX: removed translateY(-2px) that caused the "jump up" glitch on click */
.category-pill:hover,
.category-pill.active {
  background: transparent;
  color: #fff;
  border-color: #fff;
  box-shadow: none;
  transform: none;
}

/* ── Subcategory Pills ─────────────────────────────────── */
.subcategory-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.subcategory-pill {
  border-radius: 6px;
  background: #fff;
  border: 1px solid #ddd;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.subcategory-pill:hover,
.subcategory-pill.active {
  background: var(--accent-light);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

/* ── Mobile Hamburger ──────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid transparent;
  color: #fff;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
}
.mobile-menu-btn:hover { border-color: #fff; }
