/* ============================================
   ELEXADENT MEGA MENU — FRONTEND
   ============================================ */

:root {
  --emm-primary:  #002b5c;
  --emm-blue:     #0056b3;
  --emm-accent:   #00aaff;
  --emm-red:      #d9534f;
  --emm-border:   #e1e8ed;
  --emm-text:     #333;
  --emm-muted:    #666;
  --emm-bg:       #f0f7ff;
}

/* ── Nav Bar ── */
.emm-nav {
  background: #fff;
  border-top: 1px solid var(--emm-border);
  position: relative;
  z-index: 9000;
}

.emm-nav-bar {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Top-level items ── */
.emm-nav-item {
  position: static; /* Full-width mega */
}

.emm-nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 18px 22px;
  text-decoration: none;
  color: var(--emm-primary);
  font-weight: 600;
  font-size: 14px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  letter-spacing: .2px;
  transition: color .2s, background .2s;
  white-space: nowrap;
}

.emm-nav-link.emm-highlight { color: var(--emm-red); }

.emm-nav-item:hover > .emm-nav-link,
.emm-nav-item:focus-within > .emm-nav-link {
  color: var(--emm-blue);
  background: var(--emm-bg);
}

.emm-chevron {
  transition: transform .2s ease;
  flex-shrink: 0;
}
.emm-nav-item:hover .emm-chevron,
.emm-nav-item:focus-within .emm-chevron {
  transform: rotate(180deg);
}

/* ── Mega Menu Panel ── */
.emm-mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  box-shadow: 0 15px 40px rgba(0, 0, 0, .12);
  border-top: 3px solid var(--emm-blue);
  box-sizing: border-box;

  /* Smooth reveal */
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  pointer-events: none;
}

.emm-nav-item:hover .emm-mega-menu,
.emm-nav-item:focus-within .emm-mega-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.emm-mega-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 30px;
  padding: 36px 5%;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Column ── */
.emm-menu-col {
  display: block;
}

.emm-col-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--emm-primary);
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 2px solid var(--emm-accent);
  padding-bottom: 10px;
  margin: 0 0 14px;
}
.emm-col-title a {
  color: inherit;
  text-decoration: none;
}
.emm-col-title a:hover { color: var(--emm-blue); }

.emm-col-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.emm-col-list li a {
  display: block;
  padding: 5px 0;
  color: var(--emm-muted);
  text-decoration: none;
  font-size: 13px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: color .15s, padding-left .15s;
}
.emm-col-list li a:hover {
  color: var(--emm-blue);
  padding-left: 4px;
}

.emm-sub-header {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--emm-primary);
  margin: 14px 0 6px;
  opacity: .7;
}

/* ── Tab Mega Menu ── */
.emm-tab-layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  min-height: 380px;
}

/* Sidebar of tabs */
.emm-tab-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #f8fafd;
  border-right: 1px solid var(--emm-border);
  padding: 24px 0;
}
.emm-tab-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--emm-muted);
  padding: 0 20px;
  margin: 0 0 12px;
}
.emm-tab-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 20px;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--emm-muted);
  cursor: pointer;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: all .15s ease;
}
.emm-tab-btn:hover {
  background: var(--emm-bg);
  color: var(--emm-blue);
}
.emm-tab-btn.active {
  background: #fff;
  color: var(--emm-blue);
  border-left-color: var(--emm-blue);
  font-weight: 700;
}
.emm-tab-btn svg { opacity: .4; flex-shrink: 0; }
.emm-tab-btn.active svg { opacity: 1; }

/* Content panels */
.emm-tab-panels {
  flex: 1;
  padding: 30px 4%;
  position: relative;
  min-width: 0;
}
.emm-tab-panel {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 28px;
  width: 100%;
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 30px;
  left: 4%;
  right: 4%;
}
.emm-tab-panel.active {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  top: auto;
  left: auto;
  right: auto;
  animation: emmFadeIn .2s ease;
}
@keyframes emmFadeIn {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Mobile Responsive ── */
@media (max-width: 900px) {
  .emm-nav .emm-nav-bar {
    flex-direction: column;
    display: none !important; /* hidden until toggle */
  }
  .emm-nav .emm-nav-bar.emm-mobile-open { display: flex !important; }

  .emm-nav-link {
    border-bottom: 1px solid var(--emm-border);
    padding: 14px 20px;
    justify-content: space-between;
  }

  .emm-nav .emm-mega-menu {
    position: static;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: all !important;
    box-shadow: none;
    border-top: 1px solid var(--emm-border);
    display: none;
  }
  .emm-nav .emm-nav-item.emm-open .emm-mega-menu { display: block; }

  .emm-mega-inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 16px 20px;
  }

  .emm-tab-layout { flex-direction: column; }
  .emm-tab-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--emm-border); }
  .emm-tab-btn { border-left: none; border-bottom: 1px solid var(--emm-border); }

  .emm-tab-panels { padding: 20px; }
  .emm-tab-panel.active { grid-template-columns: 1fr; }
}

/* ── Mobile Toggle Button ── */
.emm-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 20px;
  font-size: 22px;
  color: var(--emm-primary);
  width: 100%;
  text-align: left;
}
@media (max-width: 900px) {
  .emm-nav .emm-mobile-toggle { display: block; }
}
