/* ===================================================
   MGL Shuddha — Header, Navigation, Cart Sidebar CSS
   =================================================== */

/* --- Announcement Bar --- */
.ann-bar {
  background: var(--maroon);
  color: var(--white);
  height: var(--annbar-h);
  overflow: hidden;
  position: relative;
}
.ann-bar-track {
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  animation: ticker 28s linear infinite;
}
.ann-bar-track:hover { animation-play-state: paused; }
.ann-bar-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0 40px;
}
.ann-bar-item i { color: var(--gold); }
.ann-bar-item a { color: var(--gold-light); text-decoration: underline; }
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Top Bar --- */
.top-bar {
  background: var(--maroon-dark);
  height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.top-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
}
.top-bar-left a { color: rgba(255,255,255,0.75); display: flex; align-items: center; gap: 5px; transition: color var(--transition); }
.top-bar-left a:hover { color: var(--gold-light); }
.top-bar-left i { font-size: 0.72rem; }
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
}
.top-bar-right a { color: rgba(255,255,255,0.75); transition: color var(--transition); }
.top-bar-right a:hover { color: var(--gold-light); }
.top-bar-sep { color: rgba(255,255,255,0.25); }

/* --- Main Header --- */
.site-header {
  background: var(--white);
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 20px;
}

/* Logo */
.site-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}
.logo-badge img { width: 100%; height: 100%; object-fit: contain; }
.logo-badge-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-align: center;
}
.logo-badge-placeholder .mgl { font-size: 0.9rem; }
.logo-text-wrap { display: flex; flex-direction: column; line-height: 1; }
.logo-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--maroon);
  letter-spacing: 0.02em;
}
.logo-tagline { font-size: 0.65rem; color: var(--gold); font-weight: 500; letter-spacing: 0.08em; margin-top: 2px; }

/* Search Bar */
.header-search {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
}
.search-wrap {
  display: flex;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--white);
  transition: border-color var(--transition);
}
.search-wrap:focus-within { border-color: var(--maroon); }
.search-category {
  border: none;
  border-right: 1.5px solid var(--border);
  padding: 0 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-mid);
  background: var(--cream);
  min-width: 120px;
  appearance: none;
  cursor: pointer;
  outline: none;
}
.search-input {
  flex: 1;
  border: none;
  padding: 0 16px;
  font-size: 0.875rem;
  color: var(--text-dark);
  background: var(--white);
  outline: none;
}
.search-input::placeholder { color: var(--text-light); }
.search-btn {
  background: var(--maroon);
  color: var(--white);
  border: none;
  padding: 0 20px;
  font-size: 0.9rem;
  transition: background var(--transition);
}
.search-btn:hover { background: var(--maroon-dark); }

/* Header Icons */
.header-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.header-icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  transition: all var(--transition);
  font-size: 1.15rem;
  gap: 2px;
}
.header-icon-btn:hover { background: var(--cream); color: var(--maroon); }
.header-icon-btn .icon-label { font-size: 0.62rem; font-weight: 500; color: var(--text-muted); }
.icon-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  background: var(--maroon);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
  padding: 0 3px;
}
.icon-badge.gold { background: var(--gold); color: var(--maroon-dark); }
.header-account-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
  transition: all var(--transition);
}
.header-account-btn:hover { border-color: var(--maroon); color: var(--maroon); background: var(--cream); }
.header-account-btn i { font-size: 1rem; }

/* Hamburger */
.hamburger-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--text-dark);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}
.hamburger-btn:hover { background: var(--cream); color: var(--maroon); }

/* --- Desktop Nav Bar --- */
.desktop-nav {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 490;
}
.desktop-nav .container { display: flex; align-items: center; height: 48px; gap: 0; }

.nav-browse-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--maroon);
  color: var(--white);
  padding: 0 18px;
  height: 48px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 0;
  flex-shrink: 0;
  transition: background var(--transition);
  white-space: nowrap;
}
.nav-browse-btn:hover { background: var(--maroon-dark); }
.nav-browse-btn i:last-child { margin-left: 4px; font-size: 0.7rem; }

.nav-links {
  display: flex;
  align-items: center;
  flex: 1;
  padding: 0 16px;
  gap: 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 48px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dark);
  transition: color var(--transition);
  white-space: nowrap;
  position: relative;
}
.nav-link:hover { color: var(--maroon); }
.nav-link.active { color: var(--maroon); font-weight: 600; }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--maroon);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
}
.nav-link i { font-size: 0.7rem; }
.nav-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--maroon);
  margin-left: auto;
  flex-shrink: 0;
}
.nav-phone i { font-size: 1rem; }

/* Mega dropdown */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--maroon);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 480;
  padding: 24px;
}
.nav-dropdown.open { display: block; }
.nav-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.nav-dd-cat a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dark);
  transition: all var(--transition);
}
.nav-dd-cat a:hover { background: var(--cream); color: var(--maroon); }
.nav-dd-cat .cat-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--cream); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }

/* --- Mobile Sidebar --- */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100%;
  background: var(--white);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.mobile-sidebar.open { transform: translateX(0); }
.mobile-sidebar-header {
  background: var(--maroon);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.mobile-sidebar-logo { display: flex; align-items: center; gap: 10px; }
.mobile-logo-badge { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--gold); font-family: var(--font-display); font-size: 0.8rem; font-weight: 700; color: var(--gold); }
.mobile-logo-name { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--white); }
.sidebar-close { color: var(--white); font-size: 1.3rem; opacity: 0.8; transition: opacity var(--transition); }
.sidebar-close:hover { opacity: 1; }
.mobile-sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}
.sidebar-user-info { display: flex; align-items: center; gap: 12px; }
.sidebar-user-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--maroon); display: flex; align-items: center; justify-content: center; color: var(--white); font-size: 1rem; flex-shrink: 0; }
.sidebar-user-name { font-weight: 600; font-size: 0.9rem; color: var(--text-dark); }
.sidebar-user-sub  { font-size: 0.78rem; color: var(--text-muted); }
.sidebar-login-btn { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--maroon); color: var(--white); border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 600; width: 100%; }
.mobile-nav-section { padding: 12px 0; border-bottom: 1px solid var(--border); }
.mobile-nav-section-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); padding: 0 20px 8px; }
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  transition: all var(--transition);
}
.mobile-nav-link:hover { background: var(--cream); color: var(--maroon); }
.mobile-nav-link.active { color: var(--maroon); font-weight: 600; background: rgba(92,10,23,0.04); }
.mobile-nav-link i { width: 20px; text-align: center; font-size: 0.95rem; color: var(--text-muted); }
.mobile-nav-link:hover i, .mobile-nav-link.active i { color: var(--maroon); }
.mobile-sidebar-footer { margin-top: auto; padding: 20px; border-top: 1px solid var(--border); }
.sidebar-contact-item { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; }
.sidebar-contact-item i { color: var(--maroon); width: 16px; }
.sidebar-contact-item a { color: var(--maroon); font-weight: 500; }

/* --- Bottom Navigation (Mobile) --- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 62px;
  background: var(--white);
  border-top: 1px solid var(--border);
  z-index: 700;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  padding: 0 8px;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}
.bottom-nav-item i { font-size: 1.3rem; }
.bottom-nav-item:hover, .bottom-nav-item.active { color: var(--maroon); }
.bottom-nav-item.active i { color: var(--maroon); }
.bottom-nav-cart {
  width: 52px;
  height: 52px;
  background: var(--maroon);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.3rem;
  margin-top: -24px;
  border: 3px solid var(--white);
  box-shadow: var(--shadow-md);
  position: relative;
  flex-shrink: 0;
}
.bottom-nav-cart .icon-badge { top: 0; right: 0; border-color: var(--maroon); background: var(--gold); color: var(--maroon-dark); }

/* --- Cart Sidebar --- */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100%;
  background: var(--white);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.cart-sidebar.open { transform: translateX(0); }
.cart-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-sidebar-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--maroon); }
.cart-count-chip { background: var(--maroon); color: var(--white); font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); font-family: var(--font-body); }
.cart-close { width: 34px; height: 34px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1rem; transition: all var(--transition); border: 1.5px solid var(--border); }
.cart-close:hover { background: var(--cream); color: var(--maroon); border-color: var(--maroon); }
.cart-sidebar-body { flex: 1; overflow-y: auto; padding: 16px; }
.cart-empty { text-align: center; padding: 60px 20px; }
.cart-empty i { font-size: 3.5rem; color: var(--text-light); margin-bottom: 16px; }
.cart-empty h4 { font-family: var(--font-display); font-size: 1.3rem; color: var(--text-mid); margin-bottom: 8px; }
.cart-empty p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 20px; }
.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img { width: 72px; height: 72px; border-radius: var(--radius-md); overflow: hidden; background: var(--cream); flex-shrink: 0; border: 1px solid var(--border); }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 0.875rem; font-weight: 500; color: var(--text-dark); margin-bottom: 4px; line-height: 1.4; }
.cart-item-variant { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }
.cart-item-bottom { display: flex; align-items: center; justify-content: space-between; }
.cart-item-price { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--maroon); }
.cart-item-remove { color: var(--text-muted); font-size: 0.85rem; transition: color var(--transition); }
.cart-item-remove:hover { color: var(--error); }
.cart-delivery-progress { background: var(--cream); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 12px; }
.delivery-progress-text { font-size: 0.8rem; font-weight: 500; color: var(--text-dark); margin-bottom: 6px; }
.delivery-progress-text span { color: var(--success); font-weight: 700; }
.progress-bar { height: 5px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: var(--success); border-radius: var(--radius-full); transition: width 0.4s ease; }
.cart-sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--cream); }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 8px; }
.cart-summary-row.total { font-weight: 700; font-size: 1rem; color: var(--maroon); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.cart-summary-row .label { color: var(--text-muted); }
.cart-summary-row.total .label { color: var(--text-dark); }
.cart-actions { display: flex; gap: 10px; margin-top: 14px; }
.cart-actions a { flex: 1; }

/* Responsive */
@media (max-width: 991px) {
  .top-bar { display: none; }
  .desktop-nav { display: none; }
  .hamburger-btn { display: flex; }
  .header-search { max-width: none; flex: 1; }
  .header-account-btn .btn-text { display: none; }
  .bottom-nav { display: flex; }
  body { padding-bottom: 62px; }
}
@media (max-width: 575px) {
  .cart-sidebar { width: 100%; }
  .header-icons .hide-xs { display: none; }
}
