/* wearfits.me — the app bar (index.html .appbar, app-header.js), loaded after styles.css and layout.css.
   Phones: logo, a paste-link icon and the counter on top; Discover, My try-ons and Account as bottom tabs (styles.css).
   From 900 px one black bar: logo, the link field, the two tabs (the current one in a white box), then Extension, the
   counter and the account menu; a guest gets How it works, Pricing and Sign in instead of the menu. */

/* who sees what: #shell[data-member] is a signed-in visitor */
#shell[data-member] .guest-only, #shell:not([data-member]) .member-only { display: none !important; }
.head-link, .ext-btn, .acct-menu, .nav-account { display: none; }
.tabbar .tab-phone { display: flex; }

/* counter: a teal pill; a count reads "2 try-ons left", the offer and Top up are one label */
.credits {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 4px; border-radius: 999px;
  color: var(--ground); text-decoration: none; white-space: nowrap; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.credits[hidden] { display: none; }
.credits b { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--brand); color: var(--ink); font-size: 14px; font-weight: 700; }
.credits[data-offer], .credits[data-empty] { min-height: 40px; padding: 0 14px; border-radius: 0; background: var(--brand); color: var(--ink); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.credits[data-offer] b, .credits[data-empty] b { display: none; }
.appbar a.credits:hover { opacity: 0.85; }

@media (max-width: 899px) {
  .credits[data-offer], .credits[data-empty] { max-width: 132px; padding: 4px 10px; white-space: normal; text-align: center; line-height: 1.15; font-size: 12px; letter-spacing: 0.02em; }
}

/* phones: the paste-link icon opens Try on's field */
.phone-paste { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--ground); }

/* the link field's icon sits inside the white input */
.header-paste { display: none; }
.header-paste-ico { display: flex; align-items: center; padding-left: 12px; background: var(--white); color: var(--muted); }

@media (min-width: 900px) {
  .appbar { gap: var(--s4); padding-inline: 28px; } /* full width, aligned with Discover's columns */
  .wordmark { font-size: 30px; margin-right: var(--s3); }
  .phone-paste, .tabbar .tab-phone { display: none; }
  .head-link, .nav-account { display: inline-flex; align-items: center; height: 44px; white-space: nowrap; color: var(--ground); text-decoration: none; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
  /* a guest's bar is the site's: Discover, How it works, Pricing — no link field and no My try-ons */
  #shell:not([data-member]) .header-paste, #shell:not([data-member]) .tabbar [data-tab="mine"] { display: none; }
  #shell:not([data-member]) .tabbar { margin-left: auto; }
  #shell:not([data-member]) .appbar .row { margin-left: 0; }
  #shell:not([data-member]) .tabbar a[aria-current="page"] { background: none; color: var(--ground); }
  .appbar .row { gap: var(--s4); margin-left: auto; }

  .header-paste { display: flex; flex: 0 1 340px; min-width: 200px; }
  .header-paste .input { flex: 1 1 auto; min-width: 0; height: 40px; min-height: 40px; padding: 0 var(--s3) 0 var(--s2); border: 0; background: var(--white); color: var(--ink); font-size: 14px; letter-spacing: 0; text-transform: none; }
  .header-paste .btn { flex: none; height: 40px; min-height: 40px; padding: 0 var(--s3); border-color: var(--brand); background: var(--brand); color: var(--ink); white-space: nowrap; }
  .header-paste :focus-visible { outline-color: var(--brand); }

  /* the two tabs: plain labels, the current one in a white box */
  .tabbar {
    position: static; display: flex; align-items: center; gap: var(--s1); padding: 0; background: transparent; border-top: 0;
    font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  }
  .tab-ico { display: none; }
  .tabbar a { flex-direction: row; min-height: 40px; height: 40px; padding: 0 14px; white-space: nowrap; color: var(--ground); }
  .tabbar a[aria-current="page"], .tabbar a[aria-current="page"]:hover { background: var(--white); color: var(--ink); }
  .tabbar a:focus-visible { outline-color: var(--brand); outline-offset: 2px; }
  .tabbar a[data-count]::before { content: "(" attr(data-count) ")"; position: static; order: 1; min-width: 0; margin-left: 5px; padding: 0; background: none; color: inherit; font-size: inherit; font-weight: 800; line-height: inherit; }

  .ext-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 10px; border: 1px solid #6B6760; border-radius: 999px; color: var(--ground); text-decoration: none; white-space: nowrap; }
  .ext-btn[hidden] { display: none; }
  .ext-btn:hover { border-color: var(--ground); opacity: 1; }

  .acct-menu { display: block; position: relative; }
  .acct-btn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0; border: 0; background: none; color: var(--ground); cursor: pointer; }
  .acct-avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #3B3935; font-size: 14px; font-weight: 700; }
  .acct-btn[aria-expanded="true"] .acct-chev { transform: rotate(180deg); }
  .acct-panel {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 9; display: flex; flex-direction: column; min-width: 240px; padding: var(--s2);
    background: var(--white); color: var(--ink); border: var(--hair); border-radius: 12px;
    font-size: 15px; font-weight: 400; letter-spacing: 0; text-transform: none;
  }
  .acct-panel[hidden] { display: none; }
  .acct-panel > a, .acct-lang, .acct-out { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 40px; padding: 0 var(--s3); border-radius: 8px; color: var(--ink); text-decoration: none; }
  .acct-panel > a:hover, .acct-out:hover { background: var(--tone); opacity: 1; }
  .acct-lang .language-switch { font-weight: 600; }
  .acct-out { margin-top: var(--s1); border: 0; border-top: var(--hair); border-radius: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
}

@media (min-width: 900px) and (max-width: 1199px) {
  .appbar { gap: var(--s3); }
  .appbar .row { gap: var(--s3); }
  .header-paste { flex-basis: 220px; }
  .ext-btn span { display: none; } /* the icon alone keeps one bar at laptop widths */
  .ext-btn { padding: 0 10px; }
}
