/* ==========================================================================
   B2B Industrial - Header & Footer Stylesheet
   ==========================================================================
   Description: Fixed header with animated navigation, mobile sidebar, 
                and global footer styles.
   ========================================================================== */

:root {
  --primary-blue: #0a3d62;
  --primary-green: #007634;
  --white: #fff;
  --dark-text: #222;
  --background-light: #f8f8f8;
  --header-height: 80px;
  --transition-speed: 0.3s;
}

body {
  padding-top: var(
    --header-height
  ); /* Ensures content starts below the fixed header */
}

/* ==========================================================================
   1. Header Styles
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: var(--white);
  z-index: 5000;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  transition: all var(--transition-speed) ease;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.logo img {
  height: 55px;
  display: block;
}

/* ==========================================================================
   2. Desktop Navigation
   ========================================================================== */
.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 35px;
  padding: 0;
  margin: 0;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  color: var(--dark-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 10px 0;
  display: inline-block;
  transition: color var(--transition-speed) ease;
}

/* --- Slide-In Underline Animation --- */
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0; /* Starts at zero width */
  height: 2px;
  background: var(--primary-green);
  transition: width var(--transition-speed) ease; /* Underline slides in smoothly */
}

/* Hover & Active Page Highlights */
.nav-links a:hover,
.nav-links > li.active > a {
  color: var(--primary-green);
}

.nav-links a:hover::after,
.nav-links > li.active > a::after {
  width: 100%; /* Line grows to full width */
}

/* ==========================================================================
   3. Dropdown Menu (Desktop)
   ========================================================================== */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: -20px;
  background: var(--white);
  list-style: none;
  min-width: 280px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 15px 0;
  opacity: 0;
  visibility: hidden;
  z-index: 10;
}

@media (min-width: 1025px) {
  .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
  }
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  color: var(--dark-text);
  font-size: 0.9rem;
}

.dropdown-menu a:hover {
  background-color: var(--background-light);
  color: var(--primary-green);
}

/* Disable the underline animation inside dropdowns */
.dropdown-menu a::after {
  display: none;
}

/* --- Hamburger Toggle --- */
.mobile-nav-toggle {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 22px;
  position: relative;
  cursor: pointer;
  z-index: 6000; /* Stays above the sidebar */
  border: none;
  background: transparent;
  padding: 0;
}

.mobile-nav-toggle span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--dark-text);
  border-radius: 3px;
  transition: all 0.3s ease-in-out;
}

/* Position the three bars */
.mobile-nav-toggle span:nth-child(1) {
  top: 0;
}
.mobile-nav-toggle span:nth-child(2) {
  top: 9px;
}
.mobile-nav-toggle span:nth-child(3) {
  top: 18px;
}

/* Animation to 'X' when active */
.mobile-nav-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
  background: var(--white);
}
.mobile-nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}
.mobile-nav-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
  background: var(--white);
}

/* 2. Ensure the Overlay works and blurs the background */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 5400; /* Behind menu, but above content */
  display: none;
  backdrop-filter: blur(4px); /* Modern touch */
  transition: opacity 0.3s ease;
}

body.nav-open .nav-overlay {
  display: block !important;
}

.main-nav {
  z-index: 5500; /* Ensure this is higher than the overlay */
}

@media (max-width: 1024px) {
  .mobile-nav-toggle {
    display: block; /* Show hamburger on mobile/tablet */
  }

  .main-nav {
    display: block;
    position: fixed;
    top: 0;
    left: -320px;
    width: 280px;
    max-width: 80%;
    height: 100vh;
    background: var(--white);
    z-index: 5500;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    padding-top: 80px;
  }

  .main-nav.active {
    left: 0;
  }

  .main-nav .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .main-nav .nav-links li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }

  .main-nav .nav-links li > a {
    display: block;
    padding: 15px 20px;
  }

  /* Mobile dropdowns */
  .dropdown.open .dropdown-menu {
    display: block;
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: var(--background-light);
    padding: 5px 0 10px 30px;
  }
}

body.nav-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
}

/* ==========================================================================
   5. Footer Styles
   ========================================================================== */
.site-footer {
  background-color: var(--primary-blue);
  color: rgba(255, 255, 255, 0.8);
  padding: 60px 20px 20px;
  width: 100%;
  display: block;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  align-items: start;
}

.footer-column {
  min-width: 0;
  word-break: break-word;
}

.footer-column .footer-logo {
  max-width: 160px;
  margin-bottom: 20px;
}

.footer-column p {
  line-height: 1.6;
  font-size: 0.95rem;
}

.footer-column h6 {
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 8px;
}

.footer-column h6::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary-green);
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
}

.footer-column a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-column ul a:hover {
  color: var(--primary-green);
}

.footer-column ul .fa,
.footer-column ul .fas {
  margin-right: 12px;
  margin-top: 4px;
  width: 15px;
  text-align: center;
  color: var(--primary-green);
}

.footer-column .social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.footer-column .social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
  transition: background-color 0.3s ease;
}

.footer-column .social-links a:hover {
  background-color: var(--primary-green);
}

.copyright {
  text-align: center;
  padding: 20px 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 40px;
}

/* --- Responsive Footer --- */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}
