/* =========================================================
   HT Variaties Tabel — Compact, Clean, DataTables-style
   ========================================================= */

.ht-var-table-wrap{
  margin-top:16px;
}

.ht-var-table-title{
  margin:0;
  font-size:18px;
  font-weight:800;
  line-height:1.15;
}

/* ===== Header boven tabel ===== */

.ht-var-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.ht-var-head-actions{
  display:flex;
  gap:8px;
  align-items:center;
}

/* ===== Uniforme knopstijl (Reset + Toevoegen) ===== */

.ht-var-table-wrap .button,
.ht-var-table-wrap button.button{
  padding:6px 10px;
  min-height:auto;
  line-height:1;
  border-radius:8px;
  font-weight:800;
  font-size:12px;
  letter-spacing:.02em;
  text-transform:uppercase;
}

/* ===== Filters bar ===== */

.ht-var-filters{
  margin:8px 0 10px;
  padding:10px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:12px;
  background:rgba(0,0,0,.02);
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:10px;
}

.ht-var-filter-item{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.ht-var-filter-label{
  font-size:11px;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
  opacity:.7;
}

.ht-var-filter{
  width:100%;
  padding:7px 10px;
  font-size:14px;
  border:1px solid rgba(0,0,0,.14);
  border-radius:8px;
  background:#fff;
}

/* ===== Table container ===== */

.ht-var-table-box{
  border:1px solid rgba(0,0,0,.08);
  border-radius:12px;
  overflow:hidden;
  background:#fff;
}

.ht-var-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:auto;
}

/* ===== Header & Body alignment (compact + consistent) ===== */

.ht-var-table thead th,
.ht-var-table tbody td{
  padding:8px 12px;
  line-height:1.2;
  text-align:left;
  vertical-align:middle;
}

.ht-var-table thead th{
  background:rgba(0,0,0,.04);
  border-bottom:1px solid rgba(0,0,0,.08);
  text-transform:uppercase;
  font-size:12px;
  letter-spacing:.03em;
  font-weight:900;
}

.ht-var-table tbody td{
  border-bottom:1px solid rgba(0,0,0,.06);
  font-size:14px;
}

.ht-var-table tbody tr:last-child td{
  border-bottom:0;
}

.ht-var-table tbody tr:hover td{
  background:rgba(0,0,0,.02);
}

/* ===== Column widths ===== */

.ht-col-photo{ width:60px; }
.ht-col-sku{ width:190px; }
.ht-col-price{ width:110px; }
.ht-col-price-incl{ width:110px; }
.ht-col-weight{ width:95px; }
.ht-col-action{ width:115px; }

/* Voorkom wrapping in header-cellen */
.ht-var-table thead th{
  white-space:nowrap;
}

/* ===== Thumbnail ===== */

.ht-var-thumb{
  width:38px;
  height:38px;
  object-fit:contain;
  border-radius:8px;
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
}

/* =========================================================
   Sortable header (DataTables-style)
   ========================================================= */

.ht-var-table thead th.ht-sortable{
  cursor:default;
}

.ht-var-table thead th .ht-th-label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  user-select:none;
}

/* Sort indicator container */
.ht-var-table thead th .ht-sort-ind{
  display:inline-block;
  width:12px;
  height:12px;
  position:relative;
  opacity:.45;
  transform:translateY(1px);
}

/* Default (unsorted) = dubbele chevrons */
.ht-var-table thead th.ht-sortable .ht-sort-ind::before,
.ht-var-table thead th.ht-sortable .ht-sort-ind::after{
  content:"";
  position:absolute;
  left:50%;
  width:5px;
  height:5px;
  border-right:2px solid rgba(0,0,0,.45);
  border-bottom:2px solid rgba(0,0,0,.45);
  border-radius:1px;
}

.ht-var-table thead th.ht-sortable .ht-sort-ind::before{
  top:1px;
  transform:translateX(-50%) rotate(225deg);
}

.ht-var-table thead th.ht-sortable .ht-sort-ind::after{
  bottom:1px;
  transform:translateX(-50%) rotate(45deg);
}

/* Hover = subtiel donkerder */
.ht-var-table thead th.ht-sortable .ht-th-label:hover .ht-sort-ind{
  opacity:.85;
}

/* Ascending */
.ht-var-table thead th.ht-sortable[data-state="asc"] .ht-sort-ind{
  opacity:1;
}
.ht-var-table thead th.ht-sortable[data-state="asc"] .ht-sort-ind::after{
  display:none;
}

/* Descending */
.ht-var-table thead th.ht-sortable[data-state="desc"] .ht-sort-ind{
  opacity:1;
}
.ht-var-table thead th.ht-sortable[data-state="desc"] .ht-sort-ind::before{
  display:none;
}

/* Active column highlight */
.ht-var-table thead th.ht-sortable[data-state="asc"],
.ht-var-table thead th.ht-sortable[data-state="desc"]{
  background:rgba(0,0,0,.06);
}

/* ===== Price styling ===== */

.ht-price,
.ht-var-table .woocommerce-Price-amount{
  color:#2e7d32;
  font-weight:900;
}

/* ===== Select-knop ===== */

.ht-var-table-wrap .button.ht-var-select{
  padding:6px 12px;
  font-size:12px;
  border-radius:8px;
  font-weight:900;
  background:#1a73e8;
  color:#fff;
  border-color:#1a73e8;
  transition: background .15s, border-color .15s, transform .1s;
}

.ht-var-table-wrap .button.ht-var-select:hover{
  background:#1558b0;
  border-color:#1558b0;
}

.ht-var-table-wrap .button.ht-var-select:active{
  transform: scale(.97);
}

/* ===== Actieve (geselecteerde) rij ===== */

.ht-var-table tbody tr.ht-var-row--active td{
  background: rgba(26, 115, 232, .07);
  outline: none;
}

.ht-var-table tbody tr.ht-var-row--active .ht-var-select{
  background:#145ab0;
  border-color:#145ab0;
}

.ht-var-disabled{
  opacity:.6;
  font-size:13px;
}

/* ===== Responsive ===== */

/* Verberg de tabel volledig op mobiel en toon een melding */
.ht-var-mobile-msg{
  display:none;
  padding:12px 16px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:12px;
  background:rgba(0,0,0,.02);
  font-size:14px;
  color:rgba(0,0,0,.55);
  text-align:center;
}

@media (max-width: 900px){
  .ht-var-filters,
  .ht-var-table-box{
    display:none;
  }

  .ht-var-mobile-msg{
    display:block;
  }
}