/* Menú móvil unificado: cajón propio; el collapse Bootstrap del template se oculta ≤991px */

@media (max-width: 991px) {
  #header-v1.pos-header .cart-menu > a.dropdown-toggle img#img-cart{
    filter: none!important;
  }
  /* Móvil: el menú/collapse del template desaparece por completo; solo el cajón .fx-mobile-nav-* */
  #header-v1 #myNavbar.fx-legacy-nav-collapse,
  #header-v3 #myNavbar.fx-legacy-nav-collapse {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    pointer-events: none !important;
  }

  /*
   * Interior móvil: el theme usa .menu-mobile { position:absolute } y .icon-menu con paddings
   * pensados para la hamburguesa a la derecha → el carrito se superpone al logo centrado.
   * Fila flex real: [hamburguesa | logo | carrito].
   */
  #header-v3 > .row {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 56px;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #header-v3 > .row::before,
  #header-v3 > .row::after {
    content: none !important;
    display: none !important;
  }

  /* DOM: 1=menu-mobile, 2=iconos, 3=hamburguesa → visual: hamburguesa, logo, carrito */
  #header-v3 > .row > .menu-mobile {
    order: 2;
    position: relative !important;
    left: auto !important;
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    max-width: none !important;
    float: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  /* Columna del carrito (.menu-mobile usa col-xs-12; esta es la de iconos) */
  #header-v3 > .row > div.col-sm-10.col-xs-9:not(.menu-mobile) {
    order: 3;
    flex: 0 0 auto;
    width: auto !important;
    max-width: none !important;
    float: none !important;
    padding-left: 4px !important;
    padding-right: 12px !important;
  }

  #header-v3 > .row > .fx-cotizacion-header-title {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
    float: none !important;
    width: auto !important;
    max-width: none !important;
    padding-left: 12px;
  }

  #header-v3 > .row > .navbar-header.mobile-menu {
    order: 1;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    flex: 0 0 auto;
    z-index: 2 !important;
    padding: 0 !important;
    margin: 0 0 0 4px !important;
    float: none !important;
    width: auto !important;
  }

  #header-v3 ul.nav.icon-menu,
  #header-v3 ul.navbar-nav.icon-menu {
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
  }

  #header-v3 .icon-menu::before {
    content: none !important;
    display: none !important;
  }

  #header-v3 .icon-menu li.cart-menu,
  #header-v3 .icon-menu li {
    float: none !important;
  }

  #header-v3 .fx-mobile-only-logo {
    display: block !important;
    line-height: 0;
    text-align: center;
    max-width: 100%;
  }

  #header-v3 .fx-mobile-only-logo img {
    max-height: 44px;
    width: auto;
    max-width: min(200px, 55vw);
    margin-left: auto !important;
    margin-right: auto !important;
  }

}

@media (min-width: 992px) {
  .fx-mobile-only-logo {
    display: none !important;
  }

  .fx-mobile-nav-drawer {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .fx-mobile-nav-toggle {
    display: none !important;
  }
}

/* Cajón */
.fx-mobile-nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 100050;
  pointer-events: none;
  visibility: hidden;
}

.fx-mobile-nav-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.fx-mobile-nav-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(25, 28, 29, 0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.fx-mobile-nav-drawer.is-open .fx-mobile-nav-backdrop {
  opacity: 1;
}

.fx-mobile-nav-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: min(300px, 88vw);
  max-width: 100%;
  background: #fff;
  box-shadow: 6px 0 32px rgba(0, 0, 0, 0.12);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  padding: 56px 0 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.fx-mobile-nav-drawer.is-open .fx-mobile-nav-panel {
  transform: translateX(0);
}

.fx-mobile-nav-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #AD9371;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fx-mobile-nav-close:hover,
.fx-mobile-nav-close:focus {
  color: rgba(0, 0, 0, 0.75);
}

.fx-mobile-nav-links {
  list-style: none;
  margin: 0;
  padding: 0 20px;
}

.fx-mobile-nav-links li {
  border-bottom: 1px solid rgba(173, 147, 113, 0.2);
}

.fx-mobile-nav-links a {
  display: block;
  padding: 16px 4px;
  font-family: Poppins, sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: rgba(0, 0, 0, 0.8);
  text-decoration: none;
}

.fx-mobile-nav-links a:hover,
.fx-mobile-nav-links a:focus {
  color: #AD9371;
}

body.fx-mobile-nav-open {
  overflow: hidden;
}

/* Botón hamburguesa visible solo móvil/tablet (Bootstrap ya lo hace; refuerzo) */
@media (max-width: 991px) {
  #header-v1 .fx-mobile-nav-toggle.navbar-toggle,
  #header-v3 .fx-mobile-nav-toggle.navbar-toggle {
    display: block !important;
    margin-top: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    float: left !important;
    border: none !important;
    background: transparent !important;
  }

  /* Mismo tamaño / color de icono que en home (style-res-v1 .fa-bars) */
  #header-v1 .fx-mobile-nav-toggle .fa-bars,
  #header-v3 .fx-mobile-nav-toggle .fa-bars {
    color: #AD9371;
    font-size: 22px;
  }
}
