/**
 * AllNaturals – Account avatar menu.
 * Brand palette: deep magenta #7a1a4a, rose #d15f8a, blush #e07a9f.
 */

.anaccount {
  --an-rose: #d15f8a;
  --an-rose-light: #e07a9f;
  --an-plum: #7a1a4a;
  --an-blush: #fef6fa;
  --an-ink: #2c2c2c;
  --an-grad: linear-gradient(135deg, var(--an-rose-light), var(--an-rose));
  --an-grad-deep: linear-gradient(135deg, var(--an-rose), var(--an-plum));
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1200;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------------------------- Trigger */
.anaccount__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 3px;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.25s ease, transform 0.25s ease;
}
.anaccount__trigger:hover { background: rgba(209, 95, 138, 0.10); }
.anaccount__trigger:active { transform: scale(0.94); }
.anaccount__trigger:focus-visible {
  outline: 2px solid var(--an-rose);
  outline-offset: 2px;
}

.anaccount__avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--an-grad);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(122, 26, 74, 0.35);
  overflow: visible;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), box-shadow 0.3s ease;
}
.anaccount__trigger:hover .anaccount__avatar {
  transform: translateY(-2px) rotate(-4deg);
  box-shadow: 0 6px 16px rgba(122, 26, 74, 0.45);
}
.anaccount__glyph { font-size: 1.2rem; filter: saturate(0) brightness(3); }
.anaccount__initial { transform: translateY(0.5px); text-shadow: 0 1px 2px rgba(0,0,0,.25); }

/* Pulsing ring around the avatar */
.anaccount__ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--an-rose-light);
  opacity: 0;
  pointer-events: none;
}
.anaccount__trigger:hover .anaccount__ring { animation: an-ring 1.4s ease-out infinite; }
@keyframes an-ring {
  0%   { opacity: 0.7; transform: scale(0.9); }
  100% { opacity: 0;   transform: scale(1.45); }
}

/* "Online" dot for logged-in users */
.anaccount__status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #3ec46d;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(62, 196, 109, 0.6);
  animation: an-pulse 2.2s infinite;
}
@keyframes an-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(62, 196, 109, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(62, 196, 109, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 196, 109, 0); }
}

.anaccount__caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--an-rose);
  transition: transform 0.3s ease;
}

/* --------------------------------------------------------------- Open st. */
.anaccount.is-open .anaccount__caret { transform: rotate(180deg); }
.anaccount.is-open .anaccount__avatar {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 6px 18px rgba(122, 26, 74, 0.5);
}

/* ----------------------------------------------------------------- Panel  */
.anaccount__panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 224px;
  padding: 8px;
  background: #fff;
  border: 1px solid #f3d8e4;
  border-radius: 16px;
  box-shadow: 0 18px 40px -12px rgba(122, 26, 74, 0.45), 0 4px 10px rgba(0,0,0,.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.96);
  transform-origin: top right;
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(.34,1.56,.64,1), visibility 0.22s;
}
.anaccount.is-open .anaccount__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Little pointer triangle */
.anaccount__panel::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 16px;
  width: 13px;
  height: 13px;
  background: #fff;
  border-left: 1px solid #f3d8e4;
  border-top: 1px solid #f3d8e4;
  transform: rotate(45deg);
  border-radius: 3px 0 0 0;
}

/* Panel header */
.anaccount__panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 12px;
  margin-bottom: 6px;
  border-bottom: 1px dashed #f0cede;
  background: var(--an-blush);
  border-radius: 11px;
}
.anaccount__panel-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: var(--an-grad-deep);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 3px 8px rgba(122,26,74,.3);
}
.anaccount__panel-text { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.anaccount__hi { font-size: 0.72rem; color: var(--an-rose); text-transform: uppercase; letter-spacing: .04em; }
.anaccount__who {
  font-size: 0.95rem; font-weight: 700; color: var(--an-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}

/* List + items (staggered entrance) */
.anaccount__list { list-style: none; margin: 0; padding: 0; }
.anaccount__item {
  margin: 0;
  opacity: 0;
  transform: translateX(8px);
}
.anaccount.is-open .anaccount__item {
  animation: an-item-in 0.4s cubic-bezier(.22,1,.36,1) forwards;
  animation-delay: calc(0.05s * var(--i) + 0.08s);
}
@keyframes an-item-in {
  to { opacity: 1; transform: translateX(0); }
}

.anaccount__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--an-ink) !important;
  text-decoration: none !important;
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  transition: background 0.2s ease, transform 0.18s ease, padding-left 0.2s ease;
}
.anaccount__link:hover {
  background: var(--an-grad);
  color: #fff !important;
  padding-left: 16px;
  transform: translateX(2px);
}
.anaccount__icon {
  font-size: 1.12rem;
  width: 24px;
  display: inline-flex;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
}
.anaccount__link:hover .anaccount__icon { transform: scale(1.25) rotate(-8deg); }
.anaccount__label { flex: 1; }
.anaccount__chev {
  opacity: 0;
  font-size: 1.2rem;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.anaccount__link:hover .anaccount__chev { opacity: 1; transform: translateX(0); color: #fff; }

/* Log out gets a warm-danger hover */
.anaccount__link--logout:hover { background: linear-gradient(135deg, #e8638a, #b5295e); }

/* Click ripple */
.anaccount__ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: an-ripple 0.6s ease-out;
  pointer-events: none;
}
@keyframes an-ripple {
  to { transform: scale(3.2); opacity: 0; }
}

/* Confirmation flash after a click (before navigation) */
.anaccount__link.is-confirming {
  background: var(--an-grad-deep) !important;
  color: #fff !important;
  animation: an-confirm 0.45s ease;
}
.anaccount__link.is-confirming .anaccount__icon { animation: an-pop 0.45s ease; }
@keyframes an-confirm {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}
@keyframes an-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.6) rotate(10deg); }
  100% { transform: scale(1.2); }
}

/* The trigger "thanks for clicking me" wink */
.anaccount__trigger.is-tapped .anaccount__avatar { animation: an-wink 0.45s ease; }
@keyframes an-wink {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.82) rotate(6deg); }
  70%  { transform: scale(1.12) rotate(-6deg); }
  100% { transform: scale(1); }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .anaccount *,
  .anaccount *::before,
  .anaccount *::after {
    animation: none !important;
    transition: none !important;
  }
  .anaccount__item { opacity: 1; transform: none; }
}

/* Push the cart + avatar pair to the far right, with breathing room. */
#highlighted-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding-right: 22px;
  box-sizing: border-box;
}
/* The cart uses margin:0 auto by default which would absorb flex free space
   and shove the avatar away — neutralise it so the two sit together. */
#highlighted-inner .block-commerce-cart-flyout { margin: 0 !important; }
/* Keep the account block from stretching full width in the flex row. */
#highlighted-inner .block-allnaturals-user-account-menu,
#highlighted-inner [id*="account"] { flex: 0 0 auto; }
