/* ================= TOKENS ================= */
:root {
  --nav-h: 56px;
  --bg: #fff;
  --text: #111;
  --muted: #6b6b6b;
  --border: #e5e5e5;
  --shadow: 0 14px 30px rgba(0,0,0,.15);
  /* light mode defaults */
  --bg: #ffffff;
  --text: #111111;
  --muted: #6b6b6b;
  --border: #e5e5e5;
  --shadow: 0 14px 30px rgba(0,0,0,.15);

  /* search (light) */
  --search-bg: #ffffff;
  --search-input-bg: #f5f5f5;
  --search-text: #111;
  --search-item-hover: #f0f0f0;
  --search-highlight-bg: #ffe9a8;
   --topbar-bg: #000000;
  --topbar-text: #ffffff;
  --topbar-muted: rgba(255,255,255,0.75);
  
}

html {
  scroll-behavior: smooth;
}

/* Sticky navbar offset fix */
#productsSection {
  scroll-margin-top: 80px; /* adjust if navbar height changes */
}
/* ================= SYSTEM DARK MODE ================= */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0b;
    --text: #ffffff;
    --muted: #b5b5b5;
    --border: #262626;
    --shadow: 0 20px 50px rgba(0,0,0,.6);

    /* search (dark) */
    --search-bg: #0f0f0f;
    --search-input-bg: #1a1a1a;
    --search-text: #ffffff;
    --search-item-hover: #1f1f1f;
    --search-highlight-bg: #2f2f2f;
  }
}

/* ================= TOP INFO BAR ================= */
.top-bar {
  background: var(--topbar-bg);
  color: var(--topbar-text);
  font-size: 12px;
}

.top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;

  min-height: 34px;
}

/* LEFT: contact info */
.top-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-left span {
  display: flex;
  align-items: center;
  gap: 6px;

  font-weight: 500;
  color: var(--topbar-muted);
}

/* RIGHT: social icons */
.top-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.top-right a {
  color: var(--topbar-muted);
  font-size: 14px;

  transition: color 0.2s ease, transform 0.2s ease;
}

.top-right a:hover {
  color: #ffffff;
  transform: translateY(-1px);
}



/* ================= NAVBAR ================= */
.main-navbar {
  height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 3000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
	
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 16px;
}

/* ================= LEFT / RIGHT ================= */

/* ================= NAVBAR GRID FIX ================= */

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end; /* 🔥 pushes icons fully right */
}

.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-user-btn span {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-logo {
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--text);
  text-decoration: none;
  margin-right: 32px; /* 👈 spacing from categories */
}

/* ================= DESKTOP CATEGORIES ================= */
.nav-categories {
  display: flex;
  gap: 22px;
  align-items: center;
}

.nav-cat {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.25s ease;
}

/* Elegant underline */
.nav-cat::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10px;      /* 👈 lower */
  width: 0%;
  height: 1.5px;      /* 👈 thinner */
  background: var(--text);
  transition: width 0.3s ease;
}

.nav-cat:hover {
  color: var(--text);
}

.nav-cat:hover::after,
.nav-cat.active::after {
  width: 100%;
}

.nav-cat.active {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.6px;
}

/* ================= ICON BUTTONS ================= */
/* ================= ADVANCED NAV ICONS ================= */

.nav-icon-btn {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 40px;
  height: 40px;

  border-radius: 50%;
  background: transparent;
  border: none;

  color: var(--text);
  font-size: 18px;

  cursor: pointer;
  transition:
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* hover effect */
.nav-icon-btn:hover {
  background: rgba(0,0,0,0.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* dark mode hover */
@media (prefers-color-scheme: dark) {
  .nav-icon-btn:hover {
    background: rgba(255,255,255,0.08);
    box-shadow: 0 6px 18px rgba(0,0,0,0.6);
  }
}

/* icon inside */
.nav-icon-btn i {
  font-size: 18px;
  line-height: 1;
}

/* ================= BADGE (ADVANCED) ================= */

.badge-wrap .badge {
  position: absolute;
  top: 6px;
  right: 6px;

  min-width: 16px;
  height: 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 10px;
  font-weight: 600;

  background: #ff3b3b;
  color: #fff;
  border-radius: 50%;
  padding: 0 4px;

  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  height: 40px;
  padding: 0 12px;

  border-radius: 20px;
  background: transparent;
  color: var(--text);

  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;

  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.nav-user-btn i {
  font-size: 18px;
}

.nav-user-btn:hover {
  background: rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .nav-user-btn:hover {
    background: rgba(255,255,255,0.08);
  }
}

/* ================= FLOATING SEARCH ================= */
/* ================= FLOATING SEARCH ================= */
.floating-search {
  position: fixed;
  top: calc(var(--nav-h) + 8px);
  left: 50%;
  transform: translateX(-50%);

  width: 520px;
  max-width: calc(100vw - 24px);

  background: var(--search-bg);
  border-radius: 16px;
  padding: 12px;

  z-index: 4000;
  box-shadow: var(--shadow);
}

/* search input */
.floating-search input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  padding: 14px 16px;
  border-radius: 12px;

  background: var(--search-input-bg);
  color: var(--search-text);
}

.floating-search input::placeholder {
  color: var(--muted);
}

/* ================= LIVE SEARCH DROPDOWN ================= */
.live-search-dropdown {
  margin-top: 12px;
  max-height: 280px;
  overflow-y: auto;
}

/* ================= LIVE SEARCH ITEM ================= */
.live-item {
  display: flex;
  gap: 14px;
  align-items: center;

  padding: 12px;
  border-radius: 12px;

  text-decoration: none;
  color: var(--search-text);

  transition: background .2s ease;
}

.live-item:hover {
  background: var(--search-item-hover);
}

/* product image */
.live-item img {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

/* text block */
.live-item .name {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

.live-item .price {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* highlighted search text */
.search-highlight {
  background: var(--search-highlight-bg);
  padding: 2px 4px;
  border-radius: 4px;
}
/* ================= SEARCH BACKDROP ================= */
.search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.15);
  backdrop-filter: blur(2px);
  z-index: 3500;
  pointer-events: auto;
}

/* 🔥 IMPORTANT: allow clicks when hidden */
.search-backdrop.d-none {
  pointer-events: none;
}

/* ================= NAVBAR Z-INDEX ================= */
.main-navbar {
  position: sticky;
  top: 0;
  z-index: 4000; /* ABOVE backdrop */
}

/* ================= MOBILE ================= */
@media (max-width: 576px) {
  .floating-search {
    left: 12px;
    right: 12px;
    transform: none;
    width: auto;
  }
}
/* ================= MOBILE MENU ================= */
.mobile-menu {
  background: var(--bg);
}

.mobile-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-category-list li {
  border-bottom: 1px solid var(--border);
}

.mobile-cat {
  display: block;
  padding: 14px 4px;

  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}

.mobile-cat:hover {
  background: rgba(0,0,0,.04);
}

@media (prefers-color-scheme: dark) {
  .mobile-cat:hover {
    background: rgba(255,255,255,.06);
  }
  
}
.desktop-only { display: flex; }
.mobile-only { display: none; }

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex; }
}

/* OFFCANVAS */
.offcanvas-menu {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: #fff;
  z-index: 5000;
  transition: left 0.3s ease;
  box-shadow: 8px 0 30px rgba(0,0,0,.25);
}

.offcanvas-menu.open {
  left: 0;
}

.offcanvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e5e5e5;
  font-weight: 600;
}

.offcanvas-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 4900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.offcanvas-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.mobile-category-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-cat {
  display: block;
  padding: 16px;
  font-size: 15px;
  text-decoration: none;
  color: #111;
}
