/* ========================================
   Compact Mega Menu with Hover + FIXED Header
======================================== */

/* Header wrapper fixed at top */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  background: #ffffff;
}

/* ---- Small utilities for header ---- */

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #4db8ba;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.cart-btn {
  position: relative;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 0.9rem;
}

.cart-btn i {
  font-size: 1.1rem;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e53e3e;
  color: #ffffff;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
  min-width: 18px;
  text-align: center;
}

/* Top Bar with Logo and Icons */
.top-navbar {
  background: white;
  padding: 1rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 1030;
  transition: all 0.3s ease;
  width: 100%;
}

.top-navbar.scrolled {
  padding: 0.75rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.top-navbar .logo-img {
  height: 50px;
  transition: height 0.3s ease;
}

.top-navbar.scrolled .logo-img {
  height: 42px;
}

.top-navbar .search-form {
  max-width: 600px;
  width: 100%;
}

.top-navbar .btn-icon {
  background: none;
  border: none;
  color: #2d3748;
  font-size: 1.5rem;
  padding: 0.5rem;
  cursor: pointer;
}

/* Fix profile dropdown appearing behind navbar */
.top-navbar .dropdown-menu {
  z-index: 1100 !important;
}

.top-navbar .dropdown {
  position: relative;
  z-index: 1100;
}

/* Navigation Links Bar */
.nav-links-bar {
  background: #f8f9fa;
  padding: 0;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
  z-index: 1020;
  transition: all 0.3s ease;
  width: 100%;
}

.nav-links-bar.scrolled {
  /* Optional visual tweak on scroll */
  /* box-shadow: 0 2px 6px rgba(0,0,0,0.05); */
}

.nav-links-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-link-item {
  padding: 1rem 1.5rem;
  color: #4a5568;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.nav-link-item:hover {
  color: #2d3748;
  background: rgba(77, 184, 186, 0.1);
  border-bottom-color: #4db8ba;
}

.nav-link-item.active {
  background: #e0f2f3;
  color: #2d3748;
  border-bottom-color: #4db8ba;
}

.nav-link-item.special {
  color: #f59e0b;
  font-weight: 600;
}

/* Mega Menu Container */
.mega-dropdown {
  position: static;
  display: inline-block;
}

.mega-menu {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  width: 85%;
  max-width: 95vw;
}

.mega-dropdown:hover .mega-menu {
  opacity: 1;
  visibility: visible;
}

/* Mega Menu Grid Layout */
.mega-menu-content {
  display: flex;
  gap: 2rem;
}

/* Category Sidebar - Compact */
.mega-category-sidebar {
  background: #e0f7f7;
  border-radius: 12px;
  padding: 1.25rem;
  width: 220px;
  flex-shrink: 0;
}

.mega-category-sidebar h6 {
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.mega-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.mega-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  text-decoration: none;
  color: #2d3748;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
  font-size: 0.9rem;
  background: transparent;
  cursor: pointer;
}

.mega-category-item:hover,
.mega-category-item.active {
  background: white;
  color: #2d3748;
  transform: translateX(3px);
}

.mega-category-item i {
  font-size: 0.9rem;
  color: #4db8ba;
}

/* Shop All Button in Sidebar */
.mega-shop-all-btn {
  background: white;
  color: #2d3748;
  border: 2px solid #2d3748;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: 600;
  width: 100%;
  margin-top: 1rem;
  transition: all 0.3s;
  text-decoration: none;
  display: block;
  text-align: center;
  font-size: 0.9rem;
}

.mega-shop-all-btn:hover {
  background: #2d3748;
  color: white;
}

/* Tab Navigation - Compact */
.mega-tabs {
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
}

.mega-tabs .nav-link {
  color: #718096 !important;
  font-weight: 600;
  padding: 0.5rem 1rem !important;
  border: none;
  border-bottom: 3px solid transparent;
  background: none !important;
  transition: all 0.3s;
  border-radius: 0;
  font-size: 0.9rem;
  cursor: pointer;
}

.mega-tabs .nav-link:hover {
  color: #2d3748 !important;
  border-bottom-color: #4db8ba;
}

.mega-tabs .nav-link.active {
  color: #2d3748 !important;
  border-bottom-color: #4db8ba;
}

/* Product Grid */
.mega-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

/* =========================
   HORIZONTAL PRODUCT CARD
   ========================= */
.mega-product-card {
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.mega-product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* Square image on the right/left */
.mega-product-image {
  flex: 0 0 80px;
  height: 80px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-radius: 12px;
}

.mega-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mega-product-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #ff6b35;
  color: white;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mega-product-badge.new {
  background: #4db8ba;
}

.mega-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.mega-product-name {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}

.mega-product-price {
  color: #2d3748;
  font-weight: 700;
  font-size: 0.9rem;
}

.mega-product-price .original-price {
  color: #a0aec0;
  text-decoration: line-through;
  font-size: 0.75rem;
  margin-left: 0.4rem;
  font-weight: 500;
}

/* View All Button - Compact */
.mega-view-all-btn {
  background: #4db8ba;
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  width: 100%;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.mega-view-all-btn:hover {
  background: #3da5a7;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(77, 184, 186, 0.3);
  color: white;
}

/* Products Container */
.mega-products-container {
  flex: 1;
  min-width: 0;
}

/* Category Content Sections */
.category-content {
  display: none;
}

.category-content.active {
  display: block;
}

/* ============================
   MOBILE NAV + DRAWER (Oorla Style)
   ============================ */
@media (max-width: 991px) {
  .nav-links-bar {
    display: none !important;
  }

  .top-navbar .search-form {
    display: none;
  }

  .mobile-topbar {
    background: #ffffff;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative; /* wrapper is fixed via .site-header */
    z-index: 1060;
  }

  .mobile-topbar-logo img {
    height: 40px;
  }

  .mobile-topbar-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2d3748;
  }

  /* Drawer - Left aligned, not full width */
  .offcanvas.mobile-menu-drawer {
    width: 85% !important;
    max-width: 420px !important;
  }

  .mobile-menu-drawer .offcanvas-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
  }

  .mobile-menu-drawer .offcanvas-title {
    font-weight: 700;
    font-size: 1rem;
    color: #2d3748;
  }

  .mobile-menu-drawer .offcanvas-body {
    padding: 0;
    background: #f8f9fa;
  }

  /* Vertical Navigation List */
  .mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .mobile-nav-item {
    border-bottom: 1px solid #e2e8f0;
  }

  .mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: #2d3748;
    background: #ffffff;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    width: 100%;
    text-align: left;
  }

  .mobile-nav-link:hover,
  .mobile-nav-link:focus {
    background: #f8f9fa;
    outline: none;
  }

  .mobile-nav-link-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .mobile-nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
  }

  .mobile-nav-icon.primary {
    background: linear-gradient(135deg, #4db8ba 0%, #3da5a7 100%);
    color: white;
  }

  .mobile-nav-icon.secondary {
    background: #f0f9ff;
    color: #4db8ba;
  }

  .mobile-nav-icon.accent {
    background: #fef3e7;
    color: #f59e0b;
  }

  .mobile-nav-label {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
  }

  .mobile-nav-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2d3748;
  }

  .mobile-nav-subtitle {
    font-size: 0.75rem;
    color: #718096;
  }

  .mobile-nav-arrow {
    color: #cbd5e0;
    font-size: 1.1rem;
    transition: transform 0.2s;
  }

  .mobile-nav-link[aria-expanded="true"] .mobile-nav-arrow {
    transform: rotate(180deg);
  }

  /* Product Grid for subcategories */
  .mobile-product-grid {
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    background: #f8f9fa;
  }

  .mobile-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.2s;
  }

  .mobile-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }

  .mobile-product-img {
    width: 100%;
    height: 110px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .mobile-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mobile-product-info {
    padding: 0.65rem;
  }

  .mobile-product-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: 2.2em;
  }

  .mobile-product-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2d3748;
  }

  /* Special highlight items */
  .mobile-highlight-section {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fff5eb 0%, #fef4e6 100%);
  }

  .mobile-highlight-title {
    font-size: 0.75rem;
    color: #f59e0b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
  }

  .mobile-highlight-card {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
    text-decoration: none;
    color: inherit;
    display: block;
  }

  .mobile-highlight-card h6 {
    font-weight: 700;
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 0.25rem;
  }

  .mobile-highlight-card p {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 0.75rem;
  }

  .mobile-highlight-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f59e0b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
  }
}

/* Tablet adjustments */
@media (max-width: 1200px) {
  .mega-menu {
    width: 800px;
  }

  .mega-product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =======================================
   OFFCANVAS Z-INDEX FIX
   Make cart & mobile menu appear ABOVE navbar
======================================= */

/* Backdrop below the panel but above header */
.offcanvas-backdrop {
  z-index: 1400 !important;
}

/* Offcanvas panel itself above backdrop */
.offcanvas {
  z-index: 1500 !important;
}
