/**
 * Avotech navigation fix
 * - Tablet (768px–1239px): full horizontal menu + hover dropdowns
 * - Mobile (≤767px): hamburger toggle + expandable sub-menus
 * - Hide WooCommerce profile/cart icons (static site)
 * - Ensure mobile header logo is visible and centered
 */

/* ── Hide profile & cart icons (all breakpoints) ───────────────────── */
#Top_bar .top-bar-right-icon-user,
#Top_bar .myaccount_button,
#Top_bar #header_cart,
#Top_bar .top-bar-right-icon-cart {
  display: none !important;
}

/* Theme JS can set max-height: 0 before images load — keep logos visible */
#Top_bar #logo img.logo-main,
#Top_bar #logo img.logo-sticky {
  max-height: 95px !important;
}

/* ── Tablet / medium: desktop-style menu ───────────────────────────── */
@media only screen and (min-width: 768px) and (max-width: 1239px) {
  #Top_bar a.responsive-menu-toggle {
    display: none !important;
  }

  body:not(.header-simple) #Top_bar #menu {
    display: block !important;
    position: static !important;
    width: auto !important;
    float: none !important;
    height: auto !important;
    margin: 0 !important;
    bottom: auto !important;
    top: auto !important;
    right: auto !important;
  }

  #Top_bar .menu_wrapper {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    text-align: center;
  }

  #Top_bar #menu > ul {
    width: auto !important;
    float: none !important;
    display: inline-block;
    text-align: left;
  }

  #Top_bar #menu > ul > li {
    width: auto !important;
    float: none !important;
    display: inline-block;
    position: relative;
    padding-bottom: 0;
    border-right: 0;
  }

  #Top_bar #menu > ul > li > a {
    padding: 12px 8px !important;
    margin: 0;
    display: block;
    height: auto;
    line-height: normal;
    border: none;
  }

  #Top_bar #menu > ul > li > a span {
    border: none;
    line-height: 1.4;
    display: inline;
    padding: 0;
  }

  #Top_bar #menu ul li.submenu > .menu-toggle {
    display: none !important;
  }

  #Top_bar #logo img.logo-main {
    display: inline !important;
  }

  #Top_bar #logo img.logo-mobile,
  #Top_bar #logo img.logo-mobile-sticky {
    display: none !important;
  }

  #Top_bar .logo {
    position: static;
    float: none;
    width: 100%;
    text-align: center;
    margin: 0;
  }

  #Top_bar.is-sticky .logo {
    width: auto !important;
    text-align: left !important;
  }

  #Top_bar .logo #logo,
  #Top_bar .logo .custom-logo-link {
    padding: 10px 0 !important;
    margin: 0 auto;
  }

  /* Dropdown sub-menus */
  #Top_bar #menu ul li ul {
    position: absolute !important;
    left: 0 !important;
    top: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 220px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    background-image: none !important;
  }

  #Top_bar #menu ul li ul li {
    width: 100% !important;
    float: none;
    display: block;
  }

  #Top_bar #menu ul li ul li a {
    padding: 10px 16px !important;
    white-space: normal;
    line-height: 1.35;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  #Top_bar #menu ul li ul li ul {
    left: 100% !important;
    top: 0 !important;
  }

  .header-stack.header-center #Top_bar .menu_wrapper {
    clear: both;
  }
}

/* ── Desktop/tablet: header-stack sticky = single 60px bar ─────────── */
@media only screen and (min-width: 768px) {
  .header-stack #Top_bar.is-sticky {
    height: 60px !important;
    overflow: hidden !important;
  }

  .header-stack #Top_bar.is-sticky .column.one {
    display: flex !important;
    align-items: center !important;
    height: 60px !important;
  }

  .header-stack #Top_bar.is-sticky .top_bar_left {
    display: flex !important;
    align-items: center !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 60px !important;
    float: none !important;
  }

  .header-stack #Top_bar.is-sticky .logo {
    width: auto !important;
    flex: 0 0 auto !important;
    float: none !important;
    margin: 0 16px 0 20px !important;
    padding: 0 !important;
    border-bottom: none !important;
    text-align: left !important;
  }

  .header-stack #Top_bar.is-sticky #logo,
  .header-stack #Top_bar.is-sticky .custom-logo-link {
    height: 50px !important;
    line-height: 50px !important;
    padding: 5px 0 !important;
    margin: 0 !important;
  }

  .header-stack #Top_bar.is-sticky #logo img.logo-main {
    display: none !important;
  }

  .header-stack #Top_bar.is-sticky #logo img.logo-sticky {
    display: inline !important;
    max-height: 35px !important;
    width: auto !important;
  }

  .header-stack #Top_bar.is-sticky #logo img.logo-mobile,
  .header-stack #Top_bar.is-sticky #logo img.logo-mobile-sticky {
    display: none !important;
  }

  .header-stack #Top_bar.is-sticky .menu_wrapper {
    clear: none !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    float: none !important;
    margin: 0 !important;
    text-align: center !important;
  }

  .header-stack #Top_bar.is-sticky #menu {
    display: block !important;
    position: static !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
  }

  .header-stack #Top_bar.is-sticky #menu > ul {
    display: inline-block !important;
    float: none !important;
    vertical-align: middle !important;
  }

  .header-stack #Top_bar.is-sticky #menu > ul > li > a {
    padding: 15px 8px !important;
    line-height: 30px !important;
  }

  .header-stack #Top_bar.is-sticky #menu > ul > li > a span {
    line-height: 30px !important;
  }

  .header-stack #Top_bar.is-sticky .top_bar_right {
    position: relative !important;
    flex: 0 0 auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    height: auto !important;
    width: auto !important;
    margin: 0 10px 0 0 !important;
  }

  .header-stack #Top_bar.is-sticky .top_bar_right_wrapper {
    top: auto !important;
    position: relative !important;
  }

  .header-stack #Top_bar.is-sticky a.responsive-menu-toggle {
    display: none !important;
  }
}

/* ── Homepage slider: half height ──────────────────────────────────── */
@media only screen and (max-width: 767px) {
  body.home .mfn-rev-slider #rev_slider_4_1_wrapper,
  body.home .mfn-rev-slider #rev_slider_4_1,
  body.home .mfn-rev-slider rs-module-wrap,
  body.home .mfn-rev-slider rs-module {
    height: 360px !important;
    max-height: 360px !important;
    min-height: 0 !important;
  }
}

/* ── Mobile: overlay popup menu + accordion sub-menus ────────────────── */
@media only screen and (max-width: 767px) {
  #Top_bar #menu {
    display: none !important;
    position: fixed !important;
    top: var(--avotech-menu-top, 60px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-height: none !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    z-index: 10001 !important;
    background: #fff !important;
    margin: 0 !important;
    padding: 0 0 24px !important;
    float: none !important;
    box-shadow: none !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

  body.mobile-menu-open #Top_bar #menu {
    display: block !important;
  }

  #Top_bar #menu > ul {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #Top_bar #menu > ul > li > a {
    padding: 14px 20px !important;
    line-height: 1.4 !important;
    height: auto !important;
    border: none !important;
    font-size: 15px;
  }

  #Top_bar #menu > ul > li > a span {
    border: none !important;
    line-height: inherit !important;
    padding: 0 !important;
  }

  body.mobile-menu-open::after {
    content: "";
    position: fixed;
    top: var(--avotech-menu-top, 60px);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    pointer-events: none;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  /* Header bar: single row with centered logo + toggle on the right */
  #Top_bar {
    position: relative !important;
    z-index: 10003;
    background: #fff !important;
    min-height: 60px;
  }

  body.mobile-menu-open #Top_bar {
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  }

  #Top_bar .top_bar_left {
    position: static !important;
  }

  #Top_bar .menu_wrapper {
    position: static !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    float: none !important;
  }

  #Top_bar a.responsive-menu-toggle,
  #Top_bar a.responsive-menu-toggle.is-sticky,
  .header-stack #Top_bar a.responsive-menu-toggle.is-sticky,
  .mobile-sticky #Top_bar.is-sticky a.responsive-menu-toggle {
    position: absolute !important;
    top: 50% !important;
    right: 12px !important;
    left: auto !important;
    margin: 0 !important;
    transform: translateY(-50%) !important;
    z-index: 10004 !important;
    width: 40px;
    height: 40px;
    line-height: 40px;
    display: block !important;
  }

  #Top_bar a.responsive-menu-toggle i {
    line-height: 40px;
  }

  #Top_bar a.responsive-menu-toggle.active .icon-menu-fine:before {
    content: "\e963";
  }

  #Top_bar #menu > ul > li {
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  #Top_bar #menu ul li.submenu > a {
    padding-right: 52px !important;
  }

  #Top_bar #menu ul li.submenu > .menu-toggle {
    display: block !important;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 26px;
    font-weight: 300;
    text-align: center;
    cursor: pointer;
    color: #444 !important;
    opacity: 0.45;
    z-index: 3;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #Top_bar #menu ul li.submenu > .menu-toggle:after {
    content: "+" !important;
    position: static !important;
    display: inline !important;
    background: none !important;
    border: none !important;
    line-height: inherit;
  }

  #Top_bar #menu ul li.submenu.hover > .menu-toggle:after {
    content: "−" !important;
  }

  #Top_bar #menu ul li ul {
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
    background: rgba(0, 0, 0, 0.03) !important;
    display: none !important;
  }

  #Top_bar #menu ul li.hover > ul {
    display: block !important;
  }

  #Top_bar #menu ul li ul li a {
    padding: 0 20px 0 28px !important;
    font-size: 13px;
    line-height: 40px;
  }

  #Top_bar #menu ul li ul li ul li a {
    padding-left: 40px !important;
  }

  #Top_bar #menu ul li ul li.submenu > .menu-toggle {
    right: 8px;
    height: 32px;
    line-height: 32px;
    font-size: 22px;
  }

  /* Mobile header: centered logo + hamburger only */
  #Top_bar .top_bar_right {
    display: none !important;
  }

  #Top_bar .logo {
    display: block !important;
    float: none !important;
    width: 100% !important;
    text-align: center !important;
    margin: 0 !important;
    position: relative;
    z-index: 2;
  }

  #Top_bar .logo #logo,
  #Top_bar .logo .custom-logo-link {
    display: inline-block !important;
    height: auto !important;
    line-height: normal !important;
    margin: 0 auto !important;
    padding: 12px 56px 12px 16px !important;
    box-sizing: border-box;
    text-align: center !important;
  }

  #Top_bar #logo img.logo-main,
  #Top_bar #logo img.logo-sticky {
    display: none !important;
  }

  #Top_bar #logo img.logo-mobile {
    display: inline-block !important;
    max-height: 50px !important;
    width: auto !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  #Top_bar #logo img.logo-mobile-sticky {
    display: none !important;
  }

  .mobile-sticky #Top_bar.is-sticky #logo img.logo-mobile {
    display: inline-block !important;
  }

  .mobile-sticky #Top_bar.is-sticky #logo img.logo-mobile-sticky {
    display: none !important;
  }

  .mobile-header-mini #Top_bar .logo {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
  }

  .mobile-header-mini #Top_bar #logo,
  .mobile-header-mini #Top_bar .custom-logo-link {
    height: auto !important;
    line-height: normal !important;
  }

  .mobile-header-mini.mobile-mini-mr-lc #Top_bar .logo,
  .mobile-header-mini.mobile-mini-ml-lc #Top_bar .logo {
    float: none !important;
    margin: 0 !important;
    text-align: center !important;
  }
}
