/* ============================================
   DPG Header Navigation - Enhanced Documentation
   ============================================

   ARCHITECTURE:
   - 5 equal-width nav items (2 left + logo + 2 right)
   - Flexbox layout with `flex: 1 1 0` ensures perfect centering
   - Bootstrap overrides using !important flags
   - Mobile: hides left items, shows only Account + Logo + Basket

   BRAND COLORS:
   - Purple header background: #1C074F
   - Yellow nav text: #E0F400

   CRITICAL FIX:
   - Logo had Bootstrap margin/padding causing off-center alignment
   - Fixed by setting margin: 0 and padding: 0 on .navbar-brand and .dpg-header-logo
   ============================================ */

/* ============================================
   DESKTOP LAYOUT (> 767px)
   ============================================ */

/* Container: centers the navigation within max-width boundary */
.navbar .container {
  max-width: 1290px; /* DPG standard max-width */
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
}

/* Header container: flex row that centers the nav */
.dpg-header-container {
  justify-content: center !important;
}

/* Main navigation wrapper: creates 5 equal-width columns */
.dpg-header-nav {
  width: 100%;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.navbar.navbar-dark .navbar-nav .nav-link:focus,
.navbar .navbar-brand:focus {
  outline: none;
  /* Optionally add a custom focus style for accessibility: */
  /* box-shadow: 0 0 0 2px var(--dpg-yellow); */
}

/* Each nav item: equal-width column with centered content
   flex: 1 1 0 = grow equally, shrink equally, start from 0 base
   This ensures perfect mathematical centering of the logo */
.dpg-header-nav .nav-item {
  flex: 1 1 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Logo item: same flex properties as other nav items for balance */
.dpg-header-logo-item {
  flex: 1 1 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

/* Logo link: CRITICAL - removes Bootstrap default margin/padding
   Without these overrides, logo appears off-center due to Bootstrap spacing */
.navbar .navbar-brand {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: auto;
  margin: 0 !important; /* Override Bootstrap margin */
}
/* Header navbar: main container styling */
.navbar.navbar-dark.bg-black {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--dpg-purple);
  padding-top: 3.5rem; /* Increased for visual presence */
  padding-bottom: 3.5rem;
  margin-bottom: 0;
  z-index: 100; /* Ensures header stays above page content */
}

/* Navbar list reset: removes default Bootstrap list styling */
.navbar-nav {
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;
}

/* Navigation links: DPG brand styling */
.navbar.navbar-dark .navbar-nav .nav-link {
  color: var(--dpg-yellow) !important;
  font-family: var(--dpg-font-primary); /* DPG brand font */
  font-size: var(--dpg-font-size-base);
  text-transform: uppercase;
  letter-spacing: 0.16em; /* Wide tracking for uppercase text */
  text-decoration: none;
}

/* Link hover state: opacity feedback */
.navbar.navbar-dark .navbar-nav .nav-link:hover {
  text-decoration: none;
  opacity: 0.75;
}

/* Focus visible: brand-compliant keyboard navigation indicator */
.navbar.navbar-dark .navbar-nav .nav-link:focus-visible,
.navbar .navbar-brand:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--dpg-yellow);
}
/* Logo image: CRITICAL - removes spacing that caused misalignment */
.dpg-header-logo {
  height: 96px; /* Fixed height, width auto maintains aspect ratio */
  width: auto;
  margin: 0 auto !important; /* Override any inherited margins */
  padding: 0 !important; /* Override any inherited padding */
}

/* Basket item count badge: shows number of items in cart */
.dpg-header-cart-count {
  margin-left: 0.25rem;
  font-weight: 600;
}

/* ============================================
   MOBILE LAYOUT (≤ 767px)
   ============================================ */

@media (max-width: 767px) {
  /* Increased padding on mobile to prevent logo touching edges */
  .navbar.navbar-dark.bg-black {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  /* Hide "What's On" and "Support Us" links on mobile
     Only shows: Account | Logo | Basket */
  .navbar-nav .dpg-nav-whats-on,
  .navbar-nav .dpg-nav-support {
    display: none !important;
  }

  /* Distribute remaining 3 items across full width */
  .dpg-header-nav {
    justify-content: space-between;
  }

  /* Explicit ordering for mobile layout:
     1. Account (left)
     2. Logo (center)
     3. Basket (right) */
  .navbar-nav .dpg-nav-login {
    order: 1 !important;
    margin-left: 1rem;
  }

  .navbar-nav .dpg-header-logo-item {
    order: 2 !important;
    margin: 0 auto;
  }

  .navbar-nav .dpg-nav-basket {
    order: 3 !important;
  }

  .dpg-header-logo {
    height: 68px;
  }
  .navbar-brand {
   padding-bottom: 15px !important;
  }
}

