/* =========================================================
   MEGA MENU — THREE-TIER DARK TONAL SEPARATION
   Header #050810 → Menu #162032 → Left col #0f1a2a
   ========================================================= */

.has-mega {
  position: relative;
  z-index: 1000;
}

.mega-menu {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;

  background: #162032;
  border-top: 2px solid #00d084;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);

  color: #e6eaf0;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);

  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0s linear 0.22s;

  z-index: 999;
}

.has-mega.mega-open .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.mega-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
}

.mega-left {
  padding: 2rem 2rem 2rem 1.75rem;
  background: #0f1a2a;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mega-tab {
  position: relative;
  background: none;
  border: none;
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: left;
  color: #b5bcc9;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 8px;
  transition: color 0.2s ease, transform 0.25s ease, background 0.25s ease;
}

.mega-tab:hover {
  color: var(--accent-green);
  transform: translateX(10px);
}

.mega-tab:hover::after { opacity: 1; transform: translateX(0); }

.mega-tab.active {
  background: rgba(110, 231, 168, 0.1);
  color: var(--accent-green);
  font-weight: 600;
  transform: translateX(10px);
}

.mega-tab.active::before {
  content: "";
  position: absolute;
  left: -2.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 100%;
  background: var(--accent-green);
  border-radius: 4px;
}

.mega-tab.active::after { opacity: 1; transform: translateX(0); }

.mega-tab::after {
  content: "→";
  font-size: 1rem;
  color: var(--accent-green);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.mega-content {
  padding: 2rem 0 2rem 2.5rem;
}

.mega-panel { display: none; }

.mega-panel.active {
  display: block;
  animation: mega-fade-slide 0.22s ease;
}

@keyframes mega-fade-slide {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mega-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.mega-brand h3 {
  margin: 0;
  padding: 0;
  line-height: 1.2;
  font-size: 1.3rem;
  font-weight: 600;
  color: #ffffff;
}

.mega-logo { height: 26px; width: auto; display: block; }

.mega-lead {
  font-size: 1rem;
  line-height: 1.6;
  color: #a0aec0;
  max-width: 720px;
  margin-bottom: 1.25rem;
}

.mega-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.mega-tile {
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  transition: border-color 0.2s ease;
}

.mega-tile:hover { border-color: rgba(0, 208, 132, 0.45); }

.mega-tile h4 { font-size: 0.95rem; font-weight: 600; color: #ffffff; margin-bottom: 0.35rem; }
.mega-tile p  { font-size: 0.9rem; line-height: 1.55; color: #a0aec0; margin: 0; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 2rem;
}

.product-item {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.product-item:hover { background: rgba(255, 255, 255, 0.05); }

.product-icon {
  width: 24px !important;
  height: 24px !important;
  object-fit: contain;
  flex-shrink: 0;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.product-item strong { color: var(--accent-green); font-size: 1rem; }
.product-item p      { margin-top: 0.25rem; font-size: 0.9rem; color: #a0aec0; }
.product-item:hover strong { text-decoration: underline; }

.mega-panel h4 { color: #ffffff; font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; margin-top: 1.25rem; }
.mega-panel h4:first-child { margin-top: 0; }
.mega-panel p  { color: #a0aec0; font-size: 0.9rem; line-height: 1.55; margin-bottom: 0.5rem; }

.mega-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.mega-footer a { text-decoration: none; color: var(--accent-green); font-weight: 500; font-size: 0.95rem; }
.mega-footer a:hover { text-decoration: underline; }

.mega-primary-link { color: var(--accent-green); font-weight: 500; font-size: 0.95rem; text-decoration: none; }
.mega-primary-link:hover { text-decoration: underline; }

.mega-tagline { margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.mega-tagline strong { font-size: 1.05rem; font-weight: 600; color: #ffffff; line-height: 1.6; }

.mega-dim {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  background: rgba(2, 5, 12, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 998;
}

.has-mega.mega-open .mega-dim { opacity: 1; }

.has-mega.mega-open > .nav-link,
.has-mega.open > .nav-link {
  color: #62e6a5;
  background: rgba(98, 230, 165, 0.08);
  border-radius: 6px;
  padding: 4px 8px;
}

.has-mega:not(.mega-open):not(.open) > .nav-link { background: transparent; }

@media (max-width: 1100px) {
  .mega-tiles { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .mega-menu, .mega-panel, .mega-dim { animation: none !important; transition: none !important; }
}

/* ─────────────────────────────────────
   MOBILE (max 1024px)
───────────────────────────────────── */

@media (max-width: 1024px) {

  .mega-menu {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    width: 100%;
    padding: 0;
  }

  .has-mega.mobile-open .mega-menu { display: block; }
  .mega-inner { display: block; padding: 0; }
  .mega-left { display: flex; border-right: none; background: transparent; padding: 0; gap: 0; }
  .mega-content { display: none; padding: 0; }
  .mega-panel { display: none !important; margin-bottom: 0; padding-left: 1rem; }
  .mega-panel.active { display: block !important; }
  .product-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .mega-tiles   { grid-template-columns: 1fr; gap: 1rem; }
  .has-mega.mobile-open .nav-caret { transform: rotate(180deg); }
  .mega-tile { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
  .mega-tile:hover { border-color: rgba(0,208,132,0.3); }
  .mega-tagline { border-top-color: rgba(255,255,255,0.1); }

  .mega-tab {
    width: 100%;
    padding: 18px 0 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: white !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    border-radius: 0;
    transform: none !important;
    font-weight: 630;
  }

  .mega-tab:hover { transform: none; background: transparent !important; }

  .mega-tab::after {
    content: "";
    display: block;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
    margin-right: 5px;
    opacity: 0.75;
    transition: transform 0.3s ease;
  }

  .mega-tab.active::after { transform: rotate(-135deg); border-color: #62e6a5; }
  .mega-tab.active { color: #62e6a5 !important; }
  .product-icon { width: 31px !important; height: 29px !important; margin-top: 4px; }
  #mega-products { margin-top: 15px; }
}

@media (max-width: 445px) {
  .mega-tab { font-size: 0.85rem; padding: 15px 0 15px 15px; }
  .mega-brand h3, .mega-panel h3, .mega-panel h4,
  .mega-tile h4, .product-item strong, .mega-tagline strong { font-size: 0.9rem; }
  .mega-lead, .mega-tile p, .product-item p, .mega-panel p { font-size: 0.8rem; }
}
