/* ==========================================================================
   WebDreamers Admin — button system ("keycaps")
   Additive layer loaded AFTER admin.css. Same key language as the public
   site (css/buttons.css): a face, a small lip, and it presses down on click.
   Colours come from the admin palette (--theme-*), so Store settings still
   re-themes everything. No markup, script or feature is removed.
   ========================================================================== */

:root{
  --k-r:11px;
  --k-lip:3px;
  --k-primary:var(--theme-primary,#1558a6);
  --k-primary-lip:color-mix(in srgb,var(--k-primary) 62%,#000);
  --k-surface:var(--theme-background,#fff);
  --k-ink:var(--theme-text,#11243a);
  --k-edge:color-mix(in srgb,var(--k-ink) 18%,var(--k-surface));
  --k-lip-neutral:color-mix(in srgb,var(--k-ink) 24%,var(--k-surface));
  --k-ring:color-mix(in srgb,var(--k-primary) 55%,#fff);
  --k-danger:#b42323;
  --k-danger-bg:#fff1f1;
  --k-danger-edge:#efc3c3;
  --k-danger-lip:#dba4a4;
}

/* shared geometry ---------------------------------------------------------- */
html body :is(.primary,.profile-submit,.actionbtn,.ghost,.quicklink,.dialogclose,.spec-presets button,.photo-remove,.admin-menu-btn,.nav-signout){
  box-sizing:border-box;
  border-style:solid!important;border-width:1.5px!important;
  border-radius:var(--k-r)!important;
  font-weight:700;letter-spacing:.005em;line-height:1.2;
  cursor:pointer;-webkit-tap-highlight-color:transparent;user-select:none;
  transition:transform .09s ease,box-shadow .09s ease,background-color .2s ease,border-color .2s ease;
}
html body :is(.primary,.profile-submit,.actionbtn,.ghost,.quicklink,.dialogclose,.spec-presets button,.photo-remove,.admin-menu-btn,.nav-signout,.navitem):focus-visible{
  outline:3px solid var(--k-ring);outline-offset:3px;
}

/* primary keys: Sign in, Add product, Save …, Refresh --------------------- */
html body :is(.primary,.profile-submit,.actionbtn:not(.danger)){
  background:var(--k-primary)!important;background-image:none!important;
  border-color:var(--k-primary-lip)!important;
  box-shadow:0 var(--k-lip) 0 var(--k-primary-lip)!important;
  color:#fff;
}
html body :is(.primary,.profile-submit){
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:46px;padding:0 20px;font-size:14px;
}
html body .primary.full{display:flex;width:100%;min-height:50px}
@media(hover:hover){
  html body :is(.primary,.profile-submit,.actionbtn:not(.danger)):hover{
    transform:translateY(-1px);box-shadow:0 calc(var(--k-lip) + 1px) 0 var(--k-primary-lip)!important;
  }
}
html body :is(.primary,.profile-submit,.actionbtn:not(.danger)):active{
  transform:translateY(var(--k-lip));box-shadow:0 0 0 var(--k-primary-lip)!important;
}

/* secondary keys: Cancel, Manage products, Store settings, close ---------- */
html body :is(.ghost:not(.sidebottom .ghost),.quicklink,.dialogclose){
  background:var(--k-surface)!important;background-image:none!important;
  border-color:var(--k-edge)!important;
  box-shadow:0 var(--k-lip) 0 var(--k-lip-neutral)!important;
  color:var(--k-ink)!important;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:46px;padding:0 18px;font-size:14px;
}
@media(hover:hover){
  html body :is(.ghost:not(.sidebottom .ghost),.quicklink,.dialogclose):hover{
    transform:translateY(-1px);
    border-color:color-mix(in srgb,var(--k-primary) 55%,var(--k-edge))!important;
    box-shadow:0 calc(var(--k-lip) + 1px) 0 var(--k-lip-neutral)!important;
  }
}
html body :is(.ghost:not(.sidebottom .ghost),.quicklink,.dialogclose):active{
  transform:translateY(var(--k-lip));box-shadow:0 0 0 var(--k-lip-neutral)!important;
}

/* dialog close: top-right key that matches the others */
html body .dialogclose{
  width:42px;height:42px;min-height:0;padding:0;right:16px;top:16px;
  font-size:26px;line-height:1;z-index:5;
}

/* small action keys (Refresh, Clear logs, Preview, row actions) ----------- */
html body .actionbtn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  min-height:38px;padding:0 14px;font-size:12px;
  --k-lip:2px;
}
html body .actionbtn.danger{
  background:var(--k-danger-bg)!important;background-image:none!important;
  border-color:var(--k-danger-edge)!important;color:var(--k-danger)!important;
  box-shadow:0 var(--k-lip) 0 var(--k-danger-lip)!important;
}
@media(hover:hover){html body .actionbtn.danger:hover{filter:none;transform:translateY(-1px)}}
html body .actionbtn.danger:active{transform:translateY(var(--k-lip));box-shadow:0 0 0 var(--k-danger-lip)!important}

/* quick-pick chips (₱ presets, charger types …) --------------------------- */
html body .spec-presets{gap:8px;margin-top:8px}
html body .spec-presets button{
  background:var(--k-surface)!important;background-image:none!important;
  border-color:var(--k-edge)!important;color:var(--k-ink)!important;
  box-shadow:0 2px 0 var(--k-lip-neutral)!important;
  min-height:34px;padding:0 12px;font-size:12px;
}
html body .spec-presets button:hover,
html body .spec-presets button.selected{
  background:var(--k-primary)!important;border-color:var(--k-primary-lip)!important;color:#fff!important;
  box-shadow:0 2px 0 var(--k-primary-lip)!important;
}
html body .spec-presets button:active{transform:translateY(2px);box-shadow:0 0 0 transparent!important}

html body .photo-remove{
  background:var(--k-danger-bg)!important;border-color:var(--k-danger-edge)!important;color:var(--k-danger)!important;
  box-shadow:0 2px 0 var(--k-danger-lip)!important;min-height:32px;padding:0 10px;
}
html body .photo-remove:active{transform:translateY(2px);box-shadow:0 0 0 transparent!important}

/* sidebar: flat keys, the open page looks pressed in ---------------------- */
html body .navitem{border-radius:var(--k-r);min-height:44px;transition:background-color .2s ease,box-shadow .15s ease}
html body .navitem.active{box-shadow:inset 0 2px 5px rgba(0,0,0,.28)}
html body .navitem:hover:not(.active){transform:none}
html body .nav-signout{
  min-height:46px;box-shadow:0 var(--k-lip) 0 rgba(0,0,0,.35)!important;
}
html body .nav-signout:active{transform:translateY(var(--k-lip));box-shadow:0 0 0 rgba(0,0,0,.35)!important}
html body .sidebottom .ghost{
  min-height:44px;border-radius:var(--k-r)!important;
  box-shadow:0 2px 0 rgba(0,0,0,.35)!important;
}

/* mobile menu button -------------------------------------------------------- */
html body .admin-menu-btn{
  width:46px;height:46px;min-height:46px;padding:0;
  box-shadow:0 var(--k-lip) 0 rgba(0,0,0,.35)!important;
}
html body .admin-menu-btn:active{transform:translateY(var(--k-lip));box-shadow:0 0 0 rgba(0,0,0,.35)!important}

/* placement ----------------------------------------------------------------- */
/* panel headers: title on the left, action key on the right, never wrapping weirdly */
html body .panelhead{align-items:flex-start}
html body .panelhead>.primary,html body .panelhead>.activity-tools{flex:0 0 auto}
html body .activity-tools{gap:10px}
html body .quicklinks{gap:12px}
html body .settingsform>.primary{justify-self:start;min-width:220px;margin-top:6px}

/* the Cancel / Preview / Save row stays in view at the bottom of the long product form */
html body .dialogactions{
  position:sticky;bottom:-26px;z-index:4;
  margin:20px -26px -26px;padding:16px 26px 22px;
  background:linear-gradient(to top,var(--k-surface) 80%,transparent);
  gap:12px;align-items:center;
}
html body .dialogactions>*{min-height:46px}
html body .dialogactions .actionbtn{font-size:14px;padding:0 20px;--k-lip:3px}

@media(max-width:700px){
  html body .panelhead{flex-direction:column;align-items:stretch}
  html body .panelhead>.primary{width:100%}
  html body .activity-tools{width:100%}
  html body .activity-tools .actionbtn{flex:1 1 0}
  html body .settingsform>.primary{width:100%;justify-self:stretch}
  html body .quicklinks{grid-template-columns:1fr}
  html body .dialogactions{bottom:-18px;margin:16px -18px -18px;padding:14px 18px 18px;flex-wrap:wrap}
  html body .dialogactions>.primary{flex:1 1 100%;order:-1}
  html body .dialogactions>:not(.primary){flex:1 1 0}
}

@media(prefers-reduced-motion:reduce){
  html body :is(.primary,.profile-submit,.actionbtn,.ghost,.quicklink,.dialogclose,.spec-presets button,.photo-remove,.admin-menu-btn,.nav-signout):is(:hover,:active){transform:none!important}
}
