/* ==========================================================================
   TechProGigs Navigation System — Header, Mega Menus & Mobile Drawer
   Brand: TechProGigs
   ========================================================================== */

/* Top Info Bar */
.tpg-topbar {
  background-color: var(--tpg-bg-light);
  color: var(--tpg-text-body);
  font-size: var(--tpg-fs-xs);
  border-bottom: 1px solid var(--tpg-border);
  padding: 0.45rem 0;
  transition: all var(--tpg-transition-fast);
}

.tpg-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tpg-topbar-left,
.tpg-topbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.tpg-topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--tpg-text-body);
}

.tpg-topbar-item a {
  color: var(--tpg-text-body);
  transition: color var(--tpg-transition-fast);
}

.tpg-topbar-item a:hover {
  color: var(--tpg-accent);
}

.tpg-topbar-item svg {
  width: 14px;
  height: 14px;
  stroke: var(--tpg-accent);
}

.tpg-logo-img,
.tpg-brand img,
.custom-logo,
.custom-logo-link img {
  height: 40px !important;
  max-height: 40px !important;
  width: auto !important;
  max-width: 240px !important;
  object-fit: contain !important;
  display: block !important;
  transition: transform var(--tpg-transition-fast), opacity var(--tpg-transition-fast);
}

.tpg-logo-img:hover,
.tpg-brand img:hover,
.custom-logo:hover,
.custom-logo-link img:hover {
  opacity: 0.95;
  transform: scale(1.01);
}

/* Header & Main Nav */
.tpg-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--tpg-white);
  border-bottom: 1px solid var(--tpg-border);
  transition: background-color var(--tpg-transition-fast), box-shadow var(--tpg-transition-fast), padding var(--tpg-transition-fast);
}

.tpg-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(15, 20, 18, 0.08);
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
}

.tpg-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  transition: height var(--tpg-transition-fast);
}

.tpg-header.is-scrolled .tpg-nav-container {
  height: 70px;
}

.tpg-header.is-scrolled .tpg-logo-img,
.tpg-header.is-scrolled .tpg-brand img,
.tpg-header.is-scrolled .custom-logo {
  height: 36px !important;
  max-height: 36px !important;
  max-width: 216px !important;
}

/* Brand Logo */
.tpg-brand,
.custom-logo-link {
  display: inline-flex !important;
  align-items: center !important;
  text-decoration: none !important;
  height: 100% !important;
  max-height: 56px !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
}

.tpg-drawer-header .tpg-brand {
  max-height: 44px !important;
}

.tpg-drawer-header .tpg-logo-img,
.tpg-drawer-header .tpg-brand img {
  height: 34px !important;
  max-height: 34px !important;
  max-width: 200px !important;
}

.tpg-footer .tpg-brand,
.tpg-footer .custom-logo-link {
  display: inline-flex !important;
  max-height: 60px !important;
}

.tpg-footer .tpg-logo-img,
.tpg-footer .tpg-brand img {
  height: 44px !important;
  max-height: 44px !important;
  max-width: 260px !important;
}

.tpg-brand-mark {
  width: 38px;
  height: 38px;
  background-color: var(--tpg-secondary);
  border-radius: var(--tpg-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tpg-accent);
  font-family: var(--tpg-font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  border: 1px solid rgba(127, 131, 117, 0.35);
  box-shadow: var(--tpg-shadow-sm);
}

.tpg-brand-name {
  font-family: var(--tpg-font-heading);
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--tpg-text-heading);
  letter-spacing: -0.02em;
}

.tpg-brand-name span {
  color: var(--tpg-accent);
}

/* Nav Menu List */
.tpg-nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.tpg-nav-item {
  position: relative;
  list-style: none;
}

.tpg-nav-link {
  font-family: var(--tpg-font-heading);
  font-weight: 600;
  font-size: var(--tpg-fs-sm);
  color: var(--tpg-text-heading);
  padding: 0.75rem 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color var(--tpg-transition-fast);
  position: relative;
}

.tpg-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--tpg-accent);
  transition: width var(--tpg-transition-fast);
}

.tpg-nav-link:hover,
.tpg-nav-link.is-active {
  color: var(--tpg-secondary);
}

.tpg-nav-link:hover::after,
.tpg-nav-link.is-active::after {
  width: 100%;
}

.tpg-dropdown-chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--tpg-transition-fast);
  stroke: var(--tpg-primary);
}

.tpg-nav-item:hover .tpg-dropdown-chevron {
  transform: rotate(180deg);
  stroke: var(--tpg-accent);
}

/* Header Actions */
.tpg-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Mega Menus (Desktop) */
.tpg-mega-menu {
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  visibility: hidden;
  background-color: var(--tpg-white);
  border: 1px solid var(--tpg-border);
  border-radius: var(--tpg-radius-md);
  box-shadow: var(--tpg-shadow-lg);
  padding: var(--tpg-sp-xl);
  z-index: 1100;
  transition: opacity var(--tpg-transition-fast), transform var(--tpg-transition-fast), visibility var(--tpg-transition-fast);
  pointer-events: none;
}

.tpg-nav-item:hover .tpg-mega-menu,
.tpg-nav-item:focus-within .tpg-mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Specific Mega Menu Sizing */
.tpg-mega-menu-services {
  width: 960px;
}

.tpg-mega-menu-industries {
  width: 880px;
}

.tpg-mega-grid-services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.tpg-mega-grid-industries {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.tpg-mega-item {
  padding: 1rem;
  border-radius: var(--tpg-radius-sm);
  border: 1px solid transparent;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  transition: all var(--tpg-transition-fast);
  text-decoration: none;
}

.tpg-mega-item:hover {
  background-color: var(--tpg-bg-light);
  border-color: var(--tpg-border);
  transform: translateY(-2px);
}

.tpg-mega-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--tpg-radius-sm);
  background-color: var(--tpg-primary-light);
  color: var(--tpg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color var(--tpg-transition-fast), color var(--tpg-transition-fast);
}

.tpg-mega-item:hover .tpg-mega-icon {
  background-color: var(--tpg-accent);
  color: #0F1412;
}

.tpg-mega-icon svg {
  width: 20px;
  height: 20px;
}

.tpg-mega-item-title {
  font-family: var(--tpg-font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--tpg-text-heading);
  margin-bottom: 0.2rem;
}

.tpg-mega-item:hover .tpg-mega-item-title {
  color: var(--tpg-accent);
}

.tpg-mega-item-desc {
  font-size: 0.8125rem;
  color: var(--tpg-text-muted);
  line-height: 1.45;
  margin: 0;
}

.tpg-mega-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--tpg-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--tpg-fs-xs);
}

.tpg-mega-footer a {
  color: var(--tpg-accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Mobile Toggle & Drawer */
.tpg-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--tpg-text-heading);
}

.tpg-mobile-toggle svg {
  width: 28px;
  height: 28px;
}

.tpg-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 20, 18, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1200;
  opacity: 0;
  transition: opacity var(--tpg-transition-fast);
}

.tpg-drawer-overlay.is-active {
  display: block;
  opacity: 1;
}

.tpg-mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  background-color: var(--tpg-white);
  z-index: 1300;
  box-shadow: var(--tpg-shadow-lg);
  display: flex;
  flex-direction: column;
  transition: right var(--tpg-transition-base);
  overflow-y: auto;
}

.tpg-mobile-drawer.is-active {
  right: 0;
}

.tpg-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--tpg-border);
}

.tpg-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  color: var(--tpg-text-heading);
}

.tpg-drawer-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tpg-mobile-nav-item {
  border-bottom: 1px solid var(--tpg-border);
  padding-bottom: 0.75rem;
}

.tpg-mobile-nav-link {
  font-family: var(--tpg-font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--tpg-text-heading);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.tpg-mobile-accordion-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: var(--tpg-font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--tpg-text-heading);
  padding: 0.5rem 0;
}

.tpg-mobile-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--tpg-transition-base);
  padding-left: 0.75rem;
}

.tpg-mobile-accordion-content.is-open {
  max-height: 500px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.tpg-mobile-sublink {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--tpg-text-body);
}

.tpg-mobile-sublink:hover {
  color: var(--tpg-accent);
}

.tpg-drawer-footer {
  margin-top: auto;
  padding: 1.5rem;
  border-top: 1px solid var(--tpg-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Responsive Navigation Adjustments */
@media (max-width: 1100px) {
  .tpg-nav-menu {
    gap: 1.15rem;
  }
}

@media (max-width: 991px) {
  .tpg-topbar {
    display: none;
  }
  .tpg-logo-img,
  .tpg-brand img,
  .custom-logo {
    height: 36px !important;
    max-height: 36px !important;
    max-width: 210px !important;
  }
  .tpg-nav-menu,
  .tpg-header-actions .tpg-btn {
    display: none;
  }
  .tpg-mobile-toggle {
    display: block;
  }
}

@media (max-width: 480px) {
  .tpg-logo-img,
  .tpg-brand img,
  .custom-logo {
    height: 32px !important;
    max-height: 32px !important;
    max-width: 180px !important;
  }
}
