.emc-amm { display: none; }

@media (max-width: 1024px) {
  body.emc-amm-enabled .elementor-location-header,
  body.emc-amm-enabled header[data-elementor-type="header"] {
    display: none !important;
  }

  html:has(body.emc-amm-menu-open),
  body.emc-amm-menu-open {
    overflow: hidden !important;
    max-width: 100%;
  }

  .emc-amm {
    display: block;
    position: relative;
    z-index: 999999;
    font-family: inherit;
    max-width: 100%;
    overflow-x: clip;
  }

  .emc-amm-topbar {
    height: 58px;
    background: #000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    position: sticky;
    top: 0;
    z-index: 1000001;
    box-sizing: border-box;
    max-width: 100%;
  }

  .emc-amm-toggle {
    appearance: none;
    border: 0;
    background: transparent;
    color: #fff;
    width: 36px;
    min-width: 36px;
    height: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
  }

  .emc-amm-icon-menu { width: 22px; display: grid; gap: 4px; }
  .emc-amm-icon-menu i { display: block; height: 2px; background: currentColor; border-radius: 2px; }
  .emc-amm-icon-close { display: none; font-size: 36px; font-weight: 500; line-height: 1; margin-top: -3px; }
  .emc-amm.is-open .emc-amm-icon-menu { display: none; }
  .emc-amm.is-open .emc-amm-icon-close { display: block; }

  .emc-amm-logo {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    max-width: 116px;
  }
  .emc-amm-logo-img { display: block; width: 100%; height: auto; max-height: 42px; object-fit: contain; }
  .emc-amm-logo-text { color: #fff; font-weight: 800; text-decoration: none; }

  .emc-amm-fitment-top {
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.92);
    padding: 7px 11px;
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    margin-left: auto;
    white-space: nowrap;
  }

  .emc-amm-cart {
    color: #fff;
    width: 32px;
    min-width: 32px;
    height: 40px;
    display: grid;
    place-items: center;
    position: relative;
    text-decoration: none;
  }
  .emc-amm-cart svg { width: 22px; height: 22px; fill: currentColor; }
  .emc-amm-cart-count {
    position: absolute;
    top: 1px;
    right: -1px;
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ef5b5b;
    color: #fff;
    font-size: 10px;
    line-height: 1;
  }

  .emc-amm-drawer {
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: 100vw;
    box-sizing: border-box;
    background: #000;
    color: #fff;
    z-index: 1000000;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .emc-amm-drawer[hidden] { display: none !important; }

  /* 0.1.5: each submenu owns its back bar as the first row in normal flow. */
  .emc-amm-panel-head {
    height: 48px;
    min-height: 48px;
    background: #087fc5;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px 0 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-sizing: border-box;
    overflow: hidden;
  }
  .emc-amm-panel-head strong {
    color: #fff !important;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .emc-amm-back {
    appearance: none;
    border: 0;
    background: transparent;
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    flex: 0 0 auto;
  }
  .emc-amm-back-chevron {
    width: 11px;
    height: 11px;
    border-left: 4px solid currentColor;
    border-bottom: 4px solid currentColor;
    transform: rotate(45deg);
    display: inline-block;
  }

  .emc-amm-panels,
  .emc-amm-panel {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .emc-amm-panel[hidden] { display: none !important; }
  .emc-amm-panel { display: block; }

  .emc-amm-list { list-style: none; margin: 0; padding: 0; }
  .emc-amm-row { margin: 0; padding: 0; border-bottom: 1px solid #26313a; }

  .emc-amm-row-button,
  .emc-amm-row-link {
    width: 100%;
    min-height: 44px;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 0;
    background: transparent;
    color: #fff !important;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
  }

  .emc-amm-row-link:link,
  .emc-amm-row-link:visited,
  .emc-amm-row-link:hover,
  .emc-amm-row-link:focus,
  .emc-amm-row-link:active,
  .emc-amm-row-button:hover,
  .emc-amm-row-button:focus,
  .emc-amm-row-button:active {
    color: #fff !important;
    text-decoration: none !important;
  }

  .emc-amm-chevron {
    width: 10px;
    height: 10px;
    border-right: 4px solid #9ca3a7;
    border-top: 4px solid #9ca3a7;
    transform: rotate(45deg);
    flex: 0 0 auto;
    margin-right: 2px;
  }

  .emc-amm-footer {
    padding: 34px 18px 28px;
    display: grid;
    gap: 12px;
    background: #000;
  }
  .emc-amm-cta {
    min-height: 36px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 16px;
  }
  .emc-amm-cta-light,
  .emc-amm-cta-light:link,
  .emc-amm-cta-light:visited,
  .emc-amm-cta-light:hover,
  .emc-amm-cta-light:focus,
  .emc-amm-cta-light:active { background: #fff; color: #111 !important; }

  .emc-amm-cta-dark,
  .emc-amm-cta-dark:link,
  .emc-amm-cta-dark:visited,
  .emc-amm-cta-dark:hover,
  .emc-amm-cta-dark:focus,
  .emc-amm-cta-dark:active { background: #000; color: #fff !important; border: 1px solid #fff; font-style: italic; font-weight: 700; }

  .emc-amm-fitment-top,
  .emc-amm-fitment-top:link,
  .emc-amm-fitment-top:visited,
  .emc-amm-fitment-top:hover,
  .emc-amm-fitment-top:focus,
  .emc-amm-fitment-top:active,
  .emc-amm-logo,
  .emc-amm-logo:link,
  .emc-amm-logo:visited,
  .emc-amm-logo:hover,
  .emc-amm-logo:focus,
  .emc-amm-logo:active,
  .emc-amm-cart,
  .emc-amm-cart:link,
  .emc-amm-cart:visited,
  .emc-amm-cart:hover,
  .emc-amm-cart:focus,
  .emc-amm-cart:active {
    color: #fff !important;
    text-decoration: none !important;
  }

  .emc-amm-socials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding-top: 8px;
  }
  .emc-amm-social {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    color: #000 !important;
    display: grid;
    place-items: center;
    text-decoration: none !important;
  }
  .emc-amm-social:link,
  .emc-amm-social:visited,
  .emc-amm-social:hover,
  .emc-amm-social:focus,
  .emc-amm-social:active {
    color: #000 !important;
    text-decoration: none !important;
  }
  .emc-amm-social svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
  }

  /* WordPress admin bar offsets while testing logged in. */
  body.admin-bar .emc-amm-topbar {
    top: 32px;
  }
  body.admin-bar .emc-amm-drawer {
    top: 90px;
  }

  @media (max-width: 782px) {
    body.admin-bar .emc-amm-topbar {
      top: 46px;
    }
    body.admin-bar .emc-amm-drawer {
      top: 104px;
    }
  }

  @media (max-width: 420px) {
    .emc-amm-topbar { gap: 7px; padding: 0 8px; }
    .emc-amm-logo { max-width: 108px; }
    .emc-amm-fitment-top { font-size: 10px; padding: 7px 9px; }
  }
}

/* 0.3.1: persistent mobile product search below the top bar. */
@media (max-width: 1024px) {
  .emc-amm-searchbar {
    height: 52px;
    background: #000;
    display: flex;
    align-items: flex-start;
    padding: 0 8px 8px;
    position: sticky;
    top: 58px;
    z-index: 1000001;
    box-sizing: border-box;
    max-width: 100%;
  }

  .emc-amm-searchbar .emc-ah-search {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    background: #fff;
    border-radius: 2px;
    margin: 0;
  }

  .emc-amm-searchbar .emc-ah-search .search-field {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: 44px;
    padding: 0 13px;
    margin: 0;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0;
    box-shadow: none !important;
    background: #fff !important;
    color: #111 !important;
    font: inherit;
    font-size: 14px;
    line-height: 44px;
    -webkit-appearance: none;
    appearance: none;
  }

  .emc-amm-searchbar .emc-ah-search .search-field::placeholder {
    color: #777;
    opacity: 1;
  }

  .emc-amm-searchbar .emc-ah-search-submit {
    appearance: none;
    width: 46px;
    min-width: 46px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: 0 !important;
    border-left: 1px solid #e6e6e6 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #111 !important;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: none !important;
  }

  .emc-amm-searchbar .emc-ah-search-submit svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
    display: block;
  }

  .emc-amm-drawer {
    top: 110px;
  }

  body.admin-bar .emc-amm-searchbar {
    top: 90px;
  }
  body.admin-bar .emc-amm-drawer {
    top: 142px;
  }

  @media (max-width: 782px) {
    body.admin-bar .emc-amm-searchbar {
      top: 104px;
    }
    body.admin-bar .emc-amm-drawer {
      top: 156px;
    }
  }
}
