/* =========================================================
   VIAS3D Mega Menú · v1.0.0
   Basado en template-beta/gray (V13). Todo va bajo #v3dmm para
   ganarle en especificidad al CSS del tema (DFD Native, WPBakery).
========================================================= */

:root {
  --v3dmm-h: 124px;
  --v3dmm-top: 0px;
}
body.admin-bar { --v3dmm-top: 32px; }
@media (max-width: 782px) { body.admin-bar { --v3dmm-top: 46px; } }

.v3dmm-spacer { display: block; height: var(--v3dmm-h); }

#v3dmm {
  --orange: #ed8020;
  --orange-d: #d96b0f;
  --yellow: #f6b436;
  --purple: #6607c4;
  --blue: #005386;
  --navy: #03192b;
  --charcoal: #1f2123;
  --charcoal-3: #3d4045;
  --ink: #101828;
  --muted: #667085;
  --text: #344054;
  --border: rgba(16, 24, 40, .10);
  --container: 1220px;

  position: fixed;
  top: var(--v3dmm-top);
  left: 0;
  right: 0;
  z-index: 99990;
  color: var(--ink);
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Reset frente al tema ---------- */
#v3dmm *,
#v3dmm *::before,
#v3dmm *::after {
  box-sizing: border-box;
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
  text-shadow: none;
}
#v3dmm a,
#v3dmm a:hover,
#v3dmm a:focus,
#v3dmm a:visited { text-decoration: none; color: inherit; border: 0; box-shadow: none; background-image: none; }
#v3dmm button {
  margin: 0; padding: 0; border: 0; border-radius: 0;
  background: none; box-shadow: none; color: inherit;
  font: inherit; line-height: inherit; width: auto; height: auto; min-height: 0;
  cursor: pointer; -webkit-appearance: none; appearance: none;
}
#v3dmm img { display: block; max-width: 100%; height: auto; border: 0; }
#v3dmm nav, #v3dmm section, #v3dmm div { margin: 0; padding: 0; background-image: none; }
#v3dmm :focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

#v3dmm .v3dmm-msr {
  font-family: "Material Symbols Rounded" !important;
  font-weight: 500 !important;
  font-style: normal !important;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  overflow: hidden;
  text-align: center;
}

#v3dmm .v3dmm-container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

/* =========================================================
   BARRA BLANCA
========================================================= */
#v3dmm .v3dmm-main {
  position: relative;
  z-index: 3;
  background: #ffffff;
  border-bottom: 1px solid rgba(16, 24, 40, .08);
  box-shadow: 0 8px 28px rgba(16, 24, 40, .06);
}
#v3dmm .v3dmm-main-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}
#v3dmm .v3dmm-brand { flex: 0 0 auto; display: flex; align-items: center; width: 178px; }
#v3dmm .v3dmm-brand img { width: 100%; max-height: 48px; object-fit: contain; object-position: left center; }
#v3dmm .v3dmm-brand span { font-size: 22px; font-weight: 800; }

#v3dmm .v3dmm-primary { flex: 1; display: flex; align-items: center; justify-content: center; gap: 24px; }
#v3dmm .v3dmm-primary-link {
  position: relative;
  padding: 27px 0;
  color: var(--charcoal);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: color .2s ease;
}
#v3dmm .v3dmm-primary-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 20px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange), var(--purple));
  transition: right .2s ease;
}
#v3dmm .v3dmm-primary-link:hover { color: var(--orange); }
#v3dmm .v3dmm-primary-link:hover::after,
#v3dmm .v3dmm-primary-link.is-current::after { right: 0; }

#v3dmm .v3dmm-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }

/* Selector de país */
#v3dmm .v3dmm-country { position: relative; }
#v3dmm .v3dmm-country summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: #ffffff;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
#v3dmm .v3dmm-country summary::-webkit-details-marker { display: none; }
#v3dmm .v3dmm-country summary .v3dmm-msr { font-size: 18px; }
#v3dmm .v3dmm-country[open] .v3dmm-chevron { transform: rotate(180deg); }
#v3dmm .v3dmm-country-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  width: 180px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(16, 24, 40, .16);
}
#v3dmm .v3dmm-country-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
#v3dmm .v3dmm-country-menu a:hover,
#v3dmm .v3dmm-country-menu a.is-active { color: var(--orange); background: #fff6ee; }

/* Botón tienda */
#v3dmm .v3dmm-store {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 13px 22px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--charcoal);
  box-shadow: 0 14px 30px rgba(31, 33, 35, .20);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: background .2s ease, transform .2s ease;
}
#v3dmm .v3dmm-store,
#v3dmm .v3dmm-store:visited,
#v3dmm .v3dmm-store:hover { color: #ffffff; }
#v3dmm .v3dmm-store:hover { background: var(--charcoal-3); transform: translateY(-1px); }

#v3dmm .v3dmm-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--ink);
  background: #ffffff;
}

/* =========================================================
   BARRA OSCURA + MEGA MENÚ
========================================================= */
#v3dmm .v3dmm-sitenav {
  position: relative;
  z-index: 2;
  background: var(--charcoal);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
#v3dmm .v3dmm-sitenav-inner {
  min-height: 46px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
}
#v3dmm .v3dmm-direct,
#v3dmm .v3dmm-trigger {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  color: rgba(255, 255, 255, .92);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
#v3dmm .v3dmm-direct .v3dmm-msr,
#v3dmm .v3dmm-trigger .v3dmm-msr { font-size: 18px; }
#v3dmm .v3dmm-chevron { transition: transform .2s ease; }
#v3dmm .v3dmm-direct:hover,
#v3dmm .v3dmm-trigger:hover,
#v3dmm .v3dmm-trigger[aria-expanded="true"] { color: #ffffff; background: rgba(255, 255, 255, .08); }
#v3dmm .v3dmm-trigger[aria-expanded="true"],
#v3dmm .v3dmm-direct.is-current,
#v3dmm .v3dmm-trigger.is-current { box-shadow: inset 0 -2px 0 var(--orange); }
#v3dmm .v3dmm-trigger[aria-expanded="true"] .v3dmm-chevron { transform: rotate(180deg); }

#v3dmm .v3dmm-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: calc(100vh - var(--v3dmm-h) - var(--v3dmm-top) - 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  background: #ffffff;
  border-top: 1px solid var(--border);
  box-shadow: 0 28px 70px rgba(3, 25, 43, .24);
}
#v3dmm .v3dmm-panel[hidden] { display: none !important; }
#v3dmm .v3dmm-panel.is-open { display: block; animation: v3dmmIn .2s ease both; }
@keyframes v3dmmIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

#v3dmm .v3dmm-panel-inner { position: relative; padding-top: 28px; padding-bottom: 34px; }

#v3dmm .v3dmm-close {
  position: absolute;
  top: 18px;
  right: 0;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(16, 24, 40, .08);
}
#v3dmm .v3dmm-close:hover { color: var(--orange); }

/* Pestañas */
#v3dmm .v3dmm-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 54px 22px 0;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
}
#v3dmm .v3dmm-tab {
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #475467;
  background: #f7f8fa;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
#v3dmm .v3dmm-tab:hover,
#v3dmm .v3dmm-tab.is-active { color: var(--navy); background: #fff3e6; border-color: rgba(237, 128, 32, .40); }
#v3dmm .v3dmm-view { display: none; }
#v3dmm .v3dmm-view.is-active { display: block; animation: v3dmmView .18s ease both; }
@keyframes v3dmmView { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Cuadrícula de enlaces */
#v3dmm .v3dmm-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 18px;
}
#v3dmm .v3dmm-close + .v3dmm-grid { padding-right: 54px; }
#v3dmm .v3dmm-link {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  transition: color .18s ease, padding-left .18s ease, background .18s ease;
}
#v3dmm .v3dmm-link .v3dmm-msr { font-size: 17px; color: var(--orange); }
#v3dmm .v3dmm-link:hover,
#v3dmm .v3dmm-link.is-current { color: var(--orange); padding-left: 16px; background: #fffaf6; }

/* Columnas (por proceso) */
#v3dmm .v3dmm-cols {
  display: grid;
  grid-template-columns: repeat(var(--v3dmm-cols, 5), minmax(0, 1fr));
  gap: 22px;
}
#v3dmm .v3dmm-col-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--orange);
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}
#v3dmm .v3dmm-col-title .v3dmm-msr { font-size: 17px; }
#v3dmm a.v3dmm-col-title:hover { color: var(--orange); }
#v3dmm .v3dmm-col-links { display: grid; gap: 1px; }
#v3dmm .v3dmm-col-links a {
  padding: 6px 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  transition: color .18s ease, transform .18s ease;
}
#v3dmm .v3dmm-col-links a:hover,
#v3dmm .v3dmm-col-links a.is-current { color: var(--orange); transform: translateX(3px); }

/* Sombra al hacer scroll */
#v3dmm.is-scrolled .v3dmm-main { box-shadow: 0 10px 30px rgba(16, 24, 40, .12); }

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 1120px) {
  #v3dmm .v3dmm-primary {
    position: absolute;
    top: 100%;
    left: 14px;
    right: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - var(--v3dmm-h) - var(--v3dmm-top) - 20px);
    overflow-y: auto;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 0 0 22px 22px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(3, 25, 43, .22);
  }
  #v3dmm.menu-open .v3dmm-primary { display: flex; }
  #v3dmm .v3dmm-primary-link { padding: 14px 6px; border-bottom: 1px solid var(--border); }
  #v3dmm .v3dmm-primary-link:last-child { border-bottom: 0; }
  #v3dmm .v3dmm-primary-link::after { display: none; }
  #v3dmm .v3dmm-toggle { display: inline-flex; }
  #v3dmm .v3dmm-main-inner { position: relative; }

  #v3dmm .v3dmm-sitenav-inner {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  #v3dmm .v3dmm-sitenav-inner::-webkit-scrollbar { display: none; }
  #v3dmm .v3dmm-direct,
  #v3dmm .v3dmm-trigger { flex: 0 0 auto; padding: 0 13px; }

  #v3dmm .v3dmm-tabs { overflow-x: auto; scrollbar-width: none; }
  #v3dmm .v3dmm-tabs::-webkit-scrollbar { display: none; }
  #v3dmm .v3dmm-tab { flex: 0 0 auto; }
  #v3dmm .v3dmm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #v3dmm .v3dmm-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  #v3dmm .v3dmm-container { width: min(100% - 28px, var(--container)); }
  #v3dmm .v3dmm-main-inner { min-height: 66px; gap: 10px; }
  #v3dmm .v3dmm-brand { width: 140px; }
  #v3dmm .v3dmm-country summary { width: 42px; padding: 9px; justify-content: center; }
  #v3dmm .v3dmm-country-label,
  #v3dmm .v3dmm-country summary .v3dmm-chevron { display: none; }
  #v3dmm .v3dmm-store { min-height: 42px; padding: 11px 13px; }
  #v3dmm .v3dmm-store span:last-child { display: none; }
  #v3dmm .v3dmm-direct,
  #v3dmm .v3dmm-trigger { padding: 0 12px; font-size: 11px; }

  #v3dmm .v3dmm-panel-inner { padding-top: 20px; }
  #v3dmm .v3dmm-tabs { margin-right: 48px; padding-bottom: 12px; }
  #v3dmm .v3dmm-grid,
  #v3dmm .v3dmm-cols { grid-template-columns: 1fr; }
  #v3dmm .v3dmm-close + .v3dmm-grid { padding-right: 48px; }
}

@media (max-width: 420px) {
  #v3dmm .v3dmm-brand { width: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  #v3dmm *, #v3dmm *::before, #v3dmm *::after { animation: none !important; transition: none !important; }
}
