/* =========================================================
   MAGNAVERSO HEADER
   - Desktop: usa estrutura Nicepage existente (#sec-header)
   - Mobile: usa template header-mobile.php (.mgv-header-mobile)
   ========================================================= */

/* =========================================================
   VISIBILIDADE DESKTOP / MOBILE
   ========================================================= */
.mgv-header-mobile{
  display:none !important;
}

.mgv-header-desktop{
  display:block !important;
}

/* =========================================================
   HEADER DESKTOP
   ========================================================= */
#sec-header{
  background:transparent;
}

#sec-header .u-sheet-1{
  position:relative;
}

#sec-header .mgv-header-top{
  height:141px;
}

#sec-header .mgv-header-bottom{
  width:100%;
}

/* linha do menu + ícones */
#sec-header .mgv-header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:56px;
  gap:10px;
  width:100%;
}

#sec-header .mgv-header-menu{
  flex:1 1 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  min-width:0;
}

#sec-header .mgv-header-search,
#sec-header .mgv-header-cart{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:44px;
}

/* busca */
#sec-header .mgv-search{
  width:30px;
  height:30px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}

#sec-header .mgv-search img{
  width:20px;
  height:20px;
  display:block !important;
  object-fit:contain;
}

/* carrinho */
#sec-header .mgv-header-cart a.mgv-cart-link,
#sec-header .mgv-header-cart a.mgv-cart{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  text-decoration:none;
}

#sec-header .mgv-header-cart a.mgv-cart-link img,
#sec-header .mgv-header-cart a.mgv-cart img{
  width:32px;
  height:32px;
  display:block !important;
  object-fit:contain;
}

#sec-header .mgv-header-cart .mgv-cart-count{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:16px;
  height:16px;
  padding:0 4px;
  border-radius:999px;
  background:#e53935;
  color:#fff;
  font-size:11px;
  font-weight:900;
  line-height:16px;
  text-align:center;
  box-shadow:-4px 4px 4px rgba(0,0,0,.80);
  z-index:3;
}

/* =========================================================
   MENU DESKTOP
   - reset local para não depender do Nicepage
   ========================================================= */
#sec-header .mgv-header-menu .u-menu-1{
  margin:0 !important;
  width:100%;
}

#sec-header .mgv-header-menu .u-nav-container{
  width:100%;
  display:flex;
  justify-content:flex-end;
  align-items:center;
}

/* ul principal */
#sec-header .mgv-header-menu .u-nav-1,
#sec-header .mgv-header-menu ul.u-nav-1{
  display:flex !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:2px;
  list-style:none !important;
  margin:0 !important;
  padding:0 !important;
}

/* li principal */
#sec-header .mgv-header-menu .u-nav-1 > li,
#sec-header .mgv-header-menu .u-nav-1 > .u-nav-item{
  position:relative;
  display:block !important;
  list-style:none !important;
  margin:0 !important;
  padding:0 !important;
}

#sec-header .mgv-header-menu .u-nav-1 > li::marker,
#sec-header .mgv-header-menu .u-nav-1 > .u-nav-item::marker{
  content:"";
}

/* links principais */
#sec-header .u-menu-1 .u-nav-1 > li > a,
#sec-header .u-menu-1 .u-nav-1 > .u-nav-item > .u-nav-link{
  display:block !important;
  white-space:nowrap;
  color:#fff !important;
  background:transparent !important;
  padding:8px 18px !important;
  text-decoration:none !important;
  font-weight:500;
  line-height:1.1;
  border-radius:2px;
}

#sec-header .u-menu-1 .u-nav-1 > li > a:hover,
#sec-header .u-menu-1 .u-nav-1 > .u-nav-item > .u-nav-link:hover,
#sec-header .u-menu-1 .u-nav-1 > li.current-menu-item > a,
#sec-header .u-menu-1 .u-nav-1 > .u-nav-item.current-menu-item > .u-nav-link,
#sec-header .u-menu-1 .u-nav-1 > li.current-menu-parent > a,
#sec-header .u-menu-1 .u-nav-1 > .u-nav-item.current-menu-parent > .u-nav-link{
  background:rgba(255,255,255,0.15) !important;
}

/* =========================================================
   DROPDOWN (submenu) - sem depender de nicepage.js
   ========================================================= */
#sec-header .u-menu-1 .u-nav-1 .menu-item-has-children{
  position:relative;
}

#sec-header .u-menu-1 .u-nav-1 .sub-menu{
  display:none;
  position:absolute;
  top:100%;
  left:0;
  min-width:220px;
  padding:8px 0;
  margin:0;
  list-style:none;
  border-radius:10px;
  background:rgba(4,71,82,0.92);
  backdrop-filter:blur(6px);
  box-shadow:0 12px 30px rgba(0,0,0,.35);
  z-index:9999;
}

#sec-header .u-menu-1 .u-nav-1 .sub-menu li{
  list-style:none !important;
  margin:0;
  padding:0;
}

#sec-header .u-menu-1 .u-nav-1 .sub-menu li::marker{
  content:"";
}

#sec-header .u-menu-1 .u-nav-1 .menu-item-has-children:hover > .sub-menu,
#sec-header .u-menu-1 .u-nav-1 .menu-item-has-children:focus-within > .sub-menu{
  display:block;
}

#sec-header .u-menu-1 .u-nav-1 .sub-menu .u-nav-item{
  width:100%;
}

#sec-header .u-menu-1 .u-nav-1 .sub-menu a,
#sec-header .u-menu-1 .u-nav-1 .sub-menu .u-nav-link{
  display:block;
  padding:10px 14px !important;
  color:#fff !important;
  background:transparent !important;
  white-space:nowrap;
  text-decoration:none !important;
}

#sec-header .u-menu-1 .u-nav-1 .sub-menu a:hover,
#sec-header .u-menu-1 .u-nav-1 .sub-menu .u-nav-link:hover{
  background:rgba(255,255,255,0.15) !important;
}

#sec-header .u-menu-1 .u-nav-1 > .menu-item-has-children > a::after,
#sec-header .u-menu-1 .u-nav-1 > .menu-item-has-children > .u-nav-link::after{
  content:"▾";
  margin-left:8px;
  font-size:12px;
  opacity:.85;
}

/* checkout: pequeno ajuste de altura */
body.mgv-is-checkout #sec-header .mgv-header-top{
  height:150px;
}

body.mgv-is-checkout #sec-header .mgv-header-row{
  height:52px;
}

body.mgv-is-checkout #sec-header .u-menu-1 .u-nav-1 > li > a,
body.mgv-is-checkout #sec-header .u-menu-1 .u-nav-1 > .u-nav-item > .u-nav-link{
  padding:6px 14px !important;
}

/* =========================================================
   HEADER MOBILE
   ========================================================= */
.header_logo{
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:230px;
}

.header_logo_img{
  display:block;
  max-width:100%;
  height:auto;
}

.mgv-header-mobile .mgv-m-toggle{
  display:none;
}

.mgv-header-mobile .mgv-m-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  width:100%;
}

.mgv-header-mobile .mgv-m-top{
  position:absolute !important;
  top:230px;
  left:0;
  right:0;
  height:56px;
  padding:8px 12px;
  background:#19755c !important;
}

.mgv-header-mobile .mgv-m-burger{
  width:40px;
  height:40px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  cursor:pointer;
  flex:0 0 auto;
}

.mgv-header-mobile .mgv-m-burger span{
  width:24px;
  height:2px;
  background:#fff;
  display:block;
}

.mgv-header-mobile .mgv-m-title{
  flex:1 1 auto;
  text-align:center;
  color:#fff;
  font-weight:700;
  font-family:Oswald, Arial, sans-serif;
  letter-spacing:.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin-right:0;
  padding:0 10px;
  font-size:1.1rem;
}

/* busca + carrinho no mobile */
.mgv-header-mobile .mgv-search,
.mgv-header-mobile .mgv-cart-link{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}

.mgv-header-mobile .mgv-search img{
  width:20px !important;
  height:20px !important;
  display:block !important;
  object-fit:contain !important;
}

.mgv-header-mobile .mgv-cart-link{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  text-decoration:none;
}

.mgv-header-mobile .mgv-cart-icon{
  display:block;
  width:26px;
  height:26px;
  background-color:#ffffff;
  -webkit-mask-image:var(--cart-icon);
  mask-image:var(--cart-icon);
  -webkit-mask-repeat:no-repeat;
  mask-repeat:no-repeat;
  -webkit-mask-position:center;
  mask-position:center;
  -webkit-mask-size:contain;
  mask-size:contain;
}

.mgv-header-mobile .mgv-cart-link img{
  display:none !important;
}

.mgv-header-mobile .mgv-cart-count{
  position:absolute;
  top:-3px;
  right:-5px;
  min-width:16px;
  height:16px;
  padding:0 4px;
  border-radius:999px;
  background:#ffd400;
  color:#000;
  font-size:10px;
  font-weight:700;
  line-height:16px;
  text-align:center;
}

/* painel lateral */
.mgv-header-mobile .mgv-m-panel{
  position:fixed;
  top:0;
  left:-320px;
  width:260px;
  max-width:82vw;
  height:100vh;
  min-height:100vh;
  background:#2f4f3a;
  box-shadow:2px 2px 12px rgba(0,0,0,.35);
  z-index:99999;
  transition:left .25s ease;
  font-family:Oswald, Arial, sans-serif;
  font-size:18px;
  font-weight:300;
}

.mgv-header-mobile .mgv-m-panel-inner{
  padding:18px 16px 24px;
}

.mgv-header-mobile .mgv-m-close{
  color:#fff;
  font-size:32px;
  line-height:32px;
  cursor:pointer;
  display:inline-block;
  margin-bottom:10px;
}

.mgv-header-mobile .mgv-m-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  z-index:99998;
}

.mgv-header-mobile .mgv-m-toggle:checked ~ .mgv-m-panel{
  left:0;
}

.mgv-header-mobile .mgv-m-toggle:checked ~ .mgv-m-overlay{
  display:block;
}

/* itens do menu no painel */
.mgv-header-mobile .mgv-m-nav{
  list-style:none;
  margin:10px 0 0;
  padding:0;
}

.mgv-header-mobile .mgv-m-nav li{
  list-style:none;
  margin:0;
  padding:0;
  border-bottom:1px solid rgba(255,255,255,.15);
}

.mgv-header-mobile .mgv-m-nav li::marker{
  content:"";
}

.mgv-header-mobile .mgv-m-nav a{
  display:block;
  padding:12px 6px;
  color:#fff;
  text-decoration:none;
  font-weight:700;
  font-family:Oswald, Arial, sans-serif;
}

.mgv-header-mobile .mgv-m-nav a:hover{
  background:rgba(255,255,255,.12);
}

/* submenus no mobile: exibe sempre */
.mgv-header-mobile .mgv-m-nav .sub-menu{
  list-style:none;
  margin:0;
  padding:6px 0 10px 14px;
  border-left:2px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06);
}

.mgv-header-mobile .mgv-m-nav .sub-menu li{
  border-bottom:none;
}

.mgv-header-mobile .mgv-m-nav .sub-menu a{
  padding:10px 6px;
  font-weight:600;
  font-size:.95rem;
}

/* =========================================================
   BREAKPOINT PRINCIPAL
   - desktop até 992+
   - mobile até 991
   ========================================================= */
@media (max-width: 991px){

  .mgv-header-desktop{
    display:none !important;
  }

  .mgv-header-mobile{
    display:block !important;
    position:relative !important;
    width:100% !important;
    min-height:280px !important;
    height:285px !important;
    background:url("../imgs/header_mobile.jpg");
    background-repeat:no-repeat !important;
    background-position:center top !important;
    background-size:cover !important;
    overflow:visible !important;
  }

  #sec-header{
    background:transparent !important;
    background-image:none !important;
    min-height:0 !important;
    height:auto !important;
  }

  #sec-header::before,
  #sec-header::after,
  .mgv-header-mobile::before,
  .mgv-header-mobile::after{
    background-image:none !important;
  }

  #sec-header,
  #sec-header .u-clearfix,
  #sec-header .u-sheet,
  #sec-header .u-sheet-1{
    width:100% !important;
    max-width:100% !important;
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:0 !important;
    padding-right:0 !important;
  }

  .mgv-header-mobile .header_logo{
    min-height:230px !important;
    height:230px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:90%;
    margin:0 auto;
    padding-top:90px;
  }

  .mgv-header-mobile .mgv-m-top{
    top:230px !important;
    left:0 !important;
    right:0 !important;
    height:56px !important;
    padding:8px 12px !important;
    background:#19755c !important;
  }

  .mgv-header-mobile .mgv-m-row{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:10px !important;
    width:100% !important;
  }

  .mgv-header-mobile .mgv-m-title{
    margin-right:0 !important;
    padding:0 10px !important;
    font-size:1.1rem !important;
  }

  .mgv-header-mobile .mgv-m-panel{
    position:fixed !important;
    top:0 !important;
    left:-320px !important;
    width:260px !important;
    max-width:82vw !important;
    height:100vh !important;
    min-height:100vh !important;
    background:#2f4f3a !important;
    background-image:none !important;
    box-shadow:2px 2px 12px rgba(0,0,0,.35) !important;
    z-index:99999 !important;
    transition:left .25s ease !important;
    transform:none !important;
    right:auto !important;
    bottom:auto !important;
  }

  .mgv-header-mobile .mgv-m-panel-inner{
    padding:18px 16px 24px !important;
  }

  .mgv-header-mobile .mgv-m-toggle:checked ~ .mgv-m-panel{
    left:0 !important;
    display:block !important;
  }

  .mgv-header-mobile .mgv-m-overlay{
    display:none !important;
    position:fixed !important;
    inset:0 !important;
    background:rgba(0,0,0,.55) !important;
    z-index:99998 !important;
  }

  .mgv-header-mobile .mgv-m-toggle:checked ~ .mgv-m-overlay{
    display:block !important;
  }

  .mgv-header-mobile .mgv-m-nav{
    margin-top:6px !important;
  }

  .mgv-header-mobile .mgv-m-nav a{
    color:#fff !important;
    font-size:1rem !important;
  }

  .mgv-header-mobile .mgv-m-nav .sub-menu{
    background:rgba(255,255,255,.06) !important;
    border-left:2px solid rgba(255,255,255,.16) !important;
  }

  .mgv-header-mobile{
    flex-direction:initial !important;
    align-items:initial !important;
    gap:0 !important;
  }
}