/* ========================================
   UNIFIED STICKY NAVIGATION SYSTEM
   ========================================
   This file consolidates all sticky navigation styles
   across products, parts, and solutions pages.
   Eliminates duplication and provides consistent behavior.
*/

/* ===== BASE STICKY NAV CONTAINER ===== */
.context-sticky-nav,
.product-sticky-nav {
  position: relative;
  background: #fff;
  border-bottom: 3px solid #186396 !important;
  z-index: 999;
  transition: all 0.3s ease;
  margin-bottom: 0;
  height: 100px;
  width: 100%;
}

/* ===== STICKY STATE MANAGEMENT ===== */
.context-sticky-nav:not(.sticky-active),
.product-sticky-nav:not(.sticky-active) {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: 10 !important;
}

.context-sticky-nav.sticky-active,
.product-sticky-nav.sticky-active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  border-bottom: 3px solid #186396;
  z-index: 98 !important;
}

/* When main nav is visible, position sticky nav underneath */
.context-sticky-nav.sticky-active.nav-below-main,
.product-sticky-nav.sticky-active.nav-below-main {
  top: 111px !important; /* 40px (super) + 71px (main) */
}

/* ===== STICKY NAV CONTENT LAYOUT ===== */
.context-sticky-nav .sticky-nav-content,
.product-sticky-nav .sticky-nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 10px;
  gap: 1rem;
}

/* ===== PRODUCT INFO SECTION (LEFT SIDE) ===== */
.context-sticky-nav .product-info,
.product-sticky-nav .product-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
  min-width: 0; /* Allow shrinking */
}

.context-sticky-nav .product-thumbnail,
.product-sticky-nav .product-thumbnail {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.context-sticky-nav .product-thumbnail img,
.product-sticky-nav .product-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.context-sticky-nav .placeholder-thumbnail,
.product-sticky-nav .placeholder-thumbnail {
  width: 100%;
  height: 100%;
  background: #007bff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
}

.context-sticky-nav .product-title-nav h2,
.product-sticky-nav .product-title-nav h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
}

/* ===== NAVIGATION MENU (RIGHT SIDE) ===== */
.context-sticky-nav .sticky-nav-menu,
.product-sticky-nav .sticky-nav-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 1; /* Allow shrinking */
  min-width: 0; /* Allow shrinking */
  overflow: visible; /* Allow the ul to expand beyond this container */
}

.context-sticky-nav .sticky-nav-menu ul,
.product-sticky-nav .sticky-nav-menu ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1rem;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

/* ===== NAVIGATION LINKS ===== */
.context-sticky-nav .nav-link,
.product-sticky-nav .nav-link {
  color: #186396;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
  position: relative;
}

.context-sticky-nav .nav-link:hover,
.context-sticky-nav .nav-link.active,
.product-sticky-nav .nav-link:hover,
.product-sticky-nav .nav-link.active {
  color: #186396 !important;
  text-decoration: none; /* handled by ::after */
}

.context-sticky-nav .nav-link:hover::after,
.context-sticky-nav .nav-link.active::after,
.product-sticky-nav .nav-link:hover::after,
.product-sticky-nav .nav-link.active::after {
  transform: scaleX(1);
}

/* ===== ACTIONS SECTION (FAR RIGHT) ===== */
.context-sticky-nav .sticky-nav-actions,
.product-sticky-nav .sticky-nav-actions {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
  width: 200px;
  justify-content: flex-end;
}

/* ===== LAYOUT ADJUSTMENTS ===== */
.context-sticky-nav .container,
.product-sticky-nav .container {
  padding: 24px 30px 24px 0px !important;
}

/* Prevent content jump when nav becomes fixed */
.context-sticky-nav.sticky-active + .container,
.context-sticky-nav.sticky-active + .section-container,
.product-sticky-nav.sticky-active + .container,
.product-sticky-nav.sticky-active + .section-container {
  padding-top: 100px; /* match sticky nav height */
}

/* ===== SIMPLE RESPONSIVE DESIGN ===== */

/* Hide product info under 1200px */
@media (max-width: 1200px) {
  .context-sticky-nav .product-info,
  .product-sticky-nav .product-info {
    display: none !important;
  }
}

/* Hide parts link under 768px */
@media (max-width: 768px) {
  .context-sticky-nav,
  .product-sticky-nav {
    height: 60px;
    padding: 0;
    margin-top: -15px;
  }
  
  /* Mobile sticky nav underline adjustments - removed duplicate */
  
  .context-sticky-nav .sticky-nav-content,
  .product-sticky-nav .sticky-nav-content {
    flex-direction: row;
    gap: 0;
    text-align: center;
    padding: 0;
    height: 60px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }
  
  .context-sticky-nav .product-info,
  .product-sticky-nav .product-info {
    justify-content: center;
    display: none; /* Hide product info on mobile */
  }
  
  .context-sticky-nav .sticky-nav-menu,
  .product-sticky-nav .sticky-nav-menu {
    order: 2;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 60px;
    padding-top: 12px;
  }
  
  .context-sticky-nav .sticky-nav-menu ul,
  .product-sticky-nav .sticky-nav-menu ul {
    flex-wrap: nowrap;
    gap: 0.5rem;
    justify-content: flex-start;
    margin: 0;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    width: max-content;
    height: 60px;
  }
  

  

  

  
  .context-sticky-nav .sticky-nav-menu .nav-link,
  .product-sticky-nav .sticky-nav-menu .nav-link {
    font-size: 0.9rem;
    padding: 1.25rem 1rem;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    letter-spacing: 0.5px;
    min-width: max-content;
    transition: all 0.3s ease;
  }
  

  
  /* Hide actions on mobile */
  .context-sticky-nav .sticky-nav-actions,
  .product-sticky-nav .sticky-nav-actions {
    display: none;
  }
  
  .context-sticky-nav .container,
  .product-sticky-nav .container {
    padding: 0 !important;
  }

  .product-sticky-nav .nav-link::before {
    bottom: 25px;
    height: 2px;
  }


}

/* Emergency fallback for very small screens */
@media (max-width: 480px) {
  .context-sticky-nav .nav-link,
  .product-sticky-nav .nav-link {
    font-size: 0.8rem;
    padding: 0.4rem 0.4rem;
    white-space: nowrap;
  }
  
  /* Ensure product info is hidden on very small screens */
  .context-sticky-nav .product-info,
  .product-sticky-nav .product-info {
    display: none !important;
  }
}

/* ===== COMPATIBILITY OVERRIDES ===== */
/* Ensure product/parts templates allow the pseudo-element underline */
body.single-products .product-sticky-nav.context-sticky-nav .nav-link::after,
body.single-parts .product-sticky-nav.context-sticky-nav .nav-link::after,
body.single-solutions .context-sticky-nav .nav-link::after,
body.single-industries .context-sticky-nav .nav-link::after {
  display: block !important;
}

/* ===== LEGACY SUPPORT ===== */
/* Support for older class names that might still be in use */
.sticky-nav-content,
.sticky-nav-menu,
.sticky-nav-actions {
  /* These styles are now handled by the unified selectors above */
}

