/*
 * replica-account-popover.css - header account popover ("Sign in or create account"), the stand-in for the sheet that
 * Shopify's hosted account.js draws under the account icon. Markup: templates/partials/account-popover.html; behaviour:
 * assets/js/account-popover.js (moves the panel to <body>, anchors it, toggles the identity card). Namespace: ub-acct-pop*.
 *
 * Every size comes from raw/live/reference/account-popover-live.png, a 2x (Retina) capture: the header icons sit 82 to 88 px
 * apart there against 42 to 44 px in the live 1440 capture, so every measured pixel is divided by 2. Corner radii were fitted
 * with a circle, font sizes by rendering the same strings with the Inter files of assets/fonts and matching the widths:
 *   panel 360 px wide, 16 px padding, radius 24 px, anchored flush under the header group, right edge 20 px from the viewport
 *   edge (about 25 px right of the cart icon); title 18 px / 700 beside a 32 px round grey (#f0f0f0) close button with a
 *   12 px X; identity card 1 px #d9d9d9 border, radius 13 px, 16 px padding, 32 px lavender avatar, name 14 px caps,
 *   e-mail 12 px #404040; primary 48 px button, radius 13 px, 15 px / 500 white text (the Shop sheet paints it #5433EB,
 *   the owner asked for black on 04/10: --ub-acct-accent); two 48 px outlined buttons (radius 13 px) with 16 px icons and
 *   an 8 px gap. The capture also shows a 46 px grey "More ways to sign in" button and a 14 px "Email me with news and
 *   offers" checkbox between the card and the outlined buttons: both removed from the partial on 04/10 at the owner's
 *   request (the .ub-acct-pop__more / __consent rules below stay in case they come back).
 * Phone (<= 749 px, the theme's breakpoint): full-width bottom sheet, radius 24 px on top, dimmed backdrop, same content.
 */

/* ---------------------------------------------------------------- panel (desktop: anchored popover) */
.ub-acct-pop {
  --ub-acct-text: #000;
  --ub-acct-muted: #404040;
  --ub-acct-border: #d9d9d9;
  --ub-acct-soft: #f0f0f0;
  --ub-acct-accent: #000000; /* owner (04/10): black button with white text instead of the Shop purple */
  --ub-acct-accent-hover: #333333;
  --ub-acct-radius: 24px; /* panel */
  --ub-acct-radius-inner: 13px; /* card, primary button, outlined buttons */
  position: fixed;
  top: var(--ub-acct-top, 120px);
  right: var(--ub-acct-right, 20px);
  z-index: 20; /* above the sticky header (8) and the menu drawer (18); modal <dialog>s stay on top (top layer) */
  box-sizing: border-box;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - var(--ub-acct-top, 120px) - 16px);
  overflow: auto;
  padding: 16px;
  background: #fff;
  color: var(--ub-acct-text);
  border-radius: var(--ub-acct-radius);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.14);
  font-family: var(--font-body--family, Inter, sans-serif);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  animation: ub-acct-pop-in 160ms ease-out;
}
.ub-acct-pop[hidden] { display: none; }
.ub-acct-pop:focus { outline: none; }
.ub-acct-pop :focus-visible { outline: 2px solid var(--ub-acct-text); outline-offset: 2px; }
.ub-acct-pop a { color: inherit; text-decoration: none; }

@keyframes ub-acct-pop-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- head: title + round close button */
.ub-acct-pop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}
.ub-acct-pop__title {
  margin: 0;
  font-family: var(--font-heading--family, Inter, sans-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ub-acct-text);
}
.ub-acct-pop__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ub-acct-soft);
  color: var(--ub-acct-text);
  cursor: pointer;
  transition: background-color 120ms ease;
}
.ub-acct-pop__close:hover { background: #e4e4e4; }
.ub-acct-pop__close svg { width: 12px; height: 12px; }

/* ---------------------------------------------------------------- identity card (remembered / signed-in customer) */
.ub-acct-pop__card {
  box-sizing: border-box;
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid var(--ub-acct-border);
  border-radius: var(--ub-acct-radius-inner);
  background: #fff;
}
.ub-acct-pop__card[hidden] { display: none; }
.ub-acct-pop__who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0 0 12px;
}
.ub-acct-pop__avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(165deg, #c4b9f8 0%, #ad9df3 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}
.ub-acct-pop__identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ub-acct-pop__name {
  font-size: 14px;
  line-height: 18px;
  text-transform: uppercase;
  color: var(--ub-acct-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ub-acct-pop__email {
  font-size: 12px;
  line-height: 18px;
  color: var(--ub-acct-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- primary button ("Continue" / "Sign in"): black since 04/10 (owner), Shop purple in the capture */
.ub-acct-pop__primary {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: var(--ub-acct-radius-inner);
  background: var(--ub-acct-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  transition: background-color 120ms ease;
}
.ub-acct-pop__primary:hover,
.ub-acct-pop__primary:focus-visible { background: var(--ub-acct-accent-hover); color: #fff; }
/* the theme's link rules (a:link / a:visited in base.css) painted the resting text black; higher specificity keeps it white at rest */
.ub-acct-pop a.ub-acct-pop__primary,
.ub-acct-pop a.ub-acct-pop__primary:link,
.ub-acct-pop a.ub-acct-pop__primary:visited,
.ub-acct-pop a.ub-acct-pop__primary:active,
.ub-acct-pop button.ub-acct-pop__primary { color: #fff; text-decoration: none; -webkit-text-fill-color: #fff; }
.ub-acct-pop__primary--signin { margin: 0 0 12px; }
.ub-acct-pop__primary--signin[hidden] { display: none; }

/* ---------------------------------------------------------------- grey button "More ways to sign in" (same 13 px radius as the card; not rendered since 04/10, owner) */
.ub-acct-pop__more {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border-radius: var(--ub-acct-radius-inner);
  background: var(--ub-acct-soft);
  color: var(--ub-acct-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  transition: background-color 120ms ease;
}
.ub-acct-pop__more:hover { background: #e4e4e4; }

/* ---------------------------------------------------------------- marketing checkbox (local only; not rendered since 04/10, owner) */
.ub-acct-pop__consent {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 19px;
  font-size: 14px;
  line-height: 18px;
  color: var(--ub-acct-text);
  cursor: pointer;
}
.ub-acct-pop__consent input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  display: inline-grid;
  place-content: center;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1px solid var(--ub-acct-border);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}
.ub-acct-pop__consent input:checked {
  border-color: var(--ub-acct-text);
  background: var(--ub-acct-text);
}
.ub-acct-pop__consent input:checked::after {
  content: "";
  width: 7px;
  height: 4px;
  margin-top: -1px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg);
}

/* ---------------------------------------------------------------- outlined "Orders" / "Profile" buttons */
.ub-acct-pop__links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ub-acct-pop__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--ub-acct-border);
  border-radius: var(--ub-acct-radius-inner);
  background: #fff;
  color: var(--ub-acct-text);
  font-size: 14px;
  line-height: 1;
  transition: background-color 120ms ease;
}
.ub-acct-pop__link:hover { background: #f7f7f7; }
.ub-acct-pop__link svg { flex: none; width: 16px; height: 16px; }
.ub-acct-pop__link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- backdrop: only the phone sheet dims the page */
.ub-acct-pop__backdrop { display: none; }

/* ---------------------------------------------------------------- phone: bottom sheet */
@media screen and (max-width: 749px) {
  .ub-acct-pop {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 48px);
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--ub-acct-radius) var(--ub-acct-radius) 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
    animation: ub-acct-sheet-in 220ms ease-out;
  }
  .ub-acct-pop__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(0, 0, 0, 0.4);
    animation: ub-acct-fade-in 220ms ease-out;
  }
  .ub-acct-pop__backdrop[hidden] { display: none; }
  html.ub-acct-pop-lock { overflow: hidden; }
}

@keyframes ub-acct-sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes ub-acct-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ub-acct-pop,
  .ub-acct-pop__backdrop { animation: none; }
}
