/* =========================================================
   KEMZY GLOBAL STORE — ACCOUNT SLIDE-OUT PANEL
   Header user icon + right-hand drawer (sign in, create
   account, profile, sign out). Dark theme is built in.
========================================================= */

/* ---------- Header icon (sits beside the cart button) ---------- */
.account-link {
  position: relative;
}
.account-link svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.account-link-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Small status dot when a customer is signed in */
.account-dot {
  position: absolute;
  top: 5px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #16a34a;
  border: 2px solid #fff;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.account-link.is-signed-in .account-dot {
  opacity: 1;
  transform: scale(1);
}
html[data-theme="dark"] .account-dot { border-color: #0b1220; }

/* On the mobile menu the icon becomes a labelled row */
@media (max-width: 768px) {
  .main-navigation .account-link {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    gap: 10px;
    padding: 15px 5px;
    border-radius: 0;
    border-bottom: 1px solid var(--border, #e2e8f0);
    font-size: 14px;
    font-weight: 600;
  }
  .main-navigation .account-link-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
  .account-dot {
    top: 50%;
    right: auto;
    left: 17px;
    margin-top: -14px;
  }
}

/* ---------- Overlay + drawer ---------- */
body.account-open { overflow: hidden; }

.acct-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(7, 27, 61, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.acct-overlay.is-visible { opacity: 1; visibility: visible; }

.acct-panel {
  --ap-bg: #ffffff;
  --ap-text: #071b3d;
  --ap-muted: #64748b;
  --ap-line: #e2e8f0;
  --ap-soft: #f4f7fc;
  --ap-input: #ffffff;
  --ap-input-line: #cbd5e1;
  --ap-blue: #1264e8;
  --ap-blue-hover: #0d52c4;
  --ap-link: #2563eb;
  --ap-ok: #15803d;
  --ap-err: #dc2626;

  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  width: min(430px, 100%);
  background: var(--ap-bg);
  color: var(--ap-text);
  box-shadow: -18px 0 60px rgba(7, 27, 61, .22);
  transform: translateX(104%);
  visibility: hidden;
  transition: transform .34s cubic-bezier(.22, .8, .24, 1), visibility .34s;
  font-family: "DM Sans", system-ui, sans-serif;
  outline: none;
}
.acct-panel.is-open { transform: translateX(0); visibility: visible; }

html[data-theme="dark"] .acct-panel {
  --ap-bg: #111d30;
  --ap-text: #e5edf8;
  --ap-muted: #a9bad0;
  --ap-line: #26364d;
  --ap-soft: #16243a;
  --ap-input: #0b1424;
  --ap-input-line: #40516b;
  --ap-blue: #1d5fd1;
  --ap-blue-hover: #2b72ec;
  --ap-link: #8db8ff;
  --ap-ok: #6be39a;
  --ap-err: #ff8f8f;
  box-shadow: -18px 0 60px rgba(0, 0, 0, .55);
}
html[data-theme="dark"] .acct-overlay { background: rgba(0, 0, 0, .72); }

/* ---------- Header ---------- */
.acct-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--ap-line);
}
.acct-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--ap-link);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.acct-title {
  margin: 0;
  color: var(--ap-text);
  font: 800 1.55rem/1.15 "Manrope", "DM Sans", sans-serif;
  letter-spacing: -.4px;
}
.acct-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ap-line);
  border-radius: 50%;
  background: var(--ap-soft);
  color: var(--ap-text);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.acct-close:hover { border-color: var(--ap-blue); color: var(--ap-link); }
.acct-close svg { width: 18px; height: 18px; }

/* ---------- Body ---------- */
.acct-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 26px 30px;
}
.acct-view[hidden] { display: none !important; }
.acct-intro {
  margin: 0 0 20px;
  color: var(--ap-muted);
  font-size: 14px;
  line-height: 1.65;
}
.acct-form { display: grid; gap: 15px; }
.acct-field { display: grid; gap: 7px; }
.acct-field > span {
  color: var(--ap-text);
  font-size: 13px;
  font-weight: 600;
}
.acct-field > span small {
  color: var(--ap-muted);
  font-size: 12px;
  font-weight: 400;
}
.acct-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--ap-input-line);
  border-radius: 8px;
  background: var(--ap-input);
  color: var(--ap-text);
  font: 400 14px "DM Sans", system-ui, sans-serif;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.acct-field input:focus {
  border-color: var(--ap-blue);
  box-shadow: 0 0 0 3px rgba(18, 100, 232, .18);
}
.acct-field input[readonly] { opacity: .75; cursor: not-allowed; }

.acct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--ap-blue);
  border-radius: 8px;
  background: var(--ap-blue);
  color: #fff;
  font: 700 14px "DM Sans", system-ui, sans-serif;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, opacity .2s ease;
}
.acct-btn:hover:not(:disabled) { background: var(--ap-blue-hover); border-color: var(--ap-blue-hover); }
.acct-btn:disabled { opacity: .6; cursor: wait; }
.acct-btn-ghost {
  background: transparent;
  border-color: var(--ap-input-line);
  color: var(--ap-text);
}
.acct-btn-ghost:hover:not(:disabled) {
  background: var(--ap-soft);
  border-color: var(--ap-link);
  color: var(--ap-text);
}

.acct-link {
  display: inline;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--ap-link);
  font-family: inherit;
  font-weight: 700;
  font-size: inherit;
  cursor: pointer;
  text-align: left;
}
.acct-link:hover { text-decoration: underline; }
.acct-row-end { display: flex; justify-content: flex-end; margin-top: -4px; font-size: 13px; }
.acct-switch {
  margin: 22px 0 0;
  color: var(--ap-muted);
  font-size: 14px;
  text-align: center;
}

/* ---------- Profile card ---------- */
.acct-me {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--ap-line);
  border-radius: 12px;
  background: var(--ap-soft);
}
.acct-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ap-blue);
  color: #fff;
  font: 800 18px "Manrope", "DM Sans", sans-serif;
  letter-spacing: .5px;
}
.acct-me-text { min-width: 0; }
.acct-me-name {
  margin: 0;
  overflow: hidden;
  color: var(--ap-text);
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-me-email {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ap-muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-section-label {
  margin: 0 0 12px;
  color: var(--ap-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.acct-actions { display: grid; gap: 10px; margin-top: 8px; }

/* ---------- Status + footnote ---------- */
.acct-status {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--ap-ok);
  font-size: 13px;
  line-height: 1.55;
}
.acct-status.is-error { color: var(--ap-err); }
.acct-note {
  margin: 0;
  padding: 16px 26px 22px;
  border-top: 1px solid var(--ap-line);
  color: var(--ap-muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 480px) {
  .acct-head { padding: 18px 18px 14px; }
  .acct-body { padding: 20px 18px 24px; }
  .acct-note { padding: 14px 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .acct-panel, .acct-overlay, .account-dot { transition: none; }
}

@media (max-width: 768px) {
  html[data-theme="dark"] .main-navigation .account-link { border-bottom-color: #26364d; color: #e5edf8; }
}

/* =========================================================
   CHECKOUT GATE — cart note, panel notice, continue box
========================================================= */
.cart-checkout-gate {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid #cfe0fb;
  border-radius: 10px;
  background: #eef4ff;
  color: #3b4f6f;
  font-size: 13px;
  line-height: 1.55;
}
.cart-checkout-gate[hidden] { display: none; }
.cart-checkout-gate svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: #1264e8;
}
.cart-gate-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1264e8;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
html[data-theme="dark"] .cart-checkout-gate {
  background: #14233a;
  border-color: #2b3b52;
  color: #b7c6da;
}
html[data-theme="dark"] .cart-checkout-gate svg,
html[data-theme="dark"] .cart-gate-link { color: #8db8ff; }

.acct-notice {
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid #cfe0fb;
  border-radius: 10px;
  background: #eef4ff;
  color: #1c3a6e;
  font-size: 13.5px;
  line-height: 1.6;
}
.acct-notice[hidden] { display: none; }
html[data-theme="dark"] .acct-notice {
  background: #14233a;
  border-color: #2f4a73;
  color: #cfe0fb;
}

.acct-continue-box {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #b9e3c8;
  border-radius: 12px;
  background: #effaf3;
}
.acct-continue-box[hidden] { display: none; }
.acct-continue-box p {
  margin: 0 0 12px;
  color: #14532d;
  font-size: 14px;
  font-weight: 600;
}
html[data-theme="dark"] .acct-continue-box {
  background: #10301f;
  border-color: #1e5a38;
}
html[data-theme="dark"] .acct-continue-box p { color: #9be7b8; }
