/* ==========================================================================
   Jhumar Foods - Master Header Styles
   ========================================================================== */

#globalHeader,
.main-header-placeholder {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.main-header {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  transition: box-shadow 0.25s ease;
}

.main-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* 3-Column Centered Navigation Grid */
.nav-content-centered {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 0.25rem 0;
}

/* 1. Brand Logo (Left Column) */
.nav-logo-col {
  display: flex;
  align-items: center;
  justify-self: start;
  flex-shrink: 0;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.brand-logo-wrap:hover {
  transform: scale(1.05);
}

.brand-logo-wrap:active {
  transform: scale(0.97);
}

.brand-logo-img {
  height: 62px;
  width: auto;
  object-fit: contain;
}

/* 2. Four Menu Items Centered with Pop Hover Animation */
.nav-center-col {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 2.85rem; /* Generous spacing between the 4 main menus */
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

/* Clean Text Pop Hover Animation for Navigation Links (Pure Text, No Background) */
.nav-item > a {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-main);
  padding: 5px 2px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              color 0.2s ease;
  white-space: nowrap;
  position: relative;
  will-change: transform;
}

.nav-item > a:hover {
  color: var(--jhumar-red);
  transform: translateY(-2px) scale(1.08);
}

.nav-item > a:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

.nav-item > a.active {
  font-weight: 700;
  color: var(--jhumar-red);
}

.nav-item-dropdown > a {
  gap: 6px;
}

.dropdown-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.nav-item-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg) scale(1.15);
  color: var(--jhumar-red);
}

/* Dropdown Menu with Pop In Animation */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.96);
  transform-origin: top center;
  min-width: 255px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.6rem 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.25s ease;
  z-index: 1100;
}

.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  width: 100%;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
  text-decoration: none;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.15s ease,
              color 0.15s ease;
}

.dropdown-menu li a:hover,
.dropdown-menu li a.active {
  background: var(--jhumar-red-soft);
  color: var(--jhumar-red);
  transform: translateX(5px) scale(1.02);
}

/* 3. Get in Touch with Straight Line Divider & Pop Hover */
.nav-right-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 1.25rem;
}

.header-v-divider {
  display: inline-block;
  width: 1.5px;
  height: 22px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.header-contact-link {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  padding: 5px 2px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              color 0.2s ease;
  will-change: transform;
}

.header-contact-link:hover {
  color: var(--jhumar-red);
  transform: translateY(-2px) scale(1.08);
}

.header-contact-link:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

/* Mobile Toggles Hidden on Desktop */
.mobile-menu-toggle,
.mobile-menu-panel {
  display: none;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1160px) {
  .nav-group {
    gap: 1.85rem;
  }
}

@media (max-width: 920px) {
  #globalHeader,
  .main-header-placeholder {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000;
    width: 100%;
  }

  .main-header {
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-subtle);
  }

  .desktop-nav,
  .nav-center-col,
  .nav-right-wrap {
    display: none !important;
  }

  .main-header .container.nav-content-centered,
  .nav-content-centered {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    min-height: 62px;
    height: 62px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    box-sizing: border-box;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: #ffffff;
    color: var(--jhumar-red);
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, color 0.2s ease;
  }

  .mobile-menu-toggle:hover {
    border-color: var(--jhumar-red);
  }

  .mobile-menu-toggle:active {
    transform: scale(0.92);
  }

  /* Compact Floating Dropdown Panel (Not Full Box) */
  .mobile-menu-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0.75rem;
    left: auto;
    width: 175px;
    max-width: calc(100vw - 1.5rem);
    display: flex;
    flex-direction: column;
    padding: 0.35rem 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(19, 34, 38, 0.10), 0 2px 6px rgba(19, 34, 38, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.2s ease;
    z-index: 1050;
  }

  .mobile-menu-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }

  /* Same Font Style & Weight as Desktop Navigation (Plus Jakarta Sans, Weight 500) */
  .mobile-menu-panel a {
    padding: 0.42rem 1rem;
    border-bottom: none;
    color: var(--text-main);
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.18s ease;
    will-change: transform;
  }

  .mobile-menu-panel a:hover,
  .mobile-menu-panel a:active {
    color: var(--jhumar-red);
    transform: translateX(3px) scale(1.03);
  }

  .mobile-menu-panel a.active {
    font-weight: 600;
    color: var(--jhumar-red);
  }

  /* Last Item: "Get in Touch" Styled with Divider Matching Desktop */
  .mobile-menu-panel a:last-child {
    border-top: 1px solid var(--border-subtle);
    margin-top: 0.2rem;
    padding-top: 0.48rem;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .brand-logo-img {
    height: 48px;
  }
}
