/* @tp-css-owner: public-ui
 * @tp-css-surface: public
 * @tp-css-scope: public shared components and catalog composition
 * @tp-css-status: core-active */
:root{
  --public-brand:#2348c7;
  --public-brand-dark:#083a7a;
  --public-bg:#f4f5fc;
  --public-surface:#ffffff;
  --public-border:#dce3f3;
  --public-muted:#6b7280;
  --public-text:#202430;
  --public-danger:#d72626;
  --public-radius-sm:10px;
  --public-radius-md:14px;
  --public-radius-lg:18px;
  --public-shadow:0 10px 30px rgba(12,29,75,.05);
}
*{box-sizing:border-box}
body{
  background:var(--public-bg);
  margin:0;
  font-family:'Be Vietnam Pro',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  color:var(--public-text);
}
a{color:inherit}

:is(.card,.sg-cat-card,.kv-box,.filter,.product-card,.cart-card,.desc-box,.public-product-code-empty){background:var(--public-surface);border:1px solid #e8ecf6;border-radius:24px;box-shadow:var(--public-shadow);}
:where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),select,textarea){border:1px solid var(--public-border);border-radius:16px;min-height:44px;padding:10px 14px;box-shadow:none;font:inherit;font-size:16px;}
:where(input,select,textarea):focus{outline:none;border-color:#c7d2fe;box-shadow:0 0 0 3px rgba(35,72,199,.10);}
:where(button,.btn-back){font-weight:600;border-radius:999px;}
.topbar,.top{
  background:var(--public-brand);
  color:#fff;
  padding:12px 16px;
  display:flex;
  align-items:center;
  gap:10px;
  min-height:52px;
  box-shadow:0 8px 20px rgba(35,72,199,.15);
}
.topbar h1,.top h1,.public-top-title{
  font-size:1rem;
  line-height:1.25;
  margin:0;
  flex:1;
  font-weight:650;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.public-top-link,.topbar a,.top a{
  color:#fff;
  text-decoration:none;
  font-size:.86rem;
  font-weight:500;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:4px 8px;
  border-radius:999px;
}
.public-top-link:hover,.topbar a:hover,.top a:hover{background:rgba(255,255,255,.12)}
.container,.wrap{max-width:1240px;margin:0 auto;padding:14px;width:100%}
.public-section-title{font-size:1.1rem;font-weight:650;margin:10px 0 12px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.card,
.sg-cat-card{

  padding:14px;
  text-decoration:none;
  color:var(--public-text);
  
  display:block;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover,
.sg-cat-card:hover{
  transform:translateY(-1px);
  border-color:rgba(12,76,163,.24);
  box-shadow:0 10px 24px rgba(15,23,42,.10);
}
.card .t,
.sg-cat-card .t{font-weight:600;margin-bottom:3px}
.card .s,
.sg-cat-card .s{font-size:.78rem;color:#7a828c}
.kv-box{display:flex;gap:8px;padding:8px 8px 8px 12px;align-items:center;margin-top:16px}
.kv-box input{flex:1;min-width:0;}
.kv-box button,.public-btn,.filter button,.btn-back,.btn-add{
  background:var(--public-brand);
  color:#fff;
  border:none;
  border-radius:999px;
  padding:8px 16px;
  min-height:44px;
  font-family:inherit;
  font-size:16px;
  line-height:1.4;
  font-weight:500;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}
.kv-box button:hover,.public-btn:hover,.filter button:hover,.btn-back:hover,.btn-add:hover{background:var(--public-brand-dark)}
:is(.kv-box button,.public-btn,.filter button,.btn-back,.btn-add):focus-visible{outline:2px solid var(--public-brand);outline-offset:3px}
:is(.kv-box button,.public-btn,.filter button,.btn-back,.btn-add):is(:disabled,[aria-disabled="true"]){opacity:.5;cursor:not-allowed}
:is(.kv-box button,.public-btn,.filter button,.btn-back,.btn-add)[aria-busy="true"]{cursor:progress}
.filter{

  padding:12px;
  display:grid;
  gap:10px;
  margin-bottom:16px;
  
}
.filter-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.filter-row.filter-row-compact{grid-template-columns:repeat(5,minmax(0,1fr));align-items:end}
.filter label{font-size:.74rem;color:#475569;margin-bottom:4px;display:block;font-weight:550}
.filter select,.filter input{width:100%;}
.w-2,.mini,.mini-kv{min-width:0}
.filter-actions{display:flex;align-items:end}
.product-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
.product-card{

  overflow:hidden;
  text-decoration:none;
  color:var(--public-text);
  
  transition:transform .16s ease, box-shadow .16s ease;
}
.product-card:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(15,23,42,.08)}
.thumb{background:#dce0e5;object-fit:cover;flex:0 0 auto}
.product-card .thumb{width:100%;aspect-ratio:1/1;display:block}
.name{padding:8px 10px 3px;font-weight:550;font-size:.86rem;min-height:42px;line-height:1.35}
.price{padding:0 10px 10px;color:var(--public-danger);font-weight:650;font-size:.84rem}
.public-empty{color:var(--public-muted);font-size:.9rem;margin:12px 0}
.cart-card{overflow:hidden;padding:8px 0;}
.cart-item{display:flex;gap:10px;padding:10px 14px;border-bottom:1px solid #edf0f3;align-items:flex-start}
.cart-item .thumb{width:58px;height:58px;border-radius:10px;background:#e5e7eb}
.item-main{flex:1;min-width:0}
.item-name{font-size:.86rem;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.item-variant{font-size:.72rem;color:var(--public-muted);margin-top:2px}
.item-bottom{display:flex;justify-content:space-between;align-items:center;margin-top:8px;gap:10px}
.qty-box{display:flex;align-items:center;gap:6px}
.qty-btn{width:28px;height:28px;border:1px solid #d1d5db;border-radius:8px;background:#fff;cursor:pointer;line-height:22px;text-align:center;font-size:1rem}
.qty-num{min-width:28px;text-align:center;font-weight:550}
.btn-del{background:#fee2e2;color:#b91c1c;border:none;border-radius:999px;padding:6px 10px;font-size:.74rem;cursor:pointer;white-space:nowrap;font-weight:550}
.bottom-bar{display:flex;justify-content:space-between;align-items:center;padding:12px 4px 10px;gap:12px;flex-wrap:wrap}
.total-text{font-weight:650}
.muted{color:var(--public-muted);font-size:.84rem;padding:10px 14px}
.public-hidden{display:none!important}
.img-box{position:relative;aspect-ratio:1/1;width:100%;overflow:hidden;border-radius:18px;background:#d1d5db;box-shadow:var(--public-shadow)}
.main-img{width:100%;height:100%;max-height:none;border-radius:18px;object-fit:cover;background:#d1d5db;display:block}
.counter{position:absolute;right:10px;bottom:10px;background:rgba(0,0,0,.5);color:#fff;padding:3px 8px;border-radius:999px;font-size:.72rem}
.thumbs-wrapper{margin-top:10px;overflow-x:auto;padding-bottom:4px;-webkit-overflow-scrolling:touch}
.thumbs{display:flex;gap:8px}
.thumbs img{width:70px;height:70px;object-fit:cover;border-radius:16px;opacity:.45;cursor:pointer;border:2px solid transparent;transition:.2s;flex:0 0 auto;background:#dce0e5}
.thumbs img.active{opacity:1;border-color:var(--public-brand)}
.stock{margin-top:6px;color:#374151;font-size:.9rem}.stock.out{color:#b91c1c;font-weight:650}
.option-group{margin-top:14px}.option-group h3{margin:0 0 6px;font-size:.86rem;font-weight:600}
.option-values{display:flex;flex-wrap:wrap;gap:6px}.opt{padding:6px 11px;border-radius:999px;border:1px solid #d1d5db;cursor:pointer;background:#fff;font-size:.9rem}.opt.active{background:var(--public-brand);color:#fff;border-color:var(--public-brand)}.opt.oos{opacity:.45;filter:grayscale(1)}
.btn-add{margin-top:14px;padding:10px 22px}.btn-add:disabled{opacity:.5;cursor:not-allowed}
.desc-box{margin-top:16px;padding:14px;}.desc-title{font-weight:600;margin-bottom:6px}
.product-rich-description img{display:block;max-width:100%;height:auto;margin:12px auto;border-radius:10px}.product-rich-description table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse}.product-rich-description th,.product-rich-description td{padding:8px 10px;border:1px solid #dbe4ef}
.public-toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:9999;background:#111827;color:#fff;padding:10px 12px;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.15);font-size:14px;max-width:calc(100vw - 40px);opacity:0;transition:opacity .16s ease}
@media(max-width:900px){.filter-row.filter-row-compact{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-actions{grid-column:1/-1}.filter-actions .public-btn,.filter-actions button{width:100%}}
@media(max-width:640px){.container,.wrap{padding:12px}.filter-row,.filter-row.filter-row-compact{grid-template-columns:1fr}.grid,.product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.card{padding:12px}.topbar,.top{padding:10px 12px}.bottom-bar{align-items:stretch}.bottom-bar .btn-back{flex:1}.item-bottom{align-items:flex-start;flex-direction:column}.cart-item{padding:10px 12px}.name{font-size:.82rem}.public-top-title,.topbar h1,.top h1{font-size:.94rem}}

.public-logo{width:38px;height:38px;border-radius:12px;object-fit:cover;display:inline-block;background:#fff;border:1px solid rgba(219,231,247,.9);box-shadow:0 6px 16px rgba(15,23,42,.08);vertical-align:middle;}
.topbar h1,.top h1,.public-top-title{display:flex;align-items:center;gap:10px;}

/* current architecture — Global mobile tap/input zoom guard for public site */
@media (max-width: 768px){
  body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  body select,
  body textarea{
    font-size:16px;
  }
  body,
  body a,
  body button,
  body input,
  body select,
  body textarea,
  body label{
    touch-action:manipulation;
  }}

/* current architecture — Public mobile overscroll guard */
@media (max-width:768px){
  html,
  body{
    overscroll-behavior-y:none;
    overscroll-behavior-x:none;
  }
  body{overflow-x:hidden;}}

.public-product-code-empty{padding:24px;text-align:center;margin-top:18px}
.public-product-code-empty h1{font-size:20px;margin:0 0 8px}
.public-product-code-empty p{margin:0 0 16px;color:#6b7280}

.public-toast.is-visible{opacity:1}

/* current architecture: branch selector UI moved out of JS inline styles */
.kv-branch-loading{position:fixed;inset:0;z-index:10000;background:rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;padding:20px}
.kv-branch-loading-card{width:min(420px,92vw);background:#fff;border-radius:16px;padding:16px 14px;box-shadow:0 20px 60px rgba(0,0,0,.25);font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial}
.kv-branch-loading-title{font-weight:700;font-size:16px;margin-bottom:6px;color:#111827}
.kv-branch-loading-text{color:#374151;font-size:14px;line-height:1.35}
.kv-branch-overlay{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.45);display:none;align-items:center;justify-content:center;padding:16px}
.kv-branch-panel{width:min(460px,96vw);background:#fff;border-radius:16px;padding:14px;box-shadow:0 20px 60px rgba(0,0,0,.35);font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial}
.kv-branch-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.kv-branch-panel-title{font-weight:700;font-size:16px;color:#111827}
.kv-branch-close{border:0;background:#f3f4f6;border-radius:999px;width:34px;height:34px;cursor:pointer;font-weight:700}
.kvBranchItem{width:100%;text-align:left;padding:12px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;cursor:pointer;font-size:15px;font-weight:500;color:#111827;margin:0 0 10px}
.kvBranchItem:hover{background:#f8fafc;border-color:#cbd5e1}
.kv-branch-item-name{font-size:15px;font-weight:650}
.kv-branch-item-help{font-size:13px;font-weight:400;color:#6b7280;margin-top:2px}
.kv-branch-empty{padding:14px;border:1px dashed #cbd5e1;border-radius:12px;background:#f8fafc;color:#111827}
.kv-branch-bar{position:sticky;top:0;z-index:2000;background:#fff;border-bottom:1px solid #e5e7eb;padding:8px 10px;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial}
.kv-branch-bar-inner{display:flex;align-items:center;justify-content:space-between;gap:10px}
.kv-branch-current{font-size:14px;color:#111827;line-height:1.1}
.kv-branch-current span{font-weight:600}
.kv-branch-current a{font-weight:700;color:#2563eb;text-decoration:none}
.btn-change-branch{border:1px solid #e5e7eb;background:#fff;border-radius:10px;padding:7px 12px;font-weight:600;cursor:pointer}

.kv-branch-loading.is-hidden{display:none}
.kv-branch-overlay.is-open{display:flex}