/* ---------------------------------------------------------------- header: desktop top bar + phone bottom dock (loaded after main.css / shop.css) */
.site-header.hdr { position: sticky; top: 0; z-index: 50; height: auto !important; padding: 0.6rem 0.75rem 0; animation: none; }
.hdr__bar { position: relative; display: flex; align-items: center; gap: 0.75rem; width: min(100%, 78rem); margin-inline: auto; padding: 0.5rem 0.7rem 0.5rem 1rem; border: 1px solid var(--line); border-radius: 1.4rem; background: rgba(10, 14, 32, 0.62); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); }
.hdr__brand { margin-right: auto; min-width: 0; }
.hdr__brand .brand__name { overflow: hidden; text-overflow: ellipsis; }
.hdr__nav { display: none; }
.hdr__tools { display: flex; align-items: center; gap: 0.5rem; }
.hdr__flag, .hdr__icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, 0.04); color: var(--ink); text-decoration: none; font-size: 1.05rem; transition: background .2s, border-color .2s; }
.hdr__flag:hover, .hdr__icon:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); }
.hdr__flag svg { width: 1.65rem; height: 1.65rem; display: block; border-radius: 50%; }
.hdr__login { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; padding: 0 1.1rem; border-radius: 999px; background: #fff; color: #0a0f24; font-weight: 600; font-size: 0.95rem; text-decoration: none; white-space: nowrap; transition: transform .15s, filter .15s; }
.hdr__login:hover { transform: translateY(-1px); filter: brightness(0.95); }

/* dropdown pieces (desktop) */
.hdr__drop { position: relative; }
.hdr__panel { position: absolute; left: 0; top: calc(100% + 0.7rem); z-index: 60; display: grid; gap: 0.1rem; min-width: 14rem; padding: 0.45rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(8, 11, 26, 0.96); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.98); transform-origin: top left; transition: opacity .18s, transform .18s, visibility 0s .18s; }
.hdr__panel--right { left: auto; right: 0; transform-origin: top right; min-width: 17rem; }
.hdr__drop.is-open > .hdr__panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.hdr__panel a { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.8rem; border-radius: 10px; color: var(--ink-dim); text-decoration: none; font-size: 0.95rem; white-space: nowrap; }
.hdr__panel a:hover, .hdr__panel a:focus-visible { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.hdr__panel a > .fa-solid, .hdr__panel a > .fa-regular { width: 1.2em; text-align: center; opacity: 0.85; }
.hdr__caret { font-size: 0.65rem; opacity: 0.7; transition: transform .2s; }
.hdr__drop.is-open > button .hdr__caret { transform: rotate(180deg); }
.hdr__userbtn { display: inline-flex; align-items: center; gap: 0.6rem; max-width: 14rem; height: 2.5rem; padding: 0 0.8rem 0 0.25rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.04); color: var(--ink); font: inherit; font-size: 0.95rem; cursor: pointer; transition: background .2s, border-color .2s; }
.hdr__userbtn:hover, .hdr__user.is-open .hdr__userbtn { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.28); }
.hdr__avatar { position: relative; display: block; width: 2rem; height: 2rem; flex: none; }
.hdr__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.hdr__dot { position: absolute; top: -1px; right: -1px; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: #ff7a8a; border: 2px solid #0a0e20; }
.hdr__uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* account panel content (dropdown + profile sheet) */
.acct { gap: 0.3rem; }
.acct__who { display: flex; align-items: center; gap: 0.8rem; margin: 0; padding: 0.5rem 0.6rem 0.7rem; border-bottom: 1px solid var(--line); }
.acct__who > span:last-child { display: grid; min-width: 0; }
.acct__who strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct__who small { color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct__avatar { width: 2.5rem; height: 2.5rem; flex: none; }
.acct__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.hdr__panel .acct__wallet, .acct__wallet { display: flex; align-items: center; gap: 0.7rem; margin: 0.3rem 0 0.2rem; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(120deg, rgba(74, 168, 255, 0.16), rgba(10, 14, 32, 0.5)); color: var(--ink); text-decoration: none; }
.acct__wallet span { color: var(--ink-dim); } .acct__wallet strong { margin-left: auto; color: var(--accent); font-weight: 600; }
.acct__links { display: grid; gap: 0.1rem; }
.acct__logout { margin: 0.3rem 0 0; padding-top: 0.3rem; border-top: 1px solid var(--line); }
.acct__logout button { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.6rem 0.8rem; border: 0; border-radius: 10px; background: transparent; color: var(--ink-dim); font: inherit; font-size: 0.95rem; cursor: pointer; text-align: left; }
.acct__logout button:hover { background: rgba(255, 255, 255, 0.08); color: #ff9aa8; }

/* ---- phone: floating bottom dock + bottom sheets ---- */
.dock { position: fixed; left: 0.75rem; right: 0.75rem; bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)); z-index: 70; display: flex; align-items: center; gap: 0.15rem; max-width: 30rem; margin-inline: auto; padding: 0.4rem; border: 1px solid var(--line); border-radius: 1.8rem; background: rgba(8, 11, 24, 0.9); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55); }
.dock__item { position: relative; display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; min-width: 0; height: 3.4rem; padding: 0 0.3rem; border: 0; border-radius: 1.4rem; background: transparent; color: var(--ink-dim); font: inherit; text-decoration: none; cursor: pointer; transition: flex-grow .25s ease, background .25s, color .25s; -webkit-tap-highlight-color: transparent; }
.dock__item i.fa-solid, .dock__item i.fa-regular { font-size: 1.15rem; }
.dock__item span { font-size: 0.72rem; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock__item:active { transform: scale(0.95); }
.dock__item.is-active { flex-grow: 1.7; background: #fff; color: #0a0f24; font-weight: 600; }
.dock__dot { top: 0.55rem; left: calc(50% + 0.35rem); right: auto; }
.dock__item.is-active .dock__dot { border-color: #fff; }

.sheet { position: fixed; inset: 0; z-index: 90; }
.sheet[hidden] { display: none; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(2, 4, 12, 0.66); opacity: 0; transition: opacity .25s; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet__panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82dvh; overflow-y: auto; margin-inline: auto; max-width: 34rem; padding: 0.6rem 0.9rem calc(1.2rem + env(safe-area-inset-bottom, 0px)); border: 1px solid var(--line); border-bottom: 0; border-radius: 1.6rem 1.6rem 0 0; background: #0a0d18; transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .25, 1); overscroll-behavior: contain; }
.sheet.is-open .sheet__scrim { opacity: 1; }
.sheet.is-open .sheet__panel { transform: none; }
.sheet__grip { display: block; width: 2.6rem; height: 4px; margin: 0.1rem auto 0.8rem; border-radius: 4px; background: rgba(255, 255, 255, 0.25); }
.sheet__list, .sheet .acct__links { display: grid; gap: 0.2rem; }
.sheet__list a, .sheet .acct__links a { display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 0.9rem; border-radius: 14px; color: var(--ink); text-decoration: none; font-size: 1.02rem; }
.sheet__list a:active, .sheet .acct__links a:active, .sheet__list a:hover, .sheet .acct__links a:hover { background: rgba(255, 255, 255, 0.08); }
.sheet__list a > i:first-child, .sheet .acct__links a > i:first-child { width: 1.4em; text-align: center; color: var(--accent); }
.sheet__ext { margin-left: auto; font-size: 0.75rem; color: var(--ink-dim); }
.sheet .acct__logout button { padding: 0.85rem 0.9rem; font-size: 1.02rem; border-radius: 14px; }
.sheet .acct__wallet { margin-top: 0.5rem; }
.has-sheet, .has-sheet body { overflow: hidden; }

/* ---- layout switch ---- */
@media (max-width: 63.99rem) {
  .hdr__user, .hdr__nav { display: none; }
  body { padding-bottom: calc(5.8rem + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 64rem) {
  .site-header.hdr { padding: 0.75rem 1.25rem 0; }
  .hdr__bar { gap: 1.25rem; padding: 0.55rem 0.8rem 0.55rem 1.1rem; }
  .hdr__brand { margin-right: 0; }
  .hdr__nav { display: block; margin-right: auto; }
  .hdr__nav ul { display: flex; align-items: center; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
  .hdr__pill { display: inline-flex; align-items: center; gap: 0.45rem; height: 2.5rem; padding: 0 1.1rem; border: 0; border-radius: 999px; background: transparent; color: var(--ink-dim); font: inherit; font-size: 0.97rem; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .2s, color .2s; }
  .hdr__pill:hover, .hdr__drop.is-open > .hdr__pill { background: rgba(255, 255, 255, 0.09); color: var(--ink); }
  .hdr__pill[aria-current="page"] { background: #fff; color: #0a0f24; font-weight: 600; }
  .dock, .sheet { display: none !important; }
  .hdr__panel a { font-size: 0.97rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hdr__panel, .sheet__panel, .sheet__scrim, .dock__item { transition: none; }
}

/* language menu */
.hdr__langpanel { min-width: 12.5rem; }
.hdr__langitem { display: flex; align-items: center; gap: 0.8rem; width: 100%; padding: 0.7rem 0.9rem; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-size: 1.02rem; text-align: left; text-decoration: none; cursor: pointer; }
.hdr__langitem:hover, .hdr__langitem:focus-visible { background: rgba(255, 255, 255, 0.08); }
.hdr__langitem.is-current { background: rgba(74, 168, 255, 0.12); color: var(--accent); font-weight: 600; }
.hdr__langflag { display: grid; width: 1.7rem; height: 1.7rem; flex: none; }
.hdr__langflag svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.hdr__check { margin-left: auto; font-size: 0.85rem; }
.hdr__flag { cursor: pointer; padding: 0; font: inherit; }

/* language switch feedback */
.is-switching #main { opacity: 0.55; transition: opacity .15s; pointer-events: none; }
.is-switching::before { content: ""; position: fixed; top: 0; left: 0; z-index: 300; height: 3px; width: 35%; border-radius: 0 3px 3px 0; background: linear-gradient(90deg, transparent, var(--accent)); animation: swbar .9s ease-in-out infinite; }
@keyframes swbar { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .is-switching::before { animation: none; width: 100%; } }
.hdr__panel a.hdr__langitem { color: var(--ink); font-size: 1.02rem; }
.hdr__panel a.hdr__langitem:hover { color: var(--ink); }

/* "More" popover above the dock (phone) */
.dock__item[aria-expanded="true"] { flex-grow: 1.7; background: #fff; color: #0a0f24; font-weight: 600; }
.sheet--pop .sheet__scrim { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; opacity: 1; }
.sheet--pop .sheet__panel { left: 50%; right: auto; bottom: calc(5.7rem + env(safe-area-inset-bottom, 0px)); width: min(calc(100% - 3rem), 25rem); max-width: none; padding: 0.9rem; border: 1px solid var(--line); border-radius: 1.9rem; background: rgba(8, 11, 24, 0.97); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6); opacity: 0; transform: translate(-50%, 14px) scale(0.95); transform-origin: 50% 100%; transition: transform .24s cubic-bezier(.2, .9, .25, 1.1), opacity .2s; }
.sheet--pop.is-open .sheet__panel { opacity: 1; transform: translate(-50%, 0) scale(1); }
.pop__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.2rem; }
.pop__form { display: contents; }
.pop__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; min-height: 5.6rem; padding: 0.8rem 0.5rem; border: 0; border-radius: 1.2rem; background: transparent; color: var(--ink); font: inherit; font-size: 0.92rem; font-weight: 500; text-align: center; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .15s; }
.pop__item i { font-size: 1.6rem; color: var(--ink); opacity: 0.9; }
.pop__item span { line-height: 1.25; overflow-wrap: anywhere; }
.pop__item:hover, .pop__item:active { background: rgba(255, 255, 255, 0.08); }
.pop__item--danger, .pop__item--danger i { color: #ff7a8a; }
@media (prefers-reduced-motion: reduce) { .sheet--pop .sheet__panel { transition: none; } }
