/* ============================================================
   SWZ Mega Menu — Estilos
   SwappZip / DAVILOZ LLC
   ============================================================ */

/* Variables por defecto (se sobreescriben desde Elementor) */
.swz-mm-header {
  --swz-nav-bg:      #ffffff;
  --swz-nav-text:    #253040;
  --swz-accent:      #1769aa;
  --swz-gold:        #f2b84b;
  --swz-border:      #e4e7ec;
  --swz-drop-bg:     #ffffff;
  --swz-drop-shadow: 0 12px 40px rgba(13,27,42,.13);
  --swz-radius:      12px;
  --swz-nav-h:       64px;

  background: var(--swz-nav-bg);
  border-bottom: 1px solid var(--swz-border);
  box-shadow: 0 2px 8px rgba(13,27,42,.05);
  position: relative;
  z-index: 9999;
  width: 100%;
}

/* ── INNER ── */
.swz-mm-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--swz-nav-h);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 16px;
}

/* ── LOGO ── */
.swz-mm-logo {
  font-size: 20px;
  font-weight: 900;
  color: var(--swz-nav-text);
  text-decoration: none;
  letter-spacing: -.5px;
  flex-shrink: 0;
  white-space: nowrap;
}
.swz-mm-logo:hover { color: var(--swz-accent); }

/* ── NAV DESKTOP ── */
.swz-mm-nav {
  display: flex;
  list-style: none;
  margin: 0; padding: 0;
  gap: 2px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.swz-mm-item { position: relative; }

.swz-mm-nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--swz-nav-text);
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s, color .15s;
  white-space: nowrap;
  cursor: pointer;
}
.swz-mm-nav-link:hover,
.swz-mm-item.has-dropdown:hover > .swz-mm-nav-link {
  background: #f0f5ff;
  color: var(--swz-accent);
}
/* Iconos clásicos del menú */
.swz-mm-icon {
  font-size: 15px;
  width: 1.05em;
  min-width: 1.05em;
  height: 1.05em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}
.swz-mm-svg-icon svg {
  width: 1em;
  height: 1em;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.swz-mm-arrow {
  font-size: 9px;
  opacity: .5;
  transition: transform .2s;
}
.swz-mm-item.has-dropdown:hover > .swz-mm-nav-link .swz-mm-arrow {
  transform: rotate(180deg);
}

/* ── DROPDOWN ── */
.swz-mm-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 480px;
  background: var(--swz-drop-bg);
  border: 1px solid var(--swz-border);
  border-radius: var(--swz-radius);
  box-shadow: var(--swz-drop-shadow);
  z-index: 10000;
  padding: 24px;
  animation: swzDropIn .18s ease;
}

/* Evitar que se salga de pantalla */
.swz-mm-item:nth-last-child(-n+3) > .swz-mm-dropdown {
  left: auto;
  right: 0;
}

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

.swz-mm-item.has-dropdown:hover > .swz-mm-dropdown,
.swz-mm-item.has-dropdown:focus-within > .swz-mm-dropdown {
  display: block;
}

.swz-mm-dropdown-inner {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

/* ── COLUMNAS DEL DROPDOWN ── */
.swz-mm-col { min-width: 160px; flex: 1; }

.swz-mm-col-title {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--swz-accent);
  border-bottom: 2px solid var(--swz-accent);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.swz-mm-sub-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.swz-mm-sub-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  border-radius: 6px;
  transition: background .12s, color .12s, padding-left .12s;
}
.swz-mm-sub-link:hover {
  color: var(--swz-accent);
  background: #f0f5ff;
  padding-left: 12px;
}
.swz-mm-count {
  font-size: 11px;
  color: #aaa;
  font-weight: 400;
  margin-left: 6px;
}

/* ── ACTIONS ── */
.swz-mm-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.swz-mm-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: .2s;
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid transparent;
}
.swz-mm-btn-outline {
  background: #fff;
  color: var(--swz-nav-text);
  border-color: var(--swz-border);
}
.swz-mm-btn-outline:hover { border-color: var(--swz-accent); color: var(--swz-accent); }
.swz-mm-cta {
  background: var(--swz-accent);
  color: #fff;
  border-color: var(--swz-accent);
  box-shadow: 0 4px 14px rgba(23,105,170,.22);
}
.swz-mm-cta:hover { opacity: .88; transform: translateY(-1px); }

/* ── HAMBURGER ── */
.swz-mm-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background .15s;
}
.swz-mm-hamburger:hover { background: #f0f5ff; }
.swz-mm-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--swz-nav-text);
  border-radius: 2px;
  transition: transform .25s, opacity .2s;
}
/* Estado abierto */
.swz-mm-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.swz-mm-hamburger.is-open span:nth-child(2) { opacity: 0; }
.swz-mm-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── PANEL MOBILE ── */
.swz-mm-mobile-panel {
  display: none;
  border-top: 1px solid var(--swz-border);
  background: #fff;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.swz-mm-mobile-panel.is-open {
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.swz-mm-mobile-list {
  list-style: none;
  margin: 0; padding: 8px 0;
}
.swz-mm-mobile-item { border-bottom: 1px solid var(--swz-border); }

.swz-mm-mobile-link,
.swz-mm-mobile-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--swz-nav-text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 8px;
}
.swz-mm-mobile-link:hover,
.swz-mm-mobile-trigger:hover { background: #f8fafc; color: var(--swz-accent); }

.swz-mm-mobile-arrow {
  font-size: 11px;
  opacity: .5;
  transition: transform .2s;
  margin-left: auto;
}
.swz-mm-mobile-trigger[aria-expanded="true"] .swz-mm-mobile-arrow {
  transform: rotate(180deg);
}

.swz-mm-mobile-sub {
  list-style: none;
  margin: 0; padding: 0;
  background: #f8fafc;
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.swz-mm-mobile-sub.is-open {
  max-height: 600px;
}
.swz-mm-mobile-sub-link {
  display: block;
  padding: 11px 20px 11px 36px;
  font-size: 14px;
  color: #475467;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
}
.swz-mm-mobile-sub-link:hover { color: var(--swz-accent); background: #e9f2fb; }

.swz-mm-mobile-actions {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.swz-mm-mobile-actions .swz-mm-btn {
  width: 100%;
  justify-content: center;
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .swz-mm-nav,
  .swz-mm-actions { display: none; }
  .swz-mm-hamburger { display: flex; }
  .swz-mm-mobile-panel { display: block; }
}

/* Ajuste si Elementor quita el max-width del wrapper */
.elementor-widget-swz_mega_menu .elementor-widget-container {
  overflow: visible !important;
}

/* ============================================================
   v1.2.0 / v1.3.0 — Mega menú jerárquico: padres / hijos / nietos
   ============================================================ */

.swz-mm-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.swz-mm-logo-img {
  display: block;
  width: auto;
  max-width: 150px;
  max-height: 42px;
  object-fit: contain;
}
.swz-mm-logo-text { display: inline-block; }

.swz-mm-hier-dropdown {
  width: 920px;
  min-width: 720px;
  max-width: min(92vw, 1120px);
  padding: 18px;
}
.swz-mm-dropdown-title {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--swz-accent);
  margin: 0 0 12px;
}
.swz-mm-drill {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(230px, 1fr) minmax(230px, 1fr);
  gap: 14px;
  align-items: stretch;
}
.swz-mm-drill-col {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  padding: 12px;
  max-height: 64vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.swz-mm-drill-col[data-swz-col-level="2"],
.swz-mm-drill-col[data-swz-col-level="3"] {
  background: #fff;
}
.swz-mm-drill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.swz-mm-drill-item { margin: 0; }
.swz-mm-drill-link {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 7px 9px;
  border-radius: 10px;
  color: #1f2937;
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
  transition: background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.swz-mm-drill-link:hover,
.swz-mm-drill-link:focus,
.swz-mm-drill-link.is-active {
  color: var(--swz-accent);
  background: #eef6ff;
  box-shadow: inset 3px 0 0 var(--swz-accent);
  outline: none;
}
.swz-mm-drill-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.swz-mm-drill-arrow {
  font-size: 18px;
  line-height: 1;
  opacity: .6;
}
.swz-mm-drill-panel {
  display: none;
}
.swz-mm-drill-panel.is-active {
  display: block;
}
.swz-mm-drill-panel-title {
  font-size: 14px;
  font-weight: 900;
  color: #111827;
  margin: 0 0 4px;
}
.swz-mm-view-all {
  display: inline-flex;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--swz-accent);
  text-decoration: none;
}
.swz-mm-view-all:hover { text-decoration: underline; }
.swz-mm-empty-note {
  padding: 12px;
  font-size: 13px;
  color: #667085;
  background: #fff;
  border-radius: 10px;
  border: 1px dashed #d0d5dd;
}
.swz-mm-cat-icon {
  width: 30px;
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 10px;
}
.swz-mm-cat-icon svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.swz-mm-drill-link:hover .swz-mm-cat-icon,
.swz-mm-drill-link.is-active .swz-mm-cat-icon {
  background: #fff;
  border-color: rgba(23,105,170,.22);
}

/* Mobile jerárquico */
.swz-mm-mobile-view-all-wrap {
  display: none;
  padding: 0 20px 10px 52px;
  background: #f8fafc;
}
.swz-mm-mobile-view-all-wrap.is-open { display: block; }
.swz-mm-mobile-view-all {
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  color: var(--swz-accent);
  text-decoration: none;
}
.swz-mm-mobile-view-all:hover { text-decoration: underline; }
.swz-mm-mobile-sub-item { border-top: 1px solid rgba(228,231,236,.72); }
.swz-mm-mobile-cat-trigger {
  background: #f8fafc;
  padding-left: 28px;
}
.swz-mm-mobile-sub .swz-mm-mobile-sub {
  background: #fff;
}
.swz-mm-mobile-sub-level-2 .swz-mm-mobile-cat-trigger,
.swz-mm-mobile-sub-level-2 .swz-mm-mobile-sub-link { padding-left: 42px; }
.swz-mm-mobile-sub-level-3 .swz-mm-mobile-sub-link { padding-left: 56px; }
.swz-mm-mobile-sub-link {
  display: flex;
  align-items: center;
  gap: 10px;
}
.swz-mm-mobile-trigger .swz-mm-cat-icon,
.swz-mm-mobile-sub-link .swz-mm-cat-icon {
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .swz-mm-hier-dropdown {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    min-width: 680px;
  }
  .swz-mm-item:nth-last-child(-n+3) > .swz-mm-hier-dropdown {
    left: 50%;
    right: auto;
  }
}

@media (max-width: 960px) {
  .swz-mm-hier-dropdown { display: none !important; }
  .swz-mm-logo-img { max-width: 135px; }
  .swz-mm-mobile-sub.is-open { max-height: none; overflow: visible; }
  .swz-mm-mobile-panel.is-open { max-height: 85vh; }
}

/* ============================================================
   v1.3.0 — Ajustes premium: iconos Elementor, dropdown regulado
   y mobile tipo app por niveles.
   ============================================================ */

.swz-mm-header,
.swz-mm-header * { box-sizing: border-box; }

.swz-mm-nav-link,
.swz-mm-mobile-link,
.swz-mm-mobile-go,
.swz-mm-mobile-trigger {
  line-height: 1.2;
}

.swz-mm-icon,
.swz-mm-cat-icon {
  overflow: visible;
  line-height: 1;
  flex-shrink: 0;
}
.swz-mm-icon > i,
.swz-mm-icon > svg,
.swz-mm-icon .elementor-icon,
.swz-mm-icon .elementor-icon i,
.swz-mm-icon .elementor-icon svg,
.swz-mm-cat-icon > i,
.swz-mm-cat-icon > svg,
.swz-mm-cat-icon .elementor-icon,
.swz-mm-cat-icon .elementor-icon i,
.swz-mm-cat-icon .elementor-icon svg {
  display: block;
  width: 1em;
  height: 1em;
  line-height: 1;
  font-size: 1em;
  overflow: visible;
}
.swz-mm-icon svg,
.swz-mm-cat-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.swz-mm-lib-icon svg path,
.swz-mm-cat-icon-custom svg path {
  fill: currentColor;
  stroke: none;
}

.swz-mm-hier-dropdown.swz-mm-align-left {
  left: 0;
  right: auto;
  transform: none;
}
.swz-mm-hier-dropdown.swz-mm-align-right {
  left: auto;
  right: 0;
  transform: none;
}
.swz-mm-hier-dropdown.swz-mm-align-center {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}
.swz-mm-hier-dropdown.is-positioned {
  right: auto !important;
  transform: none !important;
}

.swz-mm-mobile-go {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 800;
  color: var(--swz-nav-text);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  gap: 10px;
}
.swz-mm-mobile-go:hover,
.swz-mm-mobile-link:hover {
  background: #f8fafc;
  color: var(--swz-accent);
}
.swz-mm-mobile-label {
  min-width: 0;
  flex: 1;
}
.swz-mm-mobile-screen-subtitle {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #667085;
}

@media (max-width: 960px) {
  .swz-mm-header { position: relative; }
  .swz-mm-inner { min-height: 72px; }

  .swz-mm-mobile-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    height: min(82vh, 720px);
    max-height: none;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--swz-border);
    border-top: 0;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 18px 44px rgba(15,23,42,.14);
    z-index: 10005;
    transition: none;
  }
  .swz-mm-mobile-panel.is-open {
    display: block;
    max-height: none;
    overflow: hidden;
  }
  .swz-mm-mobile-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .swz-mm-mobile-screens {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #fff;
  }
  .swz-mm-mobile-screen {
    display: none;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 14px;
    background: #fff;
  }
  .swz-mm-mobile-screen.is-active {
    display: block;
    animation: swzMobileSlide .16s ease-out;
  }
  @keyframes swzMobileSlide {
    from { opacity: .88; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
  }
  .swz-mm-mobile-screen-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px 18px 12px;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--swz-border);
  }
  .swz-mm-mobile-root-head {
    padding-top: 18px;
  }
  .swz-mm-mobile-screen-title {
    font-size: 18px;
    font-weight: 900;
    color: #111827;
    letter-spacing: -.02em;
  }
  .swz-mm-mobile-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    padding: 7px 10px;
    border: 1px solid #e4e7ec;
    border-radius: 999px;
    background: #fff;
    color: var(--swz-accent);
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
  }
  .swz-mm-mobile-back span {
    font-size: 20px;
    line-height: 1;
  }
  .swz-mm-mobile-view-all-card {
    display: flex;
    align-items: center;
    margin: 12px 16px;
    padding: 12px 14px;
    border: 1px solid rgba(23,105,170,.18);
    border-radius: 14px;
    background: #eef6ff;
    color: var(--swz-accent);
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
  }
  .swz-mm-mobile-list {
    list-style: none;
    margin: 0;
    padding: 6px 0 14px;
  }
  .swz-mm-mobile-root-list { padding-top: 8px; }
  .swz-mm-mobile-item {
    border-bottom: 1px solid rgba(228,231,236,.72);
  }
  .swz-mm-mobile-link,
  .swz-mm-mobile-go {
    min-height: 58px;
    padding: 13px 18px;
  }
  .swz-mm-mobile-main-go,
  .swz-mm-mobile-main-link {
    font-size: 16px;
  }
  .swz-mm-mobile-arrow {
    margin-left: auto;
    font-size: 18px;
    opacity: .55;
    transform: none !important;
  }
  .swz-mm-mobile-actions {
    padding: 12px 16px 16px;
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 10px;
    background: rgba(255,255,255,.96);
    border-top: 1px solid var(--swz-border);
    box-shadow: 0 -8px 24px rgba(15,23,42,.06);
  }
  .swz-mm-mobile-actions-top {
    border-top: 0;
    border-bottom: 1px solid var(--swz-border);
    box-shadow: 0 8px 24px rgba(15,23,42,.04);
  }
  .swz-mm-mobile-actions .swz-mm-btn {
    width: 100%;
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
    min-height: 44px;
  }
  .swz-mm-mobile-actions-bottom {
    position: sticky;
    bottom: 0;
    z-index: 3;
  }
  .swz-mm-mobile-sub,
  .swz-mm-mobile-sub.is-open,
  .swz-mm-mobile-view-all-wrap,
  .swz-mm-mobile-view-all-wrap.is-open {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .swz-mm-inner { padding-left: 18px; padding-right: 18px; }
  .swz-mm-mobile-panel {
    left: 0;
    right: 0;
    max-width: none;
    height: calc(100vh - 73px);
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  .swz-mm-mobile-actions {
    grid-template-columns: 1fr;
  }
}
