/* ============================================================
   ELEMENTOR MEGA MENU WIDGET — CSS
   ============================================================ */

/* Wrapper */
.emmw-wrapper {
  position: relative;
  font-family: inherit;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Hide mobile-only elements on desktop */
.emmw-mobile-close {
  display: none;
}
.emmw-mobile-accordion {
  display: none;
}

/* ========== NAVBAR ========== */
.emmw-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.emmw-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-weight: 500;
}

.emmw-nav-link {
  text-decoration: none;
  color: #4b5563;
  transition: color 0.2s;
  padding: 8px 0;
}

.emmw-nav-link:hover {
  color: #dc2626;
}

/* ========== MEGA TRIGGER BUTTON ========== */
.emmw-mega-trigger {
  position: relative;
}

.emmw-mega-trigger-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font: inherit;
  font-weight: 500;
  color: inherit;
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.2s;
  text-align: left;
  justify-content: flex-start;
}

.emmw-mega-trigger-btn:hover {
  color: #dc2626;
  background: none;
}

.emmw-mega-trigger-btn.open {
  background: none;
}

.emmw-arrow-icon {
  width: 12px;
  height: 12px;
  transition: transform 0.3s;
  color: currentColor;
}

.emmw-mega-trigger-btn.open .emmw-arrow-icon {
  transform: rotate(180deg);
}

/* ========== MEGA PANEL ========== */
.emmw-mega-panel {
  position: fixed;
  left: 0;
  right: 0;
  top: auto;
  background: #111827;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border-top: 1px solid #1f2937;
  z-index: 99999;
  max-height: 480px;
  display: none;
  overflow: hidden;
  min-width: 100%;
  width: 100%;
}

.emmw-mega-panel.open {
  display: block;
  animation: emmwSlideDown 0.25s ease-out;
}

@keyframes emmwSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Full-width variant — break out of Elementor container */
.emmw-mega-panel.emmw-full-width {
  position: fixed;
  left: 0;
  right: 0;
  width: 100vw;
  top: auto;
}

.emmw-mega-inner {
  display: flex;
  width: 100%;
  min-height: 420px;
  flex-shrink: 0;
}

/* ========== SIDEBAR ========== */
.emmw-sidebar {
  width: 224px;
  flex-shrink: 0;
  background: rgba(3, 7, 18, 0.8);
  border-right: 1px solid #1f2937;
  overflow-y: auto;
  max-height: 480px;
  padding: 4px 0;
}

.emmw-sidebar-item {
  display: block;
}

.emmw-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: #d1d5db;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  text-decoration: none;
  position: relative;
}

.emmw-sidebar-link:hover,
.emmw-sidebar-link.active {
  background: #dc2626;
  color: #fff;
}

.emmw-sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #ef4444;
  transition: color 0.15s;
}

.emmw-sidebar-icon i {
  font-size: 14px;
}

.emmw-sidebar-icon svg {
  width: 16px;
  height: 16px;
}

.emmw-sidebar-link:hover .emmw-sidebar-icon,
.emmw-sidebar-link.active .emmw-sidebar-icon {
  color: #fff;
}

.emmw-sidebar-link:hover .emmw-sidebar-icon svg,
.emmw-sidebar-link.active .emmw-sidebar-icon svg {
  fill: #fff;
}

.emmw-sidebar-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emmw-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.4;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.emmw-sidebar-link:hover .emmw-chevron,
.emmw-sidebar-link.active .emmw-chevron {
  opacity: 1;
}

/* ========== CITY CONTENT (right panel) ========== */
.emmw-city-content {
  flex: 1;
  min-width: 0;
  padding: 32px;
  overflow-y: auto;
  max-height: 480px;
  position: relative;
}

.emmw-city-panel {
  display: none;
}

.emmw-city-panel.visible {
  display: block;
  animation: emmwFadeIn 0.2s ease-out;
}

@keyframes emmwFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.emmw-city-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 48px;
  row-gap: 12px;
}

.emmw-city-grid a {
  display: block;
  color: #d1d5db;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 4px;
  transition:
    color 0.2s,
    background 0.2s;
  white-space: nowrap;
  text-decoration: none;
}

.emmw-city-grid a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

/* ========== OVERLAY ========== */
.emmw-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99998;
}

.emmw-overlay.active {
  display: block;
}

/* ========== MOBILE BURGER ========== */
.emmw-burger {
  display: none;
  background: #111827;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.emmw-burger i,
.emmw-burger svg {
  width: 24px;
  height: 24px;
  font-size: 24px;
}

.emmw-burger:hover {
  background: #1f2937;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .emmw-nav-links {
    display: none;
  }

  .emmw-burger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .emmw-mega-panel,
  .emmw-mega-panel.emmw-full-width {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    width: 100vw;
  }

  .emmw-mega-inner {
    flex-direction: column;
    min-height: auto;
  }

  .emmw-sidebar {
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #1f2937;
  }

  .emmw-sidebar-link {
    width: 100%;
  }

  .emmw-city-content {
    max-height: 50vh;
  }

  .emmw-city-grid {
    grid-template-columns: 1fr;
  }

  /* Show nav-links as mobile drawer when mega is open */
  .emmw-wrapper.mobile-open .emmw-nav-links {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #111827;
    z-index: 99999;
    padding: 80px 24px 24px;
    gap: 0;
    overflow-y: auto;
  }

  .emmw-wrapper.mobile-open .emmw-nav-links > * {
    position: relative;
    z-index: 1;
  }

  .emmw-wrapper.mobile-open .emmw-nav-links .emmw-nav-link,
  .emmw-wrapper.mobile-open .emmw-nav-links .emmw-mega-trigger {
    width: 100%;
  }

  .emmw-wrapper.mobile-open .emmw-nav-links .emmw-nav-link,
  .emmw-wrapper.mobile-open .emmw-nav-links .emmw-mega-trigger-btn {
    display: flex;
    align-items: center;
    color: #d1d5db;
    font-size: 18px;
    padding: 16px 0;
    border-bottom: 1px solid #1f2937;
    width: 100%;
    text-align: left;
    justify-content: space-between;
  }

  .emmw-wrapper.mobile-open .emmw-nav-links .emmw-arrow-icon {
    fill: #fff;
    color: #fff;
    margin-left: auto;
  }

  /* Mobile close button */
  .emmw-mobile-close {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    z-index: 1000;
    pointer-events: auto;
  }

  .emmw-wrapper.mobile-open .emmw-mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .emmw-mobile-close i,
  .emmw-mobile-close svg {
    width: 24px;
    height: 24px;
    font-size: 24px;
    color: #fff;
    pointer-events: none;
  }

  /* Mobile inline mega panel (shown inside the drawer) */
  .emmw-wrapper.emmw-mobile.mobile-open .emmw-mega-panel.open {
    position: absolute !important;
    width: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    animation: none !important;
    display: block !important;
    border-top: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: #111827 !important;
    z-index: 100 !important;
    overflow-y: auto !important;
  }

  /* Hide desktop layout on mobile */
  .emmw-wrapper.emmw-mobile.mobile-open .emmw-mega-inner {
    display: none !important;
  }

  /* Show mobile accordion */
  .emmw-wrapper.emmw-mobile.mobile-open .emmw-mobile-accordion {
    display: block !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    padding: 80px 24px 24px;
  }

  /* Mobile back button */
  .emmw-mobile-back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #d1d5db;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    padding: 12px 0;
    margin-bottom: 16px;
    text-align: left;
  }

  .emmw-mobile-back-button svg {
    width: 20px;
    height: 20px;
  }

  .emmw-mobile-back-button:hover {
    color: #fff;
  }

  /* ========== MOBILE ACCORDION ========== */
  .emmw-mobile-accordion-item {
    border-bottom: 1px solid #1f2937;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
  }

  .emmw-mobile-accordion-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    padding: 14px 0;
    background: none !important;
    border: none;
    color: #d1d5db;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
  }

  .emmw-mobile-accordion-trigger .emmw-sidebar-icon {
    color: currentColor;
  }

  .emmw-accordion-arrow {
    margin-left: auto;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
  }

  .emmw-accordion-arrow svg {
    width: 16px;
    height: 16px;
    color: currentColor;
  }

  .emmw-mobile-accordion-trigger.open .emmw-accordion-arrow {
    transform: rotate(90deg);
  }

  .emmw-mobile-accordion-subitems {
    display: none;
    padding: 0 0 8px 26px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
  }

  .emmw-mobile-accordion-subitems.open {
    display: block;
  }

  .emmw-mobile-accordion-subitems a {
    display: block;
    color: #9ca3af;
    font-size: 14px;
    padding: 8px 0;
    text-decoration: none;
    transition: color 0.2s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
  }

  .emmw-mobile-accordion-subitems a:hover {
    color: #fff;
  }
}
