.ef-counters {
  margin: 0 0 18px;
}

.ef-counter {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  margin-top: var(--ef-counter-margin-top, 12px);
  margin-bottom: var(--ef-counter-margin-bottom, 12px);
  padding: var(--ef-counter-padding-y, 14px) var(--ef-counter-padding-x, 16px);
  overflow: hidden;
  color: var(--ef-counter-text, #111827);
  background-color: var(--ef-counter-bg, #f5f5f6);
  border: var(--ef-counter-border-width, 1px) solid var(--ef-counter-border, #e5e7eb);
  border-radius: var(--ef-counter-radius, 8px);
  text-align: var(--ef-counter-text-align, center);
}

.ef-counter[hidden],
.ef-counter__ended[hidden],
.ef-counter__unit[hidden] {
  display: none !important;
}

.ef-counter > * {
  position: relative;
  z-index: 1;
}

.ef-counter::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background-image: var(--ef-counter-bg-image, none);
  background-position: var(--ef-counter-bg-position, center);
  background-size: cover;
  opacity: var(--ef-counter-bg-opacity, 1);
}

.ef-counter__heading {
  margin: 0;
  font-size: var(--ef-counter-heading-size, 14px);
  font-weight: var(--ef-counter-heading-weight, 700);
  line-height: 1.2;
  text-align: var(--ef-counter-text-align, center);
  color: var(--ef-counter-text, #111827);
}

.ef-counter__units {
  display: flex;
  justify-content: var(--ef-counter-justify, center);
  gap: var(--ef-counter-gap, 8px);
  margin-top: var(--ef-counter-gap, 8px);
}

.ef-counter__unit {
  min-width: 58px;
  padding: 5px 8px;
  text-align: center;
  border-radius: calc(var(--ef-counter-radius, 8px) * 0.75);
  background: rgba(255, 255, 255, 0.68);
}

.ef-counter--dark .ef-counter__unit {
  background: rgba(0, 0, 0, 0.22);
}

.ef-counter__value {
  display: block;
  font-size: var(--ef-counter-value-size, 36px);
  font-weight: var(--ef-counter-value-weight, 700);
  line-height: 1;
  color: var(--ef-counter-accent, #ea4d6f);
  font-variant-numeric: tabular-nums;
}

.ef-counter__label {
  display: block;
  margin-top: 3px;
  font-size: var(--ef-counter-label-size, 11px);
  font-weight: var(--ef-counter-label-weight, 600);
  line-height: 1.1;
  color: var(--ef-counter-muted, #6b7280);
}

.ef-counter__stock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: var(--ef-counter-gap, 8px);
  font-size: 14px;
  color: var(--ef-counter-text, #111827);
}

.ef-counter__stock-label {
  font-weight: 600;
}

.ef-counter__stock-value {
  font-weight: 700;
  color: var(--ef-counter-accent, #ea4d6f);
}

.ef-counter__stock-track {
  height: 12px;
  margin-top: calc(var(--ef-counter-gap, 8px) * 0.75);
  overflow: hidden;
  background: var(--ef-counter-track, #ffffff);
  border-radius: 999px;
}

.ef-counter__stock-bar {
  position: relative;
  width: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ef-counter-high, #00bf6d);
  border-radius: inherit;
  transition: width 0.45s ease, background-color 0.45s ease;
}

.ef-counter[data-stock-level="low"] .ef-counter__stock-bar {
  background: var(--ef-counter-low, #fd4470);
}

.ef-counter--animated[data-stock-level="low"] .ef-counter__stock-bar {
  animation: ef-counter-low-pulse 1.3s ease-in-out infinite;
}

.ef-counter[data-stock-level="medium"] .ef-counter__stock-bar {
  background: var(--ef-counter-medium, #eac131);
}

.ef-counter[data-stock-level="high"] .ef-counter__stock-bar {
  background: var(--ef-counter-high, #00bf6d);
}

.ef-counter__ended {
  text-align: center;
  font-weight: 700;
  color: var(--ef-counter-text, #111827);
}

.ef-counter--ended .ef-counter__timer,
.ef-counter--ended .ef-counter__stock {
  display: none;
}

@keyframes ef-counter-low-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
  50% {
    box-shadow: 0 0 14px var(--ef-counter-low-pulse, #ff8ca7);
  }
}

.ef-counter--animated .ef-counter__value.is-changing,
.ef-counter--animated .ef-counter__stock-value.is-changing {
  animation: ef-counter-value-pop 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ef-counter--animated .ef-counter__stock-bar::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.38) 45%, transparent 75%);
  transform: translateX(-120%);
  animation: ef-counter-bar-shine 2.8s ease-in-out infinite;
}

@keyframes ef-counter-value-pop {
  0% {
    opacity: 0.65;
    transform: translateY(4px) scale(0.96);
  }
  60% {
    opacity: 1;
    transform: translateY(-1px) scale(1.045);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ef-counter-bar-shine {
  0% {
    transform: translateX(-120%);
  }
  45%,
  100% {
    transform: translateX(120%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ef-counter--animated .ef-counter__value.is-changing,
  .ef-counter--animated .ef-counter__stock-value.is-changing,
  .ef-counter--animated .ef-counter__stock-bar,
  .ef-counter--animated .ef-counter__stock-bar::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ========== Interactive purchase notifications ========== */
.ef-counter-notification-stack {
  position: fixed;
  z-index: 999990;
  display: flex;
  width: min(360px, calc(100vw - 28px));
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.ef-counter-notification-stack--bottom-left {
  left: 16px;
  bottom: 18px;
}

.ef-counter-notification-stack--bottom-right {
  right: 16px;
  bottom: 18px;
}

.ef-counter-notification-stack--top-left {
  left: 16px;
  top: calc(18px + var(--wp-admin--admin-bar--height, 0px));
}

.ef-counter-notification-stack--top-right {
  right: 16px;
  top: calc(18px + var(--wp-admin--admin-bar--height, 0px));
}

.ef-counter-notification {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 82px;
  padding: 12px 34px 12px 12px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  color: #111827;
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.18), 0 2px 10px rgba(15, 23, 42, 0.08);
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.98);
  transition: opacity 260ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
  will-change: opacity, transform;
}

.ef-counter-notification-stack--top-left .ef-counter-notification,
.ef-counter-notification-stack--top-right .ef-counter-notification {
  transform: translate3d(0, -14px, 0) scale(0.98);
}

.ef-counter-notification.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.ef-counter-notification.is-leaving {
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.98);
}

.ef-counter-notification-stack--top-left .ef-counter-notification.is-leaving,
.ef-counter-notification-stack--top-right .ef-counter-notification.is-leaving {
  transform: translate3d(0, -10px, 0) scale(0.98);
}

.ef-counter-notification__media {
  display: flex;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 7px;
  background: #f3f4f6;
}

.ef-counter-notification__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ef-counter-notification__media-placeholder {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, #e5e7eb, #cbd5e1);
}

.ef-counter-notification__body {
  min-width: 0;
  flex: 1;
}

.ef-counter-notification__person {
  overflow: hidden;
  color: #111827;
  font-size: 14px;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ef-counter-notification__person strong {
  font-weight: 800;
}

.ef-counter-notification__person span {
  color: #6b7280;
  font-weight: 500;
}

.ef-counter-notification__message {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ef-counter-notification__meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.ef-counter-notification__verified-icon {
  display: inline-flex;
  width: 13px;
  height: 13px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.ef-counter-notification__verified {
  overflow: hidden;
  color: #2563eb;
  font-weight: 600;
  text-overflow: ellipsis;
}

.ef-counter-notification__close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #d1d5db;
  font-size: 20px;
  font-weight: 800;
  line-height: 18px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.ef-counter-notification__close:hover,
.ef-counter-notification__close:focus {
  background: #f3f4f6;
  color: #6b7280;
  outline: none;
}

@media (max-width: 640px) {
  .ef-counter-notification-stack {
    right: 14px;
    left: 14px;
    width: auto;
  }

  .ef-counter-notification-stack--top-left,
  .ef-counter-notification-stack--top-right {
    top: calc(14px + var(--wp-admin--admin-bar--height, 0px));
  }

  .ef-counter-notification-stack--bottom-left,
  .ef-counter-notification-stack--bottom-right {
    bottom: 14px;
  }
}

@media (max-width: 480px) {
  .ef-counter__units {
    gap: 5px;
  }

  .ef-counter__unit {
    min-width: 0;
    flex: 1 1 0;
    padding: 5px 4px;
  }

  .ef-counter__value {
    font-size: min(var(--ef-counter-value-size, 36px), 30px);
  }
}
