.ta-ubs{max-width:1100px;margin:20px auto;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;background:#fff;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif}
.ta-ubs__header{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid #e5e7eb}
.ta-ubs__title{font-size:18px;font-weight:700}
.ta-ubs__close{background:transparent;border:0;font-size:26px;line-height:1;cursor:pointer;padding:0 6px}
.ta-ubs__body{display:flex;gap:18px;padding:18px}
.ta-ubs__left{flex:1;min-width:0}
.ta-ubs__right{width:360px}
.ta-ubs__dropzone{border:2px dashed #d1d5db;border-radius:12px;padding:18px;text-align:center;cursor:pointer;position:relative;background:#fafafa}
.ta-ubs__dropzone:focus{outline:3px solid rgba(59,130,246,.35);outline-offset:2px}
.ta-ubs__dropzoneIcon{font-size:28px;margin-bottom:8px}
.ta-ubs__dropzoneText{font-size:14px;color:#374151}
.ta-ubs__fileInput{position:absolute;inset:0;opacity:0;cursor:pointer}

/* Uploading state */
.ta-ubs--uploading .ta-ubs__dropzone{pointer-events:none;opacity:.75}
.ta-ubs__uploading{position:absolute;inset:0;display:none;flex-direction:column;align-items:center;justify-content:center;background:rgba(250,250,250,.85);backdrop-filter:blur(1px);border-radius:12px}
.ta-ubs--uploading .ta-ubs__uploading{display:flex}
.ta-ubs__spinner{width:28px;height:28px;border-radius:999px;border:3px solid #d1d5db;border-top-color:#111827;animation:taUbsSpin 1s linear infinite}
.ta-ubs__uploadingText{margin-top:8px;font-size:13px;color:#111827;font-weight:650}
@keyframes taUbsSpin{to{transform:rotate(360deg)}}
.ta-ubs__items{margin-top:14px;display:flex;flex-direction:column;gap:10px}
.ta-ubs__item{display:flex;gap:10px;align-items:center;border:1px solid #e5e7eb;border-radius:10px;padding:10px;background:#fff}
.ta-ubs__item.is-active{border-color:#111827;box-shadow:0 0 0 1px #111827 inset}
.ta-ubs__thumb{width:56px;height:56px;border-radius:10px;object-fit:contain;background:#f3f4f6;border:1px solid #e5e7eb}
.ta-ubs__meta{flex:1;min-width:0}
.ta-ubs__name{font-size:13px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ta-ubs__sub{font-size:12px;color:#6b7280;margin-top:2px}
.ta-ubs__remove{
  border:0;
  background:#111827 !important;
  color:#fff !important;
  border-radius:999px;
  width:34px;
  height:34px;
  padding:0;
  cursor:pointer;
  font-size:18px;
  line-height:34px;
  text-align:center;
}
.ta-ubs__panel{border:1px solid #e5e7eb;border-radius:12px;padding:14px;background:#fff}
.ta-ubs__panelTitle{font-weight:750;margin-bottom:10px}
.ta-ubs__toggleRow{margin-bottom:10px}
.ta-ubs__toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px}
.ta-ubs__toggle input{transform:scale(1.1)}
.ta-ubs__dims{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin-bottom:12px}
.ta-ubs__dims label{display:block;font-size:12px;color:#374151;margin-bottom:4px}
.ta-ubs__dims input{width:100%;padding:9px 10px;border:1px solid #d1d5db;border-radius:10px}
.ta-ubs__summary{border-top:1px solid #f3f4f6;padding-top:10px;margin-top:10px}
.ta-ubs__row{display:flex;justify-content:space-between;font-size:13px;padding:4px 0;color:#111827}
.ta-ubs__total{display:flex;justify-content:space-between;font-size:16px;font-weight:800;padding:10px 0;margin-top:4px}
.ta-ubs__libraryBtn,.ta-ubs__addToCartBtn{width:100%;margin-top:8px;padding:10px 12px;border-radius:10px;cursor:pointer}
.ta-ubs__libraryBtn{border:1px solid #d1d5db;background:#fff}
.ta-ubs__addToCartBtn{border:1px solid #111827;background:#111827;color:#fff}
.ta-ubs__addToCartBtn--loading{position:relative;opacity:.85;cursor:wait}
.ta-ubs__addToCartBtn--loading:after{content:"";position:absolute;right:12px;top:50%;width:14px;height:14px;margin-top:-7px;border:2px solid rgba(255,255,255,.6);border-top-color:#fff;border-radius:50%;animation:ta-ubs-spin .8s linear infinite}
@keyframes ta-ubs-spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
.ta-ubs__tierTable{margin-top:12px}
.ta-ubs__tierTitle{font-size:12px;color:#6b7280;margin-bottom:6px}
.ta-ubs__tierTable table{width:100%;border-collapse:collapse;font-size:12px}
.ta-ubs__tierTable th,.ta-ubs__tierTable td{border:1px solid #e5e7eb;padding:6px;text-align:left}
.ta-ubs__tierTable tr.is-active td{background:#e6f7e9;border-color:#b7e4c1;font-weight:600}
.ta-ubs-active form.cart,
.ta-ubs-active .single_add_to_cart_button,
.ta-ubs-active .woocommerce-variation-add-to-cart{display:none !important}
.ta-ubs__sizeWarn{margin-top:8px;color:#b91c1c;font-weight:600;font-size:12px}
.ta-ubs__libraryModal{position:fixed;inset:0;background:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;z-index:999999}
.ta-ubs__libraryInner{width:min(920px,92vw);max-height:80vh;background:#fff;border-radius:14px;overflow:hidden;display:flex;flex-direction:column}
.ta-ubs__libraryHeader{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid #e5e7eb;font-weight:800}
.ta-ubs__libraryClose{border:0;background:transparent;font-size:24px;cursor:pointer}
.ta-ubs__libraryGrid{padding:16px;display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;overflow:auto}
.ta-ubs__libItem{border:1px solid #e5e7eb;border-radius:12px;padding:10px;cursor:pointer}
.ta-ubs__libItem img{width:100%;height:120px;object-fit:contain;background:#f3f4f6;border-radius:10px;border:1px solid #e5e7eb}
.ta-ubs__libName{font-size:12px;font-weight:700;margin-top:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ta-ubs__notice{font-size:12px;color:#6b7280;margin-top:8px}

.ta-ubs__item--selected, .ta-ubs__item.is-selected{outline:2px solid #16a34a; box-shadow:0 0 0 3px rgba(22,163,74,.15); background:rgba(22,163,74,.04);}

/* Hide default WooCommerce add-to-cart UI when TA UBS is active */
body.ta-ubs-active .single-product form.cart{display:none !important;}
body.ta-ubs-active .single-product .woocommerce-variation-add-to-cart{display:none !important;}

/* Hide default WooCommerce add-to-cart UI when TA UBS is active */
body.ta-ubs-active.single-product form.cart{display:none !important;}
body.ta-ubs-active.single-product .woocommerce-variation-add-to-cart{display:none !important;}

.ta-ubs__libDel{margin-left:8px; background:#ef4444; border:0; color:#fff; padding:6px 10px; border-radius:10px; cursor:pointer; font-weight:600;}
.ta-ubs__libDel:disabled{opacity:.7; cursor:not-allowed;}

.ta-ubs__libraryPager{display:flex;gap:8px;justify-content:center;align-items:center;padding:0 16px 16px}
.ta-ubs__libraryPager button{border:1px solid #d1d5db;background:#fff;padding:6px 10px;border-radius:8px;cursor:pointer}
.ta-ubs__libraryPager button[disabled]{opacity:.5;cursor:not-allowed}
.ta-ubs__libraryPager .ta-ubs__pagerInfo{font-size:13px;color:#374151}

.ta-ubs__inspectLabelWrap{display:inline-flex;align-items:center;gap:6px;position:relative}
.ta-ubs__help{display:inline-block;position:relative}
.ta-ubs__help > summary{list-style:none}
.ta-ubs__help > summary::-webkit-details-marker{display:none}
.ta-ubs__helpToggle{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;border:1px solid #9ca3af;background:#fff;color:#374151;font-size:12px;font-weight:700;line-height:1;cursor:pointer;user-select:none}
.ta-ubs__help[open] .ta-ubs__helpToggle{background:#111827;color:#fff;border-color:#111827}
.ta-ubs__helpCard{position:absolute;left:0;top:calc(100% + 8px);z-index:30;min-width:260px;max-width:min(320px,80vw);padding:10px 12px;border:1px solid #d1d5db;border-radius:10px;background:#fff;box-shadow:0 10px 30px rgba(0,0,0,.12);font-size:12px;color:#111827}
.ta-ubs__helpCard strong{display:block;margin-bottom:6px;font-size:12px}
.ta-ubs__helpCard ul{margin:0;padding-left:16px}
.ta-ubs__helpCard li{margin:2px 0}
