/* =============================================================
   KASDAP ONE — APP SHELL  (topbar · modeswitch · nav · mobile)
============================================================= */

.app { min-height: 100vh; padding-top: var(--topbar); }

/* ---------- topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar); z-index: 300;
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: var(--glass); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; position: relative;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(var(--accent-rgb),.4); transition: background .4s, box-shadow .4s;
}
.brand-mark svg { color: var(--on-accent); }
.brand-txt { line-height: 1; }
.brand-name { font-family: var(--ff-display); font-size: 1.12rem; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.brand-name b { color: var(--accent); transition: color .4s; }
.brand-sub { font-family: var(--ff-mono); font-size: .54rem; letter-spacing: .22em; text-transform: uppercase; color: var(--text-3); margin-top: 2px; }

.topnav { display: flex; gap: 3px; margin-left: 10px; }
.topnav button {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--r-pill);
  font-size: .8rem; font-weight: 600; color: var(--text-2); border: 1px solid transparent; transition: all .18s;
}
.topnav button:hover { color: var(--text); background: var(--surface-2); }
.topnav button.on { color: var(--accent); background: var(--accent-soft); border-color: rgba(var(--accent-rgb),.22); }
.topnav button svg { width: 16px; height: 16px; }

.topbar-r { margin-left: auto; display: flex; align-items: center; gap: 9px; }

/* ---------- MODE SWITCH — the hero control ---------- */
.modeswitch {
  display: inline-flex; align-items: center; gap: 3px; position: relative;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 4px;
}
.modeswitch .ms-thumb {
  position: absolute; top: 4px; bottom: 4px; width: calc(50% - 4px); border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 4px 14px rgba(var(--accent-rgb),.4);
  transition: transform .34s cubic-bezier(.5,1.4,.5,1), background .4s; z-index: 0;
}
.modeswitch[data-at="b2b"] .ms-thumb { transform: translateX(100%); }
.modeswitch button {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border-radius: var(--r-pill); font-size: .78rem; font-weight: 700; letter-spacing: -.01em;
  color: var(--text-2); transition: color .25s; white-space: nowrap;
}
.modeswitch button svg { width: 15px; height: 15px; }
.modeswitch button.on { color: var(--on-accent); }

.avatar {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; cursor: pointer;
  background: linear-gradient(140deg, var(--surface-hi), var(--surface-3)); border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center; font-family: var(--ff-mono); font-size: .72rem; font-weight: 700; color: var(--text);
  transition: border-color .18s; position: relative;
}
.avatar:hover { border-color: var(--accent); }
.cart-btn { position: relative; }
.cart-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: var(--on-accent); font-family: var(--ff-mono); font-size: .6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); transition: background .4s;
}
.notif-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--rose); border: 2px solid var(--surface-2); }

/* dropdown menu */
.menu-pop {
  position: absolute; top: calc(var(--topbar) - 6px); right: 18px; z-index: 320; width: 268px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r18); box-shadow: var(--shadow-3);
  padding: 8px; animation: ksFadeUp .18s ease;
}
.menu-head { padding: 12px 12px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head .nm { font-weight: 700; font-size: .92rem; }
.menu-head .rl { font-size: .72rem; color: var(--text-2); margin-top: 2px; }
.menu-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r10); font-size: .84rem; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all .15s; width: 100%; text-align: left; }
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ---------- mobile bottom nav ---------- */
.botnav { display: none; }
.hamburger { display: none; }

@media (max-width: 1080px) {
  .topnav { display: none; }
  .brand-sub { display: none; }
}
@media (max-width: 720px) {
  :root { --topbar: 56px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-txt { display: none; }
  .modeswitch button span.lbl { display: none; }
  .modeswitch button { padding: 8px 12px; }
  .hide-mobile { display: none !important; }

  .botnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottomnav); z-index: 300;
    background: var(--glass); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .botnav-in { display: flex; width: 100%; align-items: center; justify-content: space-around; }
  .botnav button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 12px; flex: 1; color: var(--text-3); font-size: .58rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
  .botnav button svg { width: 21px; height: 21px; }
  .botnav button.on { color: var(--accent); }
  .app { padding-bottom: calc(var(--bottomnav) + 8px); }
  .menu-pop { right: 12px; left: 12px; width: auto; }
}
