/* khabao: small, consistent corner radius for every button and input */
:root{--r-ctl:8px}
button:not(.sw):not([role=switch]):not(.tab):not([role=tab]):not(.stp):not(.addb),
input:not([type=checkbox]):not([type=radio]):not([type=range]),
select,textarea,
a.btn,a.btn-o,a.pbtn,a.cartb,
.btn,.btn-o,.pbtn,.pxbtn,.dbtn,.chipf,.opt,.srch,.fld,.cartb,.lnk,
.lang summary,.addr,.ddi,.lm-b,.lm-f input,.lm-x,.kmn a,.kmn button{border-radius:var(--r-ctl)!important}
.srch input,.srch:focus-within input{border-radius:0!important}
.dd,.lang ul{border-radius:12px!important}
/* underline tabs stay square so the bottom border is straight */
.tab,[role=tab]{border-radius:0!important}
/* round qty stepper buttons stay circular inside their pill */
.stp,.addb{border-radius:999px!important}

/* ---- layout: desktop sticky header, mobile tweaks ---- */
section[data-cat]{scroll-margin-top:140px}
@media(min-width:768px){
 header{position:sticky;top:0;z-index:50}
 div.sticky.top-0.z-30{top:64px}
 aside.sticky[style*="top:76px"]{top:140px!important}
}
@media(max-width:767px){
 #authIn .ddwrap:has(#userMenu){display:none}
}
@media(max-width:639px){
 .pbtn{white-space:normal!important;flex:1;min-width:0;max-width:240px;font-size:11px!important;line-height:1.25;padding:.5rem .6rem!important}
}
.mo .p{padding-bottom:calc(20px + env(safe-area-inset-bottom,0px))}
/* very small phones (320px) */
[class*="flex-1"],.truncate{min-width:0}
@media(max-width:339px){
 header [class*="px-4"],header .wrap{padding-left:10px!important;padding-right:10px!important}
 header .row1{gap:4px}
 .lang ul{right:-6px}
}

/* ---- fixed header (shrinks on scroll), no floating cart bar ---- */
header{position:sticky;top:0;z-index:50}
div.sticky.top-0.z-30{top:var(--khh,64px)}
aside.sticky[style*="top:76px"]{top:calc(var(--khh,64px) + 76px)!important}
#cbar{display:none!important}
@media(max-width:767px){
 html.kh-sm header div[class*="h-16"],html.kh-sm header .row1{height:48px!important;min-height:0!important;padding-top:0!important;padding-bottom:0!important}
 html.kh-sm header .logo-svg,html.kh-sm header a[aria-label="khabao home"] svg{height:20px!important;width:auto!important}
 html.kh-sm header .row2,html.kh-sm header nav,html.kh-sm header .order-last{display:none!important}
}
@media(max-width:767px){html.kh-sm header div:has(>nav),html.kh-sm header form[role="search"]{display:none!important}}
