/* ===== Mobile bottom nav (<=768px) ===== */
.hc-mnav { display: none; }

@media (max-width: 768px) {
  .hc-mnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
    /* When iOS Chrome hides its bottom toolbar, safe-area-inset-bottom (~30px) kicks in.
       With a fixed 64px height that space was taken from the content and the icons and circle lifted ~14px off the bottom.
       Now the space is added ON TOP of the 64px; the content area is always 64px. */
    height: calc(64px + env(safe-area-inset-bottom, 0px)); background: #fff;
    border-top: 1px solid #eee; border-radius: 22px 22px 0 0;
    box-shadow: 0 -2px 20px rgba(0,0,0,.10);
    display: flex; align-items: center; justify-content: space-around;
    font-family: inherit;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .hc-mnav__it, .hc-mnav__store, .hc-pop__x, .hc-pop__body--cats .hc-mega__item {
    -webkit-tap-highlight-color: transparent; tap-highlight-color: transparent;
    -webkit-touch-callout: none; user-select: none;
  }
  /* Nav items are now <a role="button"> — no Kadence button styling applies.
     Just guarantee link reset (no underline, no tap highlight). */
  .hc-mnav a.hc-mnav__it,
  .hc-mnav a.hc-mnav__store {
    cursor: pointer;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
  }
  .hc-mnav a.hc-mnav__it:hover,
  .hc-mnav a.hc-mnav__it:focus,
  .hc-mnav a.hc-mnav__it:active,
  .hc-mnav a.hc-mnav__store:hover,
  .hc-mnav a.hc-mnav__store:focus,
  .hc-mnav a.hc-mnav__store:active {
    text-decoration: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
  }

  .hc-mnav__it {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: #9a9a9a; font-size: 10px; font-weight: 600; text-decoration: none;
    background: none; border: 0; cursor: pointer; font-family: inherit; padding: 0;
  }
  .hc-mnav__ic { display: block; }
  .hc-mnav__ic svg { width: 23px; height: 23px; display: block; }
  .hc-mnav__it.is-act { color: #f18833; }
  .hc-mnav__lb { line-height: 1; }
  /* Cart badge */
  .hc-mnav__ic--badge { position: relative; }
  .hc-mnav__basket {
    display: block; width: 23px; height: 23px; background-color: currentColor;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
  }
  .hc-mnav__n {
    position: absolute; top: -5px; right: -8px; background: #f18833; color: #fff;
    font-size: 9px; font-weight: 800; min-width: 15px; height: 15px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
  }
  .hc-mnav__n[data-hc-cart-count="0"] { display: none; }
  /* Floating store button */
  .hc-mnav__store {
    flex: 0 0 auto; width: 58px; display: flex; flex-direction: column; align-items: center;
    gap: 3px; text-decoration: none; margin-top: -26px; position: relative;
    background: none; border: 0; cursor: pointer; font-family: inherit; padding: 0;
  }
  .hc-mnav__circle {
    width: 54px; height: 54px; border-radius: 50%; background: #fff;
    border: 3px solid #f18833; box-shadow: 0 4px 14px rgba(0,0,0,.18);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    position: relative; z-index: 1;
  }
  .hc-mnav__circle img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
  .hc-mnav__globe {
    width: 48px; height: 48px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #6cc6ff, #2b8fd6);
  }
  .hc-mnav__arrow {
    position: absolute; top: 42px; left: 50%; transform: translateX(-50%);
    width: 20px; height: 20px; background: #f18833; border: 2.5px solid #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 3;
  }
  .hc-mnav__arrow svg { display: block; }
  .hc-mnav__lb--store { font-size: 10px; font-weight: 800; color: #f18833; margin-top: 8px; }

  /* Push page content so fixed nav doesn't cover the footer */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  /* Hide CheckoutWC floating side-cart toggle on mobile (we use the nav Cart) */
  #cfw-side-cart-floating-button, .cfw-side-cart-button, .cfw-floating-cart, .cfw-scb,
  #cfw-side-cart-button, .cfw-side-cart-toggle, [class*="floating-cart"],
  [id*="floating-button"] { display: none !important; }

  /* ===== Popups (bottom sheet) ===== */
  .hc-pop { position: fixed; inset: 0; z-index: 9995; }
  .hc-pop[hidden] { display: none; }
  .hc-pop__overlay { position: absolute; inset: 0; background: rgba(15,12,10,.5); backdrop-filter: blur(2px); animation: hcPopFade .2s ease; }
  .hc-pop__sheet {
    position: absolute; left: 0; right: 0; bottom: 0; background: #fff;
    border-radius: 22px 22px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.25);
    max-height: 80vh; display: flex; flex-direction: column;
    animation: hcPopUp .32s cubic-bezier(.2,.9,.25,1.02);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .hc-pop__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px 12px; border-bottom: 1px solid #f0f0f0;
  }
  .hc-pop__title { font-size: 16px; font-weight: 800; color: #1f1f1f; }
  .hc-pop__x { background: #f0f0f2; border: 0; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #555; cursor: pointer; transition: background .15s, color .15s; flex: 0 0 auto; }
  .hc-pop__x:hover, .hc-pop__x:active { background: #1c1c1e; color: #fff; }
  .hc-pop__x svg { width: 17px !important; height: 17px !important; flex: 0 0 auto; display: block; }
  .hc-pop__body { overflow-y: auto; padding: 16px 18px 22px; }

  /* Mega-menu inside Categories popup: override header's <=1024px hide, show as grid */
  .hc-pop__body--cats .hc-mega { display: block !important; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .hc-pop__body--cats .hc-mega__inner { display: block !important; padding: 0 !important; max-width: none !important; }
  .hc-pop__body--cats .hc-mega__burger { display: none !important; }
  .hc-pop__body--cats .hc-mega__list { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 10px; overflow: visible !important; }
  .hc-pop__body--cats .hc-mega__item {
    display: flex !important; flex-direction: column; align-items: center; justify-content: center;
    gap: 9px; padding: 18px 8px; border: 1px solid #f0f0f2; border-radius: 16px;
    text-align: center; min-height: 96px; background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    transition: transform .15s, box-shadow .15s, border-color .15s;
  }
  .hc-pop__body--cats .hc-mega__item:active {
    transform: translateY(1px); box-shadow: 0 1px 4px rgba(0,0,0,.08);
  }
  .hc-pop__body--cats .hc-mega__item.is-active {
    border-color: #f18833; background: #fff7ef;
    box-shadow: 0 4px 14px rgba(241,136,51,.18);
  }
  .hc-pop__body--cats .hc-mega__icon { width: 30px; height: 30px; background-color: #444; }
  .hc-pop__body--cats .hc-mega__item.is-active .hc-mega__icon { background-color: #f18833; }
  .hc-pop__body--cats .hc-mega__imgicon { width: 30px; height: 30px; object-fit: contain; }
  .hc-pop__body--cats .hc-mega__label { font-size: 11px; font-weight: 600; color: #333; line-height: 1.2; }

  @keyframes hcPopFade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes hcPopUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  body.hc-pop-open { overflow: hidden; }
}
