/**
 * JHD29 Header Cart — scoped to .jhd29-header-cart
 * Marker: jhd29-header-cart-v2.2.0
 */

/* Altes Astra-WooCommerce-Icon ausblenden, sobald JHD29-Element aktiv ist */
body.jhd29-has-header-cart .ast-builder-layout-element.ast-header-woo-cart .ast-site-header-cart {
  display: none !important;
}

body.jhd29-has-header-cart .ast-builder-layout-element.ast-header-woo-cart {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.jhd29-header-cart {
  --jhd29-cart-accent: #00f5d4;
  --jhd29-cart-accent-soft: rgba(0, 245, 212, 0.35);
  --jhd29-cart-purple: rgba(157, 78, 221, 0.45);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f4f4f8;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease,
    background 0.25s ease;
  overflow: visible;
  flex-shrink: 0;
}

.jhd29-header-cart:hover {
  border-color: var(--jhd29-cart-accent-soft);
  box-shadow:
    0 0 0 1px rgba(0, 245, 212, 0.12),
    0 0 28px rgba(0, 245, 212, 0.18),
    0 0 40px rgba(157, 78, 221, 0.12);
  transform: translateY(-1px);
  color: #f4f4f8;
}

.jhd29-header-cart:focus {
  outline: none;
}

.jhd29-header-cart:focus-visible {
  outline: 2px solid var(--jhd29-cart-accent);
  outline-offset: 3px;
  box-shadow:
    0 0 0 4px rgba(0, 245, 212, 0.15),
    0 0 24px rgba(0, 245, 212, 0.2);
}

.jhd29-header-cart:active {
  transform: translateY(0);
}

.jhd29-header-cart__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.jhd29-header-cart__svg {
  display: block;
  width: 22px;
  height: 22px;
}

.jhd29-header-cart__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid #030308;
  background: linear-gradient(135deg, var(--jhd29-cart-accent), #7b5cff);
  color: #030308;
  font-family: 'Syne', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  letter-spacing: 0;
  box-shadow: 0 2px 8px rgba(0, 245, 212, 0.35);
  pointer-events: none;
}

.jhd29-header-cart__count.is-empty,
.jhd29-header-cart__count[hidden] {
  display: none !important;
}

/* Desktop-Header (above) + Mobile-Header (primary) */
#ast-desktop-header .ast-header-woo-cart .jhd29-header-cart,
#ast-mobile-header .ast-header-woo-cart .jhd29-header-cart {
  margin-inline-start: 4px;
}

@media (max-width: 921px) {
  #ast-mobile-header .site-header-primary-section-right .ast-header-woo-cart {
    margin-inline-end: 4px;
  }

  .jhd29-header-cart {
    width: 44px;
    height: 44px;
  }

  .jhd29-header-cart__count {
    top: -3px;
    right: -5px;
  }
}
