/* Logged-in submenu (gift-order/account-nav.blade.php), 1.5.
   Name with the role menu, the account pages, then Logi välja apart at the end. Self-contained:
   works with or without gift-order.css. */
.kk-acct {
  --kk-acct-ink: #0d0d0d;
  --kk-acct-muted: #666666;
  --kk-acct-line: #e6e1da;
  --kk-acct-pill: #fdeee0;
  --kk-acct-hover: #f6f3ef;
  --kk-acct-bg: #ffffff;
  --kk-acct-orange: #f56b00;
  --kk-acct-orange-hover: #e05f00;
  --kk-acct-ease: cubic-bezier(0.2, 0.8, 0, 1);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: calc(100% - 32px);
  /* right under the site nav: the layout's --nav-offset already leaves the 16px gap */
  margin: 0 auto;
  padding: 6px;
  border-radius: 999px;
  background: var(--kk-acct-bg);
  color: var(--kk-acct-ink);
  font-family: "Roboto Condensed", "Roboto", Arial, sans-serif;
}
.kk-acct *, .kk-acct *::before, .kk-acct *::after { box-sizing: border-box; }

/* name: a label that opens the role menu */
.kk-acct__role { position: relative; }
.kk-acct__name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px 0 18px;
  border-radius: 999px;
  font-family: "Inter", "Roboto", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
}
summary.kk-acct__name { cursor: pointer; list-style: none; transition: background-color 150ms ease; }
summary.kk-acct__name::-webkit-details-marker { display: none; }
@media (hover: hover) { summary.kk-acct__name:hover { background: var(--kk-acct-hover); } }
.kk-acct__role[open] > summary.kk-acct__name { background: var(--kk-acct-hover); }
.kk-acct__name-text { overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.kk-acct__chev { flex: none; color: var(--kk-acct-muted); transition: transform 400ms var(--kk-acct-ease); }
.kk-acct__role[open] .kk-acct__chev { transform: rotate(180deg); }

.kk-acct__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  padding: 8px;
  border-radius: 20px;
  background: var(--kk-acct-bg);
  box-shadow: 0 12px 32px rgba(13, 13, 13, 0.12), 0 0 0 1px rgba(13, 13, 13, 0.04);
  transform-origin: top left;
  animation: kk-acct-in 400ms var(--kk-acct-ease);
}
@keyframes kk-acct-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.kk-acct__menu-label {
  margin: 6px 12px 6px;
  color: var(--kk-acct-muted);
  font-family: "Inter", "Roboto", Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.kk-acct__menu form { margin: 0; }
.kk-acct__option {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--kk-acct-ink);
  font: 500 15px/20px "Inter", "Roboto", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease;
}
@media (hover: hover) { .kk-acct__option:not(:disabled):hover { background: var(--kk-acct-hover); } }
.kk-acct__option.is-active { cursor: default; font-weight: 600; }
.kk-acct__option.is-active svg { color: var(--kk-acct-orange); flex: none; }

.kk-acct__divider { flex: none; width: 1px; height: 24px; margin: 0 6px; background: var(--kk-acct-line); }

/* the account pages */
.kk-acct__links { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.kk-acct__link,
.kk-acct__logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--kk-acct-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease;
}
@media (hover: hover) { .kk-acct__link:hover { background: var(--kk-acct-hover); } }
.kk-acct__link.is-active { background: var(--kk-acct-pill); }

/* buy: the one orange action in the bar */
.kk-acct__buy {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: 12px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--kk-acct-orange);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms ease;
}
@media (hover: hover) { .kk-acct__buy:hover { background: var(--kk-acct-orange-hover); } }

/* log out: apart at the end, quieter */
.kk-acct__logout { margin-left: 18px; color: var(--kk-acct-muted); font-weight: 600; }
@media (hover: hover) { .kk-acct__logout:hover { color: var(--kk-acct-ink); background: var(--kk-acct-hover); } }

.kk-acct :is(summary, a, button):focus-visible { outline: 2px solid var(--kk-acct-ink) !important; outline-offset: 2px; }

/* phones: name and log out on the first row, the pages below it as a row that scrolls sideways */
@media (max-width: 809px) {
  .kk-acct {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: calc(100% - 32px);
    margin-top: 8px; /* the phone nav's offset leaves less room under it */
    border-radius: 24px;
    row-gap: 4px;
  }
  .kk-acct__divider { display: none; }
  .kk-acct__role, .kk-acct > .kk-acct__name { grid-column: 1; grid-row: 1; min-width: 0; }
  .kk-acct__name { max-width: 100%; padding: 0 10px 0 14px; }
  .kk-acct__name-text { min-width: 0; max-width: 100%; }
  .kk-acct__logout { grid-column: 2; grid-row: 1; margin-left: 0; padding: 0 14px; }
  .kk-acct__links {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    scrollbar-width: none;
    padding-top: 4px;
    border-top: 1px solid var(--kk-acct-line);
  }
  .kk-acct__links::-webkit-scrollbar { display: none; }
  .kk-acct__link { padding: 0 14px; font-size: 15px; }
  .kk-acct__buy { grid-column: 1 / -1; grid-row: 3; justify-content: center; margin: 4px 0 0; font-size: 15px; }
  .kk-acct__menu { min-width: min(300px, calc(100vw - 48px)); }
}
@media (prefers-reduced-motion: reduce) {
  .kk-acct__menu { animation: none; }
  .kk-acct__chev { transition: none; }
}
