/* TopMatic B2B Header (minimal scoped CSS; allowed global because used next to menu)
   Brand system: white background, black text, red accents. */
:root{
  --tm-red:#d10b1f;      /* TopMatic red */
  --tm-red-dark:#a30816;
  --tm-text:#111;
  --tm-border:rgba(0,0,0,.14);
  --tm-shadow:0 18px 80px rgba(0,0,0,.22);
}

/* Header wrapper (enterprise polish) */
.tm-b2b-headerbar{
  display:block;
  background:rgba(255,255,255,.82);
  backdrop-filter:saturate(180%) blur(12px);
  -webkit-backdrop-filter:saturate(180%) blur(12px);
  border:1px solid rgba(209,11,31,.12);
  border-radius:18px;
  padding:12px 14px;
  box-shadow:0 14px 42px rgba(17,24,39,.10);
}

.tm-b2b-headerbar__inner{
  justify-content:flex-end;
}

/* compatibility: old + new header wrapper */
.tm-b2b-header,
.tm-b2b-headerbar__inner{display:flex;align-items:center;gap:14px;justify-content:flex-end;flex-wrap:wrap}

.tm-b2b-header__search,
.tm-b2b-headerbar__search{position:relative;max-width:520px;flex:1;min-width:220px}

.tm-b2b-header__search input,
.tm-b2b-headerbar__search input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(209,11,31,.55);
  outline:none;
  background:#fff;
  color:var(--tm-red);
  box-shadow:0 8px 30px rgba(209,11,31,.08);
}
.tm-b2b-header__search input::placeholder,
.tm-b2b-headerbar__search input::placeholder{color:rgba(209,11,31,.65)}
.tm-b2b-header__search input:focus,
.tm-b2b-headerbar__search input:focus{border-color:var(--tm-red);box-shadow:0 0 0 4px rgba(209,11,31,.10)}
.tm-b2b-header__suggest{position:absolute;left:0;right:0;top:calc(100% + 6px);background:#fff;border:1px solid rgba(209,11,31,.22);border-radius:12px;box-shadow:0 18px 60px rgba(0,0,0,.12);z-index:9999;max-height:260px;overflow:auto;display:none}
.tm-b2b-header__suggest button{width:100%;text-align:left;padding:10px 12px;border:0;background:transparent;cursor:pointer}
.tm-b2b-header__suggest button:hover{background:rgba(0,0,0,.04)}
.tm-b2b-header__actions{display:flex;align-items:center;gap:10px}
.tm-b2b-iconbtn{position:relative;width:40px;height:40px;border-radius:12px;border:1px solid rgba(209,11,31,.25);background:#fff;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;color:var(--tm-red)}
.tm-b2b-iconbtn:hover{background:rgba(209,11,31,.04);border-color:rgba(209,11,31,.45)}
.tm-b2b-iconbtn:focus{outline:none;box-shadow:0 0 0 4px rgba(209,11,31,.10)}
.tm-b2b-badge{position:absolute;top:-6px;right:-6px;background:var(--tm-red);color:#fff;border-radius:999px;font-size:11px;line-height:1;padding:5px 7px;border:2px solid #fff}
.tm-b2b-badge.is-zero{display:none}

.tm-b2b-icon{display:inline-flex;align-items:center;justify-content:center}
.tm-b2b-icon svg{width:18px;height:18px;display:block}

/* Modal */
.tm-b2b-modal{position:fixed;inset:0;z-index:99999}
.tm-b2b-modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.45)}
.tm-b2b-modal__panel{position:relative;max-width:560px;margin:8vh auto;background:#fff;border-radius:18px;overflow:hidden;box-shadow:var(--tm-shadow);border:1px solid rgba(209,11,31,.14)}
.tm-b2b-modal__header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid rgba(0,0,0,.1)}
.tm-b2b-modal__header{background:linear-gradient(90deg, rgba(209,11,31,.10), rgba(209,11,31,0));}
.tm-b2b-modal__title{font-weight:900;letter-spacing:.01em;color:var(--tm-text)}
.tm-b2b-modal__body{padding:16px}
.tm-b2b-field{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
.tm-b2b-field input,.tm-b2b-field select,.tm-b2b-field textarea{padding:10px 12px;border-radius:10px;border:1px solid rgba(0,0,0,.14)}
.tm-b2b-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.tm-b2b-btn{padding:10px 12px;border-radius:12px;border:1px solid var(--tm-border);background:#fff;cursor:pointer;color:var(--tm-text);font-weight:700}
.tm-b2b-btn--primary{background:var(--tm-red);color:#fff;border-color:var(--tm-red)}
.tm-b2b-btn--primary:hover{background:var(--tm-red-dark);border-color:var(--tm-red-dark)}
.tm-b2b-btn--ghost{background:transparent}
.tm-b2b-btn--ghost:hover{background:rgba(209,11,31,.06);border-color:rgba(209,11,31,.25)}
.tm-b2b-small{font-size:12px;opacity:.75}
.tm-b2b-msg{font-size:13px;margin-left:6px}

/* Logged-in card */
.tm-b2b-modal__row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.tm-b2b-modal__section{padding:12px;border:1px solid rgba(0,0,0,.08);border-radius:14px;background:rgba(0,0,0,.02)}
.tm-b2b-strong{font-weight:900;color:var(--tm-text)}

/* Auth tabs (modal) */
.tm-b2b-auth-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px}
.tm-b2b-auth-tab{padding:9px 12px;border-radius:12px;border:1px solid rgba(0,0,0,.14);background:#fff;cursor:pointer;font-weight:800;font-size:12px;letter-spacing:.02em;color:#111;text-transform:uppercase}
.tm-b2b-auth-tab:hover{background:rgba(0,0,0,.02)}
.tm-b2b-auth-tab.is-active{background:var(--tm-red);border-color:var(--tm-red);color:#fff}
.tm-b2b-auth-panel{padding:10px 0}
