/* ================================================================
   MOMENT ENERGIA — NUEVO HEADER PROFESIONAL
   Versión: 1.0 | Abril 2026
   Estructura:
     1. Barra superior naranja (trust bar)
     2. Cabecera principal (logo + buscador + CTA)
     3. Menú principal en una línea con desplegables
     4. Responsive móvil
   ================================================================ */

/* ── Variables de marca ─────────────────────────────────────────── */
:root {
  --me-orange:      #F47920;
  --me-orange-dark: #d96a10;
  --me-orange-light:#fff3e8;
  --me-black:       #1a1a1a;
  --me-gray-dark:   #333333;
  --me-gray-mid:    #666666;
  --me-gray-light:  #f5f5f5;
  --me-border:      #e8e8e8;
  --me-white:       #ffffff;
  --me-font:        'Open Sans', 'Helvetica Neue', Arial, sans-serif;
}

/* ── Reset / Base ───────────────────────────────────────────────── */
#me-header-wrapper * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
#me-header-wrapper a {
  text-decoration: none;
  color: inherit;
}
#me-header-wrapper ul {
  list-style: none;
}

/* ================================================================
   1. BARRA SUPERIOR NARANJA (trust bar)
   ================================================================ */
#me-topbar {
  background-color: var(--me-orange);
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  z-index: 9999;
  position: relative;
}
#me-topbar-inner {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.me-topbar-left {
  font-size: 12px;
  font-weight: 600;
  color: var(--me-white);
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.me-topbar-center {
  font-size: 12px;
  font-weight: 500;
  color: var(--me-white);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.me-topbar-center::before {
  content: "🚚";
  font-size: 13px;
}
.me-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.me-topbar-right a {
  font-size: 12px;
  font-weight: 500;
  color: var(--me-white);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: opacity 0.2s;
}
.me-topbar-right a:hover {
  opacity: 0.85;
}
.me-topbar-right .me-icon {
  width: 14px;
  height: 14px;
  fill: var(--me-white);
  flex-shrink: 0;
}

/* ================================================================
   2. CABECERA PRINCIPAL (logo + buscador + CTA)
   ================================================================ */
#me-header-main {
  background-color: var(--me-white);
  border-bottom: 1px solid var(--me-border);
  width: 100%;
  height: 76px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 9998;
}
#me-header-main-inner {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Logo */
.me-logo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.me-logo-wrap a {
  display: flex;
  align-items: center;
}
.me-logo-wrap img {
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

/* Buscador */
.me-search-wrap {
  flex: 1;
  max-width: 460px;
  min-width: 200px;
}
.me-search-form {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--me-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--me-white);
  transition: border-color 0.2s;
}
.me-search-form:focus-within {
  border-color: var(--me-orange);
}
.me-search-form input[type="search"],
.me-search-form input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--me-font);
  color: var(--me-black);
  background: transparent;
  min-width: 0;
}
.me-search-form input::placeholder {
  color: #aaa;
  font-size: 13px;
}
.me-search-form button[type="submit"] {
  background: var(--me-orange);
  border: none;
  padding: 0 16px;
  height: 42px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.me-search-form button[type="submit"]:hover {
  background: var(--me-orange-dark);
}
.me-search-form button[type="submit"] svg {
  width: 18px;
  height: 18px;
  fill: var(--me-white);
}

/* CTA zona derecha */
.me-header-cta {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}
.me-cta-phone {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
}
.me-cta-phone .me-cta-label {
  font-size: 11px;
  color: var(--me-gray-mid);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.me-cta-phone .me-cta-number {
  font-size: 16px;
  font-weight: 700;
  color: var(--me-black);
  letter-spacing: -0.3px;
}
.me-cta-phone .me-cta-number:hover {
  color: var(--me-orange);
}
.me-btn-presupuesto {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--me-orange);
  color: var(--me-white) !important;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
  border: none;
  cursor: pointer;
  font-family: var(--me-font);
}
.me-btn-presupuesto:hover {
  background: var(--me-orange-dark);
  transform: translateY(-1px);
}
.me-btn-presupuesto svg {
  width: 16px;
  height: 16px;
  fill: var(--me-white);
}

/* Carrito WooCommerce */
.me-cart-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.me-cart-wrap a {
  display: flex;
  align-items: center;
  color: var(--me-black);
  transition: color 0.2s;
}
.me-cart-wrap a:hover {
  color: var(--me-orange);
}
.me-cart-wrap svg {
  width: 24px;
  height: 24px;
}
.me-cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--me-orange);
  color: var(--me-white);
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ================================================================
   3. MENÚ PRINCIPAL EN UNA LÍNEA
   ================================================================ */
#me-nav-bar {
  background-color: var(--me-white);
  border-bottom: 1px solid var(--me-border);
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 9997;
}
#me-nav-bar-inner {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Lista del menú */
#me-nav-list {
  display: flex;
  align-items: center;
  gap: 0;
  height: 48px;
}
#me-nav-list > li {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}
#me-nav-list > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  height: 100%;
  font-size: 14px;
  font-weight: 500;
  color: var(--me-gray-dark);
  font-family: var(--me-font);
  white-space: nowrap;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
  position: relative;
}
#me-nav-list > li > a:hover,
#me-nav-list > li.me-active > a,
#me-nav-list > li:hover > a {
  color: var(--me-orange);
  border-bottom-color: var(--me-orange);
}
/* Flecha para items con desplegable */
#me-nav-list > li.me-has-dropdown > a::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
}
#me-nav-list > li.me-has-dropdown:hover > a::after {
  transform: rotate(-135deg) translateY(-2px);
}

/* Contacto como botón especial a la derecha */
#me-nav-list > li.me-nav-contacto > a {
  background: var(--me-orange);
  color: var(--me-white);
  border-radius: 5px;
  padding: 8px 16px;
  height: auto;
  border-bottom: none;
  font-weight: 600;
  margin-left: 8px;
}
#me-nav-list > li.me-nav-contacto > a:hover {
  background: var(--me-orange-dark);
  color: var(--me-white);
  border-bottom: none;
}

/* ── Desplegables ────────────────────────────────────────────────── */
.me-dropdown {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  background: var(--me-white);
  border: 1px solid var(--me-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  min-width: 220px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 9996;
}
#me-nav-list > li.me-has-dropdown:hover .me-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.me-dropdown li a {
  display: block;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--me-gray-dark);
  font-family: var(--me-font);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.me-dropdown li a:hover {
  background: var(--me-orange-light);
  color: var(--me-orange);
}
.me-dropdown li.me-dropdown-divider {
  border-top: 1px solid var(--me-border);
  margin: 4px 0;
}
.me-dropdown li.me-dropdown-header {
  padding: 6px 20px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--me-gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
}

/* ================================================================
   4. RESPONSIVE MÓVIL
   ================================================================ */

/* Botón hamburguesa */
#me-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}
#me-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--me-black);
  border-radius: 2px;
  transition: all 0.3s;
}
#me-hamburger.me-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#me-hamburger.me-open span:nth-child(2) {
  opacity: 0;
}
#me-hamburger.me-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Menú móvil overlay */
#me-mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 99998;
  opacity: 0;
  transition: opacity 0.25s;
}
#me-mobile-menu.me-open {
  opacity: 1;
}
#me-mobile-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: var(--me-white);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}
#me-mobile-menu.me-open #me-mobile-panel {
  transform: translateX(0);
}
.me-mobile-header {
  background: var(--me-orange);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.me-mobile-header img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}
.me-mobile-close {
  background: none;
  border: none;
  color: var(--me-white);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.me-mobile-trust {
  background: var(--me-orange-light);
  padding: 10px 20px;
  font-size: 12px;
  color: var(--me-orange-dark);
  font-weight: 600;
  border-bottom: 1px solid var(--me-border);
}
#me-mobile-nav {
  padding: 8px 0;
}
#me-mobile-nav > li {
  border-bottom: 1px solid var(--me-border);
}
#me-mobile-nav > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--me-black);
  font-family: var(--me-font);
}
#me-mobile-nav > li > a:hover {
  color: var(--me-orange);
  background: var(--me-orange-light);
}
.me-mobile-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  color: var(--me-gray-mid);
  transition: transform 0.2s;
}
.me-mobile-toggle.me-open {
  transform: rotate(180deg);
}
.me-mobile-toggle svg {
  width: 16px;
  height: 16px;
}
.me-mobile-submenu {
  display: none;
  background: var(--me-gray-light);
  border-top: 1px solid var(--me-border);
}
.me-mobile-submenu.me-open {
  display: block;
}
.me-mobile-submenu li a {
  display: block;
  padding: 11px 20px 11px 32px;
  font-size: 14px;
  color: var(--me-gray-dark);
  font-family: var(--me-font);
  border-bottom: 1px solid var(--me-border);
}
.me-mobile-submenu li:last-child a {
  border-bottom: none;
}
.me-mobile-submenu li a:hover {
  color: var(--me-orange);
  background: var(--me-orange-light);
}
.me-mobile-footer {
  padding: 20px;
  border-top: 1px solid var(--me-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.me-mobile-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--me-black);
  font-weight: 500;
}
.me-mobile-footer a svg {
  width: 18px;
  height: 18px;
  fill: var(--me-orange);
  flex-shrink: 0;
}
.me-mobile-footer .me-btn-presupuesto {
  justify-content: center;
  width: 100%;
  padding: 12px;
  font-size: 14px;
}

/* ── Breakpoints ─────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  #me-nav-list > li > a {
    padding: 0 10px;
    font-size: 13px;
  }
}

@media (max-width: 900px) {
  /* Topbar simplificada */
  .me-topbar-left,
  .me-topbar-center {
    display: none;
  }
  .me-topbar-right {
    width: 100%;
    justify-content: center;
    gap: 20px;
  }
  #me-topbar {
    height: 28px;
  }

  /* Cabecera: ocultar CTA de texto, mostrar solo carrito + hamburguesa */
  .me-cta-phone {
    display: none;
  }
  .me-btn-presupuesto {
    display: none;
  }
  #me-hamburger {
    display: flex;
  }
  #me-nav-bar {
    display: none;
  }
  #me-mobile-menu {
    display: block;
  }
  .me-logo-wrap img {
    height: 40px;
  }
}

@media (max-width: 600px) {
  #me-topbar {
    height: auto;
    padding: 5px 0;
  }
  #me-topbar-inner {
    flex-direction: column;
    gap: 2px;
    padding: 0 12px;
  }
  .me-topbar-right {
    gap: 14px;
  }
  .me-topbar-right a {
    font-size: 11px;
  }
  #me-header-main {
    height: 60px;
  }
  #me-header-main-inner {
    padding: 0 12px;
    gap: 12px;
  }
  .me-logo-wrap img {
    height: 34px;
  }
  .me-search-wrap {
    min-width: 0;
  }
}

/* ── Ocultar el header original de Divi cuando está activo el nuestro ── */
body.me-custom-header #page-container > #et-main-area,
body.me-custom-header .et_header_style_centered #top-header,
body.me-custom-header #top-header,
body.me-custom-header #main-header {
  display: none !important;
}
