/* ── Header & Navigation ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: var(--z-header);
  transition: all var(--transition-base);
  background-color: transparent;
  color: var(--iotnow-white);
}

.header--scrolled {
  background-color: rgba(16, 19, 18, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 72px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-xl);
  color: var(--iotnow-white);
  letter-spacing: var(--tracking-tight);
}

.header-brand-logo {
  height: 36px;
  width: auto;
}

/* The source logo has a faint stray line on its top pixel row. */
img[src="/static/images/logo-dark.webp"],
img[src="/static/images/logo.webp"] {
  clip-path: inset(1px 0 0);
}

.header-nav {
  display: none;
  align-items: center;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .header-nav {
    display: flex;
  }
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.85);
  transition: color var(--transition-fast);
  padding: var(--space-2) 0;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--iotnow-white);
}

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

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

/* ── Mega Menu (Ignition-Style Product / Solutions / Services Dropdown) ── */
.nav-mega-wrapper {
  position: static;
  display: inline-flex;
  align-items: center;
}

.nav-mega-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid transparent;
  padding: 6px 14px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.2;
}

.nav-mega-btn:hover,
.nav-mega-wrapper:hover .nav-mega-btn,
.nav-mega-wrapper.is-open .nav-mega-btn,
.nav-mega-btn.active {
  border-color: rgba(255, 255, 255, 0.45);
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--iotnow-white);
}

.nav-mega-btn .chevron-icon {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
  color: rgba(255, 255, 255, 0.7);
}

.nav-mega-wrapper:hover .chevron-icon,
.nav-mega-wrapper.is-open .chevron-icon {
  transform: rotate(180deg);
  color: var(--iotnow-white);
}

.mega-menu {
  position: absolute;
  top: calc(100% - 6px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: min(1140px, calc(100vw - 32px));
  max-height: calc(100vh - 84px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s;
  z-index: 600;
  padding-top: 10px; /* Bridge gap for smooth hover transition */
}

.nav-mega-wrapper:hover .mega-menu,
.nav-mega-wrapper.is-open .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: 290px 1.35fr 1fr;
  background-color: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  overflow-y: auto;
  max-height: calc(100vh - 100px);
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Column 1: Platform (Dark Forest Green) */
.mega-col-platform {
  background: linear-gradient(180deg, #093322 0%, #051c14 100%);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0, 168, 107, 0.15);
}

.mega-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mega-brand-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.mega-brand-link:hover {
  opacity: 0.9;
}

.mega-brand-logo {
  display: block;
  height: 30px;
  width: auto;
  max-width: 100%;
  aspect-ratio: 940 / 270;
  object-fit: contain;
  align-self: flex-start;
}

.mega-brand-icon {
  flex-shrink: 0;
}

.mega-brand-text {
  display: flex;
  flex-direction: column;
}

.mega-brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.mega-brand-subtitle {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 2px;
}

.mega-category-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.mega-text-green,
.mega-text-cyan {
  color: #3CBF5F;
}

.mega-text-slate {
  color: #1e293b;
}

.mega-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mega-item-link-dark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  color: #f1f5f9;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.mega-item-link-dark:hover {
  color: #ffffff;
  background-color: rgba(0, 168, 107, 0.18);
  padding-left: 12px;
}

.mega-item-primary {
  color: #3CBF5F !important;
  font-weight: 600;
  margin-top: 4px;
}

.mega-item-primary:hover {
  color: #5ae88a !important;
}

.mega-badge-green,
.mega-badge-cyan {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 168, 107, 0.22);
  color: #3CBF5F;
  border: 1px solid rgba(0, 168, 107, 0.45);
}

.mega-divider-dark {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 14px 0 10px;
}

/* Column 2: Solutions & Services (Light Clean) */
.mega-col-solutions {
  background-color: #ffffff;
  padding: 24px 24px;
  display: flex;
  flex-direction: column;
}

.mega-center-tagline {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.mega-solutions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
}

.mega-solution-card {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.mega-solution-card:hover {
  background-color: #f8fafc;
}

.mega-solution-card .mega-card-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
  transition: color 0.15s ease;
}

.mega-solution-card:hover .mega-card-title {
  color: var(--iotnow-green);
}

.mega-solution-card .mega-card-desc {
  font-size: 0.71rem;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.3;
}

.mega-divider-light {
  height: 1px;
  background: #e2e8f0;
  margin: 14px 0 10px;
}

.mega-services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
}

.mega-service-link {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.mega-service-link:hover {
  color: var(--iotnow-green);
  background-color: #f1f5f9;
  padding-left: 8px;
}

.mega-service-bullet {
  color: var(--iotnow-green);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* Column 3: Industries & Explore (Light Clean) */
.mega-col-industries {
  background-color: #ffffff;
  border-left: 1px solid #f1f5f9;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
}

.mega-item-link-light {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.mega-item-link-light:hover {
  color: var(--iotnow-green);
  background-color: #f8fafc;
  padding-left: 12px;
}

.mega-industry-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #cbd5e1;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.mega-item-link-light:hover .mega-industry-dot {
  background-color: var(--iotnow-green);
}

.mega-explore-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mega-explore-card {
  display: block;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.18s ease;
}

.mega-explore-card:hover {
  border-color: var(--iotnow-green);
  background-color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 168, 107, 0.08);
  transform: translateY(-1px);
}

.mega-explore-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  transition: color 0.15s ease;
}

.mega-explore-card:hover .mega-explore-title {
  color: var(--iotnow-green);
}

.mega-explore-desc {
  font-size: 0.71rem;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.35;
}

/* ── Resources & Case Studies Combined Dropdown (Flyout Menu) ── */
.nav-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1.5px solid transparent;
  padding: 6px 14px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.2;
}

.nav-dropdown-btn:hover,
.nav-dropdown-wrapper:hover .nav-dropdown-btn,
.nav-dropdown-wrapper.is-open .nav-dropdown-btn,
.nav-dropdown-btn.active {
  border-color: rgba(255, 255, 255, 0.45);
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--iotnow-white);
}

.nav-dropdown-btn .chevron-icon {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
  color: rgba(255, 255, 255, 0.7);
}

.nav-dropdown-wrapper:hover .chevron-icon,
.nav-dropdown-wrapper.is-open .chevron-icon {
  transform: rotate(180deg);
  color: var(--iotnow-white);
}

.resources-dropdown {
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  min-width: 250px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.05);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.18s;
  z-index: 600;
}

.nav-dropdown-wrapper:hover .resources-dropdown,
.nav-dropdown-wrapper.is-open .resources-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.resources-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.resources-dropdown-item {
  display: block;
  padding: 9px 18px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.35;
}

.resources-dropdown-item:hover {
  background-color: #f8fafc;
  color: var(--iotnow-green);
  padding-left: 22px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

@media (max-width: 639px) {
  .header {
    height: 64px;
  }
  .header--scrolled {
    height: 64px;
  }
  .header-actions .btn {
    display: none;
  }
  .header-brand-logo {
    height: 30px;
  }
  .header-actions {
    gap: var(--space-3);
  }
  .lang-btn {
    padding: 3px 7px;
    font-size: 0.75rem;
  }
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  cursor: pointer;
  z-index: var(--z-overlay);
  padding: 0;
  border: none;
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--iotnow-white);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.nav-open {
  overflow: hidden;
  touch-action: none;
}

.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ── Mobile Navigation Drawer ── */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  height: 100dvh;
  background-color: #0E1210;
  padding: 1.25rem 1.25rem max(1.25rem, env(safe-area-inset-bottom));
  z-index: var(--z-modal);
  transition: right var(--transition-smooth);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
}

@media (max-width: 480px) {
  .mobile-nav {
    max-width: 100%;
    padding: 1rem 1rem max(1rem, env(safe-area-inset-bottom));
  }
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: calc(var(--z-modal) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.nav-open .mobile-nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: var(--iotnow-white);
  cursor: pointer;
  transition: all var(--transition-fast);
  touch-action: manipulation;
}

.mobile-nav-close-btn:hover,
.mobile-nav-close-btn:active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--iotnow-green);
  border-color: var(--iotnow-green);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.mobile-nav-link {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--iotnow-white);
}

.mobile-nav-link:hover {
  color: var(--iotnow-green);
}

.mobile-nav-scrollable {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.mobile-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-nav-header {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.text-cyan {
  color: #3CBF5F;
}

.text-white {
  color: rgba(255, 255, 255, 0.85);
}

.text-green {
  color: var(--iotnow-green) !important;
  font-weight: 600;
}

.mobile-nav-items {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-sublink {
  font-size: 0.92rem;
  font-weight: 500;
  color: #cbd5e1;
  text-decoration: none;
  padding: 3px 0;
  transition: color var(--transition-fast);
}

.mobile-nav-sublink:hover {
  color: var(--iotnow-green);
}

/* ── Grids ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 640px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── Footer ── */
.footer {
  background-color: var(--iotnow-black);
  color: var(--iotnow-gray-light);
  padding-top: var(--space-24);
  padding-bottom: var(--space-12);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-16);
}

@media (min-width: 768px) {
  .footer-top {
    grid-template-columns: 2fr repeat(3, 1fr);
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 360px;
}

.footer-logo {
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  color: var(--iotnow-white);
  letter-spacing: var(--tracking-tight);
}

.footer-title {
  color: var(--iotnow-white);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-5);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-link {
  font-size: var(--text-sm);
  color: var(--iotnow-gray-light);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--iotnow-green);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: var(--text-xs);
  color: var(--iotnow-gray);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.footer-social-link {
  color: var(--iotnow-gray-light);
  padding: var(--space-2);
  transition: color var(--transition-fast);
}

.footer-social-link:hover {
  color: var(--iotnow-green);
}

/* ── Language Switcher Component ── */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  padding: 3px 6px;
  gap: 3px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.lang-btn {
  color: var(--iotnow-gray-light);
  text-decoration: none;
  padding: 3px 9px;
  border-radius: 9999px;
  transition: all var(--transition-fast);
  line-height: 1.2;
}

.lang-btn:hover {
  color: #FFFFFF;
}

.lang-btn.active {
  background: var(--iotnow-green);
  color: #0F172A;
  font-weight: 800;
  box-shadow: 0 1px 6px rgba(0, 168, 107, 0.4);
}

.lang-divider {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  user-select: none;
}

/* ── iPad & Tablet Responsive Rules (1024px - 1199px) ── */
@media (min-width: 1024px) and (max-width: 1199px) {
  .header-nav {
    gap: var(--space-4);
  }
  .nav-link {
    font-size: 0.85rem;
    padding: var(--space-1) 0;
  }
  .nav-mega-btn,
  .nav-dropdown-btn {
    padding: 5px 8px;
    font-size: 0.85rem;
    gap: 4px;
  }
  .header-actions {
    gap: var(--space-3);
  }
  .header-actions .btn {
    padding: 0.5rem 0.95rem;
    font-size: 0.82rem;
  }
  .mega-menu {
    width: min(992px, calc(100vw - 32px));
  }
  .mega-menu-grid {
    grid-template-columns: 240px 1.25fr 1fr;
  }
  .mega-col-platform {
    padding: 20px 16px;
  }
  .mega-col-content {
    padding: 20px 18px;
  }
}

