/* Header cart icon. Global — used in our topbars and theme / Elementor headers. */

a.hx-hdr-cart {
  position: relative;
  box-sizing: border-box;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #FFFBF5;
  border: 1px solid #E6DAC8;
  color: #2A2420;
  text-decoration: none !important;
  box-shadow: none;
  margin: 0;
  padding: 0;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}
a.hx-hdr-cart:hover,
a.hx-hdr-cart:focus {
  background: #F6E5E0;
  color: #9A4129;
  border-color: #E6DAC8;
}
a.hx-hdr-cart svg {
  width: 20px;
  height: 20px;
  display: block;
}
a.hx-hdr-cart .hx-hdr-cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #C05133;
  color: #fff;
  font: 800 11px/18px Nunito, "Segoe UI", system-ui, sans-serif;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}
a.hx-hdr-cart .hx-hdr-cart-count[hidden] {
  display: none !important;
}

/* Theme / Elementor header: sit in the top-right cluster, left of social icons. */
.elementor-location-header {
  position: relative;
}
.hx-hdr-cart-slot--theme {
  position: absolute;
  top: 18px;
  right: 88px;
  z-index: 60;
  line-height: 0;
}
/* Desktop theme header already has its own cart (with total) in the black bar, so hide ours there to avoid overlapping the social icons. */
@media (min-width: 1024px) {
  .hx-hdr-cart-slot--theme {
    display: none !important;
  }
}

/* Block-theme header (local test / Twenty Twenty-Five): pin to the header row. */
.wp-site-blocks > header {
  position: relative;
}

/* If a listing has no usable theme header, keep the icon reachable. */
body.hx-listing-page:not(:has(.elementor-location-header)):not(:has(.wp-site-blocks > header)) .hx-hdr-cart-slot--theme {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 80;
}

/* Desktop: keep the seller button and cart together on the right edge.
   If the seller button is hidden (logged-in sellers), the cart still goes right. */
@media (min-width: 1024px) {
  .topbar > .btn.btn-primary,
  .topbar > .topbar-cta,
  .topbar > a.hx-hdr-cart {
    margin-left: auto;
  }
  .topbar > .btn.btn-primary + a.hx-hdr-cart,
  .topbar > .topbar-cta + a.hx-hdr-cart,
  .topbar > .btn + a.hx-hdr-cart {
    margin-left: 0;
  }
}
