/* 
 * Simple Visual Upgrade for Header Quantity Badges
 * CSS-only enhancement - no JavaScript changes
 */

/* Enhanced badge styling - back to original black, better positioning */
.header-utils .icon-wrapper .count,
.header-utils .icon-wrapper .wishlist-count {
  /* Adjusted positioning for centered icon wrapper */
  position: absolute !important;
  top: 4px !important; /* Adjusted for padding */
  right: 4px !important; /* Adjusted for padding */
  transform: translate(50%, -50%) !important;
  
  /* Back to original black with improvements */
  background: #1a1a1a !important; /* Original black */
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  padding: .2em .4em !important; /* Original padding */
  border-radius: 999px !important;
  
  /* Add subtle border for definition */
  border: 1px solid #ffffff !important;
  
  /* Light shadow for depth */
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.06) !important;
  
  /* Better font rendering */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Hide when empty or zero */
.header-utils .icon-wrapper .count:empty,
.header-utils .icon-wrapper .wishlist-count:empty,
.header-utils .icon-wrapper .count:contains("0"),
.header-utils .icon-wrapper .wishlist-count:contains("0") {
  display: none !important;
}

/* Farfetch-style hover effect on the icon wrapper */
.header-utils .icon-wrapper {
  position: relative !important;
  border-radius: 8px !important;
  transition: background-color 0.2s ease, transform 0.2s ease !important;
  /* Fix alignment to center */
  display: inline-flex !important;
  align-items: center !important; /* Changed from self-end to center */
  justify-content: center !important;
  /* Add padding for hover background */
  padding: 4px !important;
  /* Maintain consistent size */
  width: 40px !important;
  height: 40px !important;
  box-sizing: border-box !important;
}

.header-utils .icon-wrapper:hover {
  background-color: rgba(0, 0, 0, 0.05) !important; /* Light grey background like Farfetch */
  transform: scale(1.02) !important;
}

/* Enhanced hover state for the badges */
.header-utils .icon-wrapper:hover .count,
.header-utils .icon-wrapper:hover .wishlist-count {
  background: #333333 !important; /* Slightly lighter black */
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.1) !important;
}


/* Ensure icons don't interfere with badge positioning */
.header-utils .icon-wrapper .icon-svg,
.header-utils .icon-wrapper img {
  display: block !important;
  position: relative !important;
  z-index: 1 !important;
  /* Maintain icon size */
  width: 20px !important;
  height: 20px !important;
  object-fit: contain !important;
}

/* Mobile optimizations - larger icons and closer spacing */
@media (max-width: 767px) {
  .header-utils .icon-wrapper .icon-svg,
  .header-utils .icon-wrapper img {
    width: 24px !important;
    height: 24px !important;
  }
  
  /* Adjust icon wrapper spacing for mobile */
  .header-utils .icon-wrapper {
    width: 44px !important;
    height: 44px !important;
    margin: 0 -2px !important; /* Negative margin to move closer */
  }
  
  /* Tighter spacing between icons */
  .header-utils {
    gap: 2px !important; /* Much smaller gap */
  }
}

/* Desktop only - increase icon size and ensure perfect alignment */
@media (min-width: 768px) {
  .header-utils .icon-wrapper .icon-svg,
  .header-utils .icon-wrapper img {
    width: 25px !important;
    height: 30px !important;
    /* Ensure perfect vertical centering regardless of icon dimensions */
    vertical-align: middle !important;
    margin: auto !important;
  }
  
  /* Ensure all icon wrappers have identical positioning */
  .header-utils .icon-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: top !important; /* Align wrapper containers */
  }
  
  /* Fine-tune wishlist and account icons - move down 1px */
  .header-utils .wishlist-link,
  .header-utils .account-link {
    transform: translateY(1px) !important;
  }
}

/* Make sure badges are above icons */
.header-utils .icon-wrapper .count,
.header-utils .icon-wrapper .wishlist-count {
  z-index: 2 !important;
}

/* Print styles - hide badges */
@media print {
  .header-utils .icon-wrapper .count,
  .header-utils .icon-wrapper .wishlist-count {
    display: none !important;
  }
}