/* ═══════════════════════════════════════════════════════════════════
   WELLNES GURU — HEADER & NAVIGATION (Kama Ayurveda Style)
   ═══════════════════════════════════════════════════════════════════ */


/* ── Announcement Bar ── */
.announcement-bar {
  display: grid;
  place-items: center;
  min-height: 36px;
  background: #575757;
  color: #faf9f6;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  padding: 7px 16px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-align: center;
}
.announcement-message {
  margin: 0;
}

/* ── Main Header Shell ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: var(--bg-paper);
  border-bottom: 1px solid #e7e3db;
  /* Let the announcement scroll away while the logo and navigation stay fixed. */
  transform: translateY(calc(-1 * var(--announcement-offset, 0px)));
  transition: box-shadow 0.25s ease;
}
.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
}

/* ── Header Main Row ── */
.header-main {
  border-bottom: 1px solid #77756f;
}
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  max-width: 1640px;
  margin: 0 auto;
  padding: 6px clamp(20px, 5vw, 90px);
  min-height: 110px;
}

/* LEFT group */
.header-left {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 24px);
  justify-content: flex-start;
}

/* CENTER: Logo */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-logo {
  position: relative;
  width: clamp(144px, 9vw, 174px);
  aspect-ratio: 952 / 568;
  overflow: hidden;
}
/* Frame the artwork inside the supplied logo's transparent margins. */
.brand-logo .logo-img {
  position: absolute;
  width: 152.101%;
  max-width: none;
  height: auto;
  max-height: none;
  left: -26.05%;
  top: -49.296%;
  display: block;
}

/* RIGHT group */
.header-right {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 24px);
  justify-content: flex-end;
}

/* ── Action Buttons (Search, Account, Cart) ── */
.header-action-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: #626460;
  border: none;
  background: transparent;
  font-size: 1.125rem;
  cursor: pointer;
  position: relative;
  transition: all var(--trans-fast);
}
.header-action-btn:hover {
  background: var(--c-surface-2);
  color: var(--c-primary);
}
.header-action-btn svg {
  width: 30px;
  height: 30px;
  stroke-width: 1.4;
}

/* Cart Badge */
.cart-count-badge {
  position: absolute;
  top: 0;
  right: 0;
  height: 20px;
  padding: 0 5px;
  border-radius: 50%;
  background: #bc2033;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  min-width: 20px;
  border: 1px solid var(--c-bg);
}

/* ── Hamburger ── */
.hamburger {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  gap: 7px;
  cursor: pointer;
  padding: var(--sp-2);
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  height: 2px;
  background: #626460;
  border-radius: var(--radius-full);
  transition: all var(--trans-base);
  transform-origin: center;
}
.hamburger span { width: 28px; }
.hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ── Category Nav Bar (Below header row, Kama Style) ── */
.category-nav {
  background: transparent;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  /* Fade edges on mobile to hint at scrollability */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
}
.category-nav::-webkit-scrollbar {
  display: none;
}
.category-nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 1rem;
  white-space: nowrap;
  width: max-content;
  min-width: 100%;
  margin: 0 auto;
}
.cat-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 8px clamp(10px, 1.1vw, 21px);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: #333;
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.18s ease;
  white-space: nowrap;
  position: relative;
}
.cat-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.85rem;
  right: 0.85rem;
  height: 2px;
  background: var(--c-primary);
  transform: scaleX(0);
  transition: transform 0.2s ease;
  border-radius: 2px 2px 0 0;
}
.cat-nav-link:hover {
  color: var(--c-primary);
}
.cat-nav-link:hover::after,
.cat-nav-link.active::after {
  transform: scaleX(1);
}
.cat-nav-link.active {
  color: var(--c-primary);
  font-weight: 700;
}
.cat-sep {
  color: #bd3439;
  font-size: 0;
  flex-shrink: 0;
  user-select: none;
}
.cat-sep::before {
  content: '\2726';
  font-size: 11px;
}

/* ── Dropdown (Account) ── */
.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--c-border);
  padding: var(--sp-2);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 100;
  pointer-events: none;
}
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}
.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(2px);
  pointer-events: auto;
}
.header-right .dropdown-menu {
  transform: translateY(6px);
}
.header-right .nav-item:hover .dropdown-menu,
.header-right .nav-item:focus-within .dropdown-menu {
  transform: translateY(2px);
}
.dropdown-item {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
  border-radius: var(--radius-xs);
  transition: background var(--trans-fast), color var(--trans-fast);
  cursor: pointer;
  white-space: nowrap;
}
.dropdown-item:hover {
  background: var(--c-surface-2);
  color: var(--c-primary);
}

/* ── Search Overlay ── */
.search-overlay {
  position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: all var(--trans-base);
}
.search-overlay.open { opacity: 1; visibility: visible; }
.search-box {
  position: absolute; top: 0; left: 0; right: 0;
  background: var(--c-surface); padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-lg);
}
.search-inner { max-width: 700px; margin: 0 auto; display: flex; align-items: center; gap: var(--sp-4); }
.search-input {
  flex: 1; padding: var(--sp-4) var(--sp-5); border: 1.5px solid var(--c-border);
  border-radius: var(--radius-full); font-size: var(--fs-lg); color: var(--c-text);
  background: var(--c-surface-2); outline: none; transition: border-color var(--trans-fast);
}
.search-input:focus { border-color: var(--c-primary); background: var(--c-surface); }
.search-results {
  max-width: 700px; margin: var(--sp-4) auto 0; background: var(--c-surface);
  border-radius: var(--radius-lg); border: 1px solid var(--c-border); overflow: hidden;
  display: none;
}
.search-results.has-results { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--c-border-light); transition: background var(--trans-fast);
  cursor: pointer; text-decoration: none; color: var(--c-text);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--c-surface-2); }
.search-result-img { width: 44px; height: 44px; border-radius: var(--radius); object-fit: cover; }
.search-result-name { font-size: var(--fs-sm); font-weight: 600; }
.search-result-price { font-size: var(--fs-sm); color: var(--c-primary); font-weight: 700; }

/* ── Mobile Menu Shell ── */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 82%;
  max-width: 320px;
  background: #fff;
  z-index: 3500;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.mobile-menu.open {
  transform: translateX(0);
  box-shadow: 8px 0 40px rgba(0,0,0,0.18);
}
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}
.drawer-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #555;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s;
}
.drawer-close:hover { color: #111; }

.mobile-nav {
  padding: 0;
  flex: 1;
}

/* ── Kama-Style Auth Row (Sign in | Register) ── */
.km-auth-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #e8e8e8;
}
.km-auth-link {
  font-size: 13.5px;
  font-weight: 500;
  color: #333;
  text-decoration: none;
  transition: color 0.18s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.km-auth-link:hover { color: var(--c-primary); }
.km-auth-sep {
  color: #aaa;
  font-size: 13px;
}

/* ── Divider ── */
.km-divider {
  height: 1px;
  background: #e8e8e8;
  margin: 0.25rem 0;
}

/* ── Kama Nav Links ── */
.km-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.25rem;
  font-size: 15px;
  font-weight: 400;
  color: #222;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
  transition: color 0.18s, background 0.18s;
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
}
.km-nav-link:hover { color: var(--c-primary); background: #fafafa; }
.km-nav-link.active { color: var(--c-primary); font-weight: 600; }

/* ── Kama Chevron Arrow ── */
.km-chevron {
  font-size: 1.1rem;
  color: #888;
  transition: transform 0.22s ease, color 0.2s;
  display: inline-block;
  line-height: 1;
  flex-shrink: 0;
}
.km-chevron.rotated { transform: rotate(90deg); color: var(--c-primary); }

/* ── Kama Accordion ── */
.km-accordion { border-bottom: 1px solid #f0f0f0; }
.km-accordion-trigger { border-bottom: none !important; }
.km-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fafafa;
}
.km-accordion-content.open {
  max-height: 360px;
}

/* ── Kama Sub-Links (inside accordion) ── */
.km-sub-link {
  display: block;
  padding: 0.75rem 1.5rem;
  font-size: 14px;
  font-weight: 400;
  color: #444;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
  transition: color 0.18s, background 0.18s;
}
.km-sub-link:last-child { border-bottom: none; }
.km-sub-link:hover { color: var(--c-primary); background: #f5f5f5; }
.km-sub-link.active { color: var(--c-primary); font-weight: 600; }


  transition: color var(--trans-fast);
  cursor: pointer;
  width: 100%;
  text-align: left;
  border-left: none;
  border-right: none;
  border-top: none;
  background: none;
}
.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--c-primary);
}
.mobile-nav-link .link-arrow {
  color: var(--c-text-muted);
  font-size: 0.85rem;
  transition: transform var(--trans-fast);
}
.mobile-nav-link:hover .link-arrow {
  transform: translateX(3px);
  color: var(--c-primary);
}

/* Mobile Accordion */
.mobile-nav-accordion {
  border-bottom: 1px solid var(--c-border-light);
}
.mobile-accordion-trigger {
  border-bottom: none !important;
}
.mobile-chevron {
  font-size: 1.1rem;
  color: var(--c-text-muted);
  transition: transform 0.25s ease, color 0.25s ease;
  display: inline-block;
  line-height: 1;
}
.mobile-chevron.rotated {
  transform: rotate(180deg);
  color: var(--c-primary);
}
.mobile-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--c-surface-2);
  border-radius: var(--radius-md);
  margin-bottom: 0;
}
.mobile-accordion-content.open {
  max-height: 420px;
  padding: 0.35rem 0;
  margin-bottom: 0.65rem;
  border: 1px solid var(--c-border-light);
}
.mobile-sublink {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text-secondary);
  text-decoration: none;
  transition: all var(--trans-fast);
}
.mobile-sublink:hover,
.mobile-sublink.active {
  color: var(--c-primary);
  font-weight: 700;
  background: rgba(45, 106, 79, 0.08);
}
.mobile-sublink .sub-dot { font-size: 0.85rem; }
.mobile-sublink .sub-badge {
  margin-left: auto;
  font-size: 0.65rem;
  background: var(--c-primary);
  color: #fff;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.mobile-menu-footer {
  padding: var(--sp-5);
  border-top: 1px solid var(--c-border-light);
  margin-top: auto;
  background: var(--c-surface-2);
}
.mobile-menu-footer .trust-items { display: flex; flex-direction: column; gap: var(--sp-2); }
.mobile-menu-footer .trust-items span { font-size: var(--fs-xs); color: var(--c-text-muted); display: flex; align-items: center; gap: var(--sp-2); }

/* ── Tablet and mobile storefront header ── */
@media (max-width: 1024px) {
  .announcement-bar {
    min-height: 34px;
    padding: 6px 16px;
  }
  .header-inner {
    padding: 6px 24px;
    min-height: 92px;
  }
  .header-inner .brand-logo {
    width: 132px;
  }
  .header-left,
  .header-right {
    gap: 12px;
  }
  .category-nav-inner {
    padding: 0 0.75rem;
  }
  .cat-nav-link {
    min-height: 44px;
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  .announcement-bar {
    min-height: 30px;
    font-size: 12px;
    padding: 6px 12px;
  }
  .header-inner {
    padding: 4px 8px;
    min-height: 78px;
  }
  .header-inner .brand-logo {
    width: clamp(108px, 30vw, 124px);
  }
  .header-left,
  .header-right {
    gap: 0;
  }
  .header-action-btn,
  .hamburger {
    width: 44px;
    height: 44px;
  }
  .header-action-btn svg {
    width: 26px;
    height: 26px;
  }
  .hamburger {
    gap: 6px;
  }
  .hamburger span {
    width: 25px;
  }
  .hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .cart-count-badge {
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    padding: 0 4px;
  }
  .cat-nav-link {
    min-height: 44px;
    font-size: 13px;
    padding: 10px 12px;
  }
}

.mobile-menu .brand-logo {
  width: 130px;
}
.mobile-menu,
.mobile-menu-header {
  background: var(--bg-paper);
}
.drawer-close {
  min-width: 44px;
  min-height: 44px;
}


/* ── Desktop: Center the category nav ── */
@media (min-width: 1025px) {
  .category-nav {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   FIXED MOBILE BOTTOM NAVIGATION BAR
   ═══════════════════════════════════════════════════════════════════ */

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2500;
  background: var(--bg-paper);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--c-border-light);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.mobile-bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 58px;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--sp-2);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--c-text-muted);
  text-decoration: none;
  background: none;
  border: none;
  padding: 6px 2px 4px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-height: 48px;
  touch-action: manipulation;
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

.bottom-nav-item:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

.bottom-nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-icon {
  width: 22px;
  height: 22px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.2s ease;
}

.bottom-nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.bottom-nav-item.active {
  color: var(--c-primary);
}
.bottom-nav-item.active .bottom-nav-icon {
  transform: translateY(-2px) scale(1.08);
  color: var(--c-primary);
}
.bottom-nav-item.active .bottom-nav-label {
  font-weight: 800;
  color: var(--c-primary);
}
.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-primary);
}

.bottom-nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--c-primary);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(45, 106, 79, 0.45);
  border: 1.5px solid #fff;
}
.bottom-nav-badge.hidden {
  display: none;
}

@media (min-width: 1025px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .cart-drawer,
  .mobile-menu {
    z-index: 3500;
  }
}
