/* WC Inventory Product Table - Frontend CSS (v1.2.0) */

/* Toolbar */
.wcipt-wrap{width:100%;}
.wcipt-page-title{width:100%;text-align:center;font-size:22px;font-weight:900;margin:4px 0 14px 0;letter-spacing:.2px;}
.wcipt-toolbar{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;margin:0 0 12px 0;}
.wcipt-toolbar-left{flex:1;min-width:260px;}
.wcipt-toolbar-right{display:flex;flex-direction:column;gap:10px;align-items:flex-end;}

.wcipt-filter-title{font-weight:800;margin:6px 0 8px;}

.wcipt-btn{padding:9px 12px;border-radius:6px;border:1px solid #1e5eff;background:#1e5eff;color:#fff;cursor:pointer;font-weight:700;line-height:1;}
.wcipt-btn:hover{filter:brightness(.95);}
.wcipt-btn-secondary{background:#fff;color:#1e5eff;border-color:#1e5eff;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;}
.wcipt-input{padding:9px 10px;border-radius:6px;border:1px solid #dfe6ef;width:220px;box-sizing:border-box;}

/* Category tree */
.wcipt-category-filter{border:1px solid #e6edf6;border-radius:10px;padding:10px;background:#fafcff;}
.wcipt-cat-ul{list-style:none;margin:0;padding:0;}
.wcipt-cat-li{padding:4px 0;}
.wcipt-cat-label{cursor:pointer;}
.wcipt-cat-children{margin-left:18px;display:none;}
.wcipt-cat-li.open>.wcipt-cat-children{display:block;}
.wcipt-caret{display:inline-block;width:14px;height:14px;margin-right:6px;border:1px solid #c9d6ea;border-radius:3px;vertical-align:-2px;position:relative;cursor:pointer;background:#fff;}
.wcipt-caret:before{content:"";position:absolute;left:3px;top:6px;width:8px;height:2px;background:#1e5eff;}
.wcipt-caret:after{content:"";position:absolute;left:6px;top:3px;width:2px;height:8px;background:#1e5eff;}
.wcipt-cat-li.open>.wcipt-caret:after{display:none;}
.wcipt-caret-spacer{display:inline-block;width:14px;height:14px;margin-right:6px;}

/* Table + mobile scroll
   IMPORTANT: do NOT force touch-action: pan-x on mobile.
   It can block vertical page scrolling when the user swipes inside the table area.
*/
.wcipt-table-scroll{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;touch-action:auto;}
.wcipt-table{width:100%;border-collapse:collapse;min-width:980px;background:#fff;}
.wcipt-table th,.wcipt-table td{border:1px solid #eef2f7;padding:8px 10px;vertical-align:middle;}
.wcipt-table th{background:#f7f9fc;font-weight:800;user-select:none;}

.wcipt-thumb{width:40px;height:40px;border-radius:8px;object-fit:cover;border:1px solid #e6edf6;}
.wcipt-thumb-empty{display:inline-block;width:40px;height:40px;border-radius:8px;border:1px solid #e6edf6;background:#f1f4f9;}

.wcipt-col-sku{width:110px;}
.wcipt-col-stock,.wcipt-col-low{width:120px;}
.wcipt-col-unit{width:140px;}
.wcipt-col-date{width:170px;}
.wcipt-col-update{width:90px;text-align:center;}

.wcipt-num{width:100%;padding:8px 36px 8px 10px;border:1px solid #dfe6ef;border-radius:6px;text-align:center;box-sizing:border-box;}
.wcipt-select{width:100%;padding:8px 10px;border:1px solid #dfe6ef;border-radius:6px;box-sizing:border-box;background:#fff;}
.wcipt-num.is-low{background:#ff7a7a;background-image:var(--wcipt-low-stock-icon);background-repeat:no-repeat;background-position:right 6px center;background-size:18px 18px;}
.wcipt-num.is-ok{background:#bfffc1;}

.wcipt-flash{animation:wciptflash 2s ease;}
@keyframes wciptflash{0%{background:#fff3b0;}100%{background:inherit;}}

/* Sidebar overlay/panel */
#wcipt-sidebar-overlay{position:fixed;inset:0;background:rgba(0,0,0,.35);opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:99998;}
/* NOTE: Use right-position animation (not transform) to avoid mobile select dropdown clipping issues */
#wcipt-sidebar{position:fixed;top:0;right:-520px;height:100%;width:420px;max-width:94vw;background:#fff;transition:right .25s ease;z-index:99999;display:flex;flex-direction:column;box-shadow:-8px 0 30px rgba(0,0,0,.15);}
body.wcipt-sidebar-open #wcipt-sidebar-overlay{opacity:1;pointer-events:auto;}
body.wcipt-sidebar-open #wcipt-sidebar{right:0;}

/* Desktop: make sidebar about half screen width */
@media (min-width: 1100px){
  #wcipt-sidebar{width:50vw;max-width:680px;right:-720px;}
}

.wcipt-sidebar-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 12px;background:#1e5eff;color:#fff;}
.wcipt-sidebar-title{font-size:16px;font-weight:800;}
#wcipt-sidebar-close{margin-left:auto;width:44px;height:44px;border:none;border-radius:10px;background:rgba(255,255,255,.18);color:#fff;font-size:30px;font-weight:900;line-height:1;cursor:pointer;}
.wcipt-icon-btn{width:44px;height:44px;border:none;border-radius:10px;background:rgba(255,255,255,.18);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;}

.wcipt-sidebar-body{padding:14px;overflow:auto;flex:1 1 auto;}
.wcipt-sidebar-footer{padding:12px 14px;display:flex;gap:10px;justify-content:flex-end;border-top:1px solid #eef2f7;background:#fff;}

/* Accordion / fields */
.wcipt-acc-item{border:1px solid #e6edf6;border-radius:10px;margin-bottom:10px;overflow:hidden;}
.wcipt-acc-head{width:100%;background:#f2f2f2;border:none;padding:10px 12px;display:flex;justify-content:space-between;align-items:center;font-weight:800;cursor:pointer;}
.wcipt-acc-arrow{font-size:18px;transition:transform .15s ease;}
.wcipt-acc-body{display:none;padding:12px;background:#fff;}
.wcipt-acc-item.open .wcipt-acc-body{display:block;}
.wcipt-acc-item.open .wcipt-acc-arrow{transform:rotate(180deg);}

.wcipt-label{display:block;font-weight:700;margin:10px 0 6px;}
.wcipt-field{width:100%;padding:10px 10px;border:1px solid #dfe6ef;border-radius:6px;box-sizing:border-box;}
select.wcipt-field{min-height:44px;line-height:1.2;}
.wcipt-field-tall{min-height:120px;}
.wcipt-hint{margin-top:6px;font-size:12px;color:#556;}

.wcipt-checkline{margin:10px 0 4px;display:flex;align-items:center;gap:10px;font-weight:700;}
.wcipt-checkline input{transform:translateY(1px);}
#wcipt-stock-fields.disabled{opacity:.45;pointer-events:none;filter:grayscale(1);}

/* Disable inventory block when product is variable */
#wcipt-inventory-fields.disabled{opacity:.45;pointer-events:none;filter:grayscale(1);} 

.wcipt-mini-btn{padding:8px 10px;border-radius:6px;border:1px solid #1e5eff;background:#fff;color:#1e5eff;cursor:pointer;font-weight:800;}
.wcipt-mini-btn.danger{border-color:#d11;color:#d11;}

.wcipt-divider{height:1px;background:#eef2f7;margin:12px 0;}
.wcipt-catbox{max-height:260px;overflow:auto;border:1px solid #e6edf6;border-radius:10px;padding:10px;background:#fafcff;}

/* File upload previews */
.wcipt-file-row{display:flex;gap:10px;align-items:center;}
.wcipt-img-preview img{margin-top:10px;max-width:100%;border-radius:10px;border:1px solid #e6edf6;}
.wcipt-gallery-previews{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px;}
.wcipt-gwrap{position:relative;display:inline-block;}
.wcipt-gwrap.is-featured .wcipt-gimg{outline:3px solid #1e5eff;}
.wcipt-gbadge{position:absolute;bottom:-6px;left:-6px;width:24px;height:24px;border-radius:999px;background:#1e5eff;color:#fff;font-weight:900;font-size:14px;display:none;align-items:center;justify-content:center;}
.wcipt-gwrap.is-featured .wcipt-gbadge{display:flex;}
.wcipt-gimg{width:64px;height:64px;border-radius:10px;border:1px solid #e6edf6;object-fit:cover;background:#f2f2f2;}
.wcipt-gdel{position:absolute;top:-8px;right:-8px;width:26px;height:26px;border-radius:999px;border:none;background:#d11;color:#fff;font-weight:900;cursor:pointer;line-height:1;}
/* choose featured from gallery */
.wcipt-gstar{position:absolute;bottom:-8px;right:-8px;width:26px;height:26px;border-radius:999px;border:none;background:#1e5eff;color:#fff;font-weight:900;cursor:pointer;line-height:1;display:flex;align-items:center;justify-content:center;}
.wcipt-gwrap.is-featured .wcipt-gimg{outline:3px solid #1e5eff;outline-offset:2px;}

/* Mobile tweaks */
@media (max-width:900px){
  .wcipt-page-title{font-size:18px;margin:2px 0 10px 0;}
  .wcipt-toolbar{flex-direction:column;}
  .wcipt-toolbar-right{align-items:stretch;width:100%;}
  .wcipt-input{width:100%;}
}

/* ===== Attributes / Chips UI ===== */
.wcipt-attr-toolbar,.wcipt-var-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;}
.wcipt-attr-row{border:1px solid #e6edf6;border-radius:10px;padding:10px;margin:10px 0;background:#fff;}
.wcipt-attr-top{display:flex;gap:10px;align-items:center;flex-wrap:wrap;}
.wcipt-attr-top .wcipt-field{max-width:260px;}
.wcipt-attr-actions{margin-left:auto;display:flex;gap:8px;align-items:center;}
.wcipt-chipbox{border:1px solid #dfe6ef;border-radius:8px;padding:8px;display:flex;flex-wrap:wrap;gap:6px;align-items:center;}
.wcipt-chip{background:#eef4ff;color:#113;border:1px solid #cfe0ff;border-radius:999px;padding:4px 8px;display:inline-flex;gap:6px;align-items:center;font-weight:700;font-size:12px;}
.wcipt-chip button{border:none;background:transparent;color:#1e5eff;font-weight:900;cursor:pointer;line-height:1;}
.wcipt-chip-input{border:none;outline:none;min-width:120px;flex:1 1 auto;padding:6px 4px;font-weight:600;}

/* ===== Variations list ===== */
.wcipt-var-item{border:1px solid #e6edf6;border-radius:10px;padding:10px;margin:10px 0;background:#fff;}
.wcipt-var-title{font-weight:900;margin-bottom:8px;}
.wcipt-var-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.wcipt-var-image{grid-column:1 / -1;}
.wcipt-var-imgrow{display:flex;gap:10px;align-items:center;flex-wrap:wrap;}

.wcipt-vthumbs{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.wcipt-vthumb{width:48px;height:48px;border:1px solid #d0d7de;border-radius:8px;overflow:hidden;position:relative;cursor:pointer;background:#f6f8fa}
.wcipt-vthumb img{width:100%;height:100%;object-fit:cover;display:block}
.wcipt-vthumb .wcipt-vdel{position:absolute;top:-6px;right:-6px;width:18px;height:18px;border-radius:999px;border:none;background:#dc3545;color:#fff;font-size:12px;line-height:18px;cursor:pointer}
.wcipt-vthumb .wcipt-vstar{display:none;position:absolute;left:2px;bottom:2px;font-size:12px;background:rgba(0,0,0,.55);color:#fff;border-radius:6px;padding:0 4px}
.wcipt-vthumb.is-featured{outline:2px solid #2563eb;outline-offset:2px}
.wcipt-vthumb.is-featured .wcipt-vstar{display:inline-block}
.wcipt-var-img{width:64px;height:64px;border-radius:10px;border:1px solid #e6edf6;object-fit:cover;background:#f2f2f2;}
.wcipt-var-img-empty{display:inline-block;}
.wcipt-var-stockwrap.disabled,.wcipt-var-lowwrap.disabled{opacity:.55;}
@media (max-width:600px){
  .wcipt-var-grid{grid-template-columns:1fr;}
}

/* Single product page: custom variation gallery */
.wcipt-sp-gallery{margin-bottom:20px}
.wcipt-sp-main{width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;background:#fff}
.wcipt-sp-main-img{width:100%;height:auto;display:block}
.wcipt-sp-thumbs{display:flex;gap:10px;margin-top:12px;flex-wrap:wrap}
.wcipt-sp-thumb{border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;padding:0;background:#fff;cursor:pointer}
.wcipt-sp-thumb img{width:60px;height:60px;object-fit:cover;display:block}


/* Sidebar: tags + titles manager */
#wcipt-tags-list.wcipt-scrollbox,
#wcipt-tagcol-titles.wcipt-scrollbox{
  max-height:220px;
}
.wcipt-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fff;
  margin:6px 0;
}
.wcipt-title-del{
  border:1px solid #cbd5e1;
  background:#fff;
  border-radius:10px;
  width:34px;
  height:30px;
  font-size:18px;
  cursor:pointer;
}
.wcipt-title-del:active{ transform:scale(0.98); }


/* Sidebar: Product Tags spacing */
#wcipt-tags-list .wcipt-check{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin:6px 14px 6px 0;
}
#wcipt-tags-list .wcipt-check input{
  margin:0;
}


/* Category delete button */
.wcipt-cat-li{position:relative;}
.wcipt-cat-del{margin-left:8px;border:1px solid #ddd;background:#fff;color:#333;border-radius:6px;padding:0 6px;line-height:20px;height:22px;cursor:pointer;}
.wcipt-cat-del:hover{background:#ffe5e5;border-color:#ffb3b3;}


/* Tagboard column collapse */
.wcipt-tagcol-head{display:flex;align-items:center;gap:8px;}
.wcipt-tagcol-toggle{border:1px solid #ddd;background:#fff;border-radius:6px;width:26px;height:26px;cursor:pointer;line-height:24px;}
.wcipt-tagcol.is-collapsed .wcipt-tagcol-body{display:none;}
.wcipt-tagcol.is-collapsed .wcipt-tagcol-toggle{transform:rotate(-90deg);}


/* Sorting icons */
th.wcipt-sort{cursor:pointer;user-select:none;}
th.wcipt-sort .wcipt-sort-icon{display:inline-block;margin-left:6px;vertical-align:middle;float:right;opacity:.7;font-size:12px;line-height:1;}
th.wcipt-sort .wcipt-sort-icon:before{content:'⇅';}
th.wcipt-sort .wcipt-sort-icon.asc:before{content:'↑';opacity:1;}
th.wcipt-sort .wcipt-sort-icon.desc:before{content:'↓';opacity:1;}

/* Variations: Tags spacing (fix checkbox too-close issue) */
.wcipt-var-tagsbox .wcipt-check{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:6px 18px 6px 0; /* right margin creates space between labels even when HTML has no whitespace */
}
.wcipt-var-tagsbox .wcipt-check input{
  margin:0;
}
