.wpt-table-view-switch {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 16px;
}

.wpt-table-view-button {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #111;
  color: #111;
  text-decoration: none;
  border-radius: 3px;
  font-weight: 600;
}

.wpt-table-view-button.is-active {
  background: #111;
  color: #fff;
}

.gridlist-toggle {
  display: inline-flex;
  gap: 0;
  align-items: center;
}

.gridlist-toggle a {
  --wpt-primary-color: var(--theme-palette-color-1, var(--e-global-color-primary, var(--wp--preset--color--primary, #f36b21)));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 2px;
  text-decoration: none;
  background: transparent;
  color: var(--wpt-primary-color);
}

.gridlist-toggle a.active {
  background: var(--wpt-primary-color);
  color: #fff;
}

.gridlist-toggle .dashicons {
  font-size: 16px;
  line-height: 1;
  color: var(--wpt-primary-color);
}

.gridlist-toggle a.active .dashicons {
  color: #fff;
}

.gridlist-toggle.is-hidden {
  visibility: hidden;
}

.wpt-product-table,
.wpt-product-table * {
  box-sizing: border-box;
}

.wpt-product-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0;
  table-layout: auto;
  border: 0;
  margin: 0 0 24px;
  font-size: 13px;
}

.wpt-product-table th,
.wpt-product-table td {
  border: 0;
  padding: 12px 14px;
  vertical-align: middle; /* align items in middle for cleaner vertical grouping */
}

.wpt-product-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8f8f8;
  border-bottom: 1px solid #e4e4e4;
  text-align: left;
  padding: 14px 14px;
}

body.admin-bar .wpt-product-table th {
  top: 32px;
}

.wpt-product-table tbody td {
  background: #fff;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

/* Add left/right border for row grouping */
.wpt-product-row td:first-child {
  border-left: 1px solid #e2e8f0;
}

.wpt-product-row td:last-child {
  border-right: 1px solid #e2e8f0;
}

/* First row styling (Header/Main Row of the product card) */
.wpt-product-row--1 td {
  border-top: 1px solid #e2e8f0;
  border-bottom: 0; /* Merge with the second row */
}

.wpt-product-row--1 td:first-child {
  border-top-left-radius: 10px;
}

.wpt-product-row--1 td:last-child {
  border-top-right-radius: 10px;
}

/* Second row styling (Actions/Inputs Row of the product card) */
.wpt-product-row--2 td {
  border-top: 0;
  border-bottom: 1px solid #e2e8f0;
}

.wpt-product-row--2 td:first-child {
  border-bottom-left-radius: 10px;
}

.wpt-product-row--2 td:last-child {
  border-bottom-right-radius: 10px;
}

/* If a product has only 1 row (row 1 is also the last row) */
.wpt-product-row--1:last-of-type td {
  border-bottom: 1px solid #e2e8f0;
}

.wpt-product-row--1:last-of-type td:first-child {
  border-bottom-left-radius: 10px;
}

.wpt-product-row--1:last-of-type td:last-child {
  border-bottom-right-radius: 10px;
}

/* Spacer row styling to create space between product cards */
.wpt-product-spacer-row td {
  height: 20px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.wpt-image-badge {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.wpt-image-link img {
  height: auto;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;

}

.wpt-cell--image {
  width: 1%;
  white-space: nowrap;
}

.wpt-cell--image .wpt-image-link {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 901px) {
  .wpt-product-row.wpt-product-row--1 {
    height: 225px;
  }

  .wpt-product-row.wpt-product-row--1 .wpt-cell--image .wpt-image-link {
    height: 225px;
  }
}

.wpt-product-name {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.wpt-product-name-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wpt-product-attributes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.wpt-product-attr-item {
  font-size: 11px;
  color: #475569;
  background-color: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  gap: 4px;
  line-height: 1.4;
}

.wpt-product-attr-item .attr-label {
  font-weight: 600;
  color: #1e293b;
}

.wpt-product-attr-item .attr-value {
  font-weight: 400;
}

.wpt-price-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wpt-price-line {
  white-space: nowrap;
}

.wpt-text-value.wpt-style-muted,
.wpt-price-line.wpt-style-muted {
  color: #777;
}

.wpt-text-value.wpt-style-small,
.wpt-price-line.wpt-style-small {
  font-size: 12px;
}

.wpt-text-value.wpt-style-bold,
.wpt-price-line.wpt-style-bold {
  font-weight: 600;
}

.wpt-empty {
  color: #999;
}

.wpt-info-toggle {
  display: inline-block;
  margin-bottom: 6px;
}

.wpt-info-panel {
  display: none;
  border-top: 1px solid #e2e2e2;
  margin-top: 8px;
  padding-top: 8px;
}

.wpt-info-panel.is-open {
  display: block;
}

.wpt-info-list {
  margin: 0 0 8px;
  padding-left: 16px;
}

.wpt-info-link {
  display: inline-block;
  margin-top: 6px;
  font-weight: 600;
}

.wpt-product-row--2 td {
  border-top: 0;
}

.wpt-cell--actions {
  text-align: right;
}

.wpt-actions-form {
  display: flex;
  justify-content: flex-end;
}

.wpt-actions-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wpt-actions-form .quantity {
  margin: 0;
}

.wpt-actions-form .wpt-qty {
  width: 70px;
  padding: 6px 8px;
}

@media (max-width: 900px) {
  .wpt-product-spacer-row {
    display: none !important;
  }

  .wpt-product-table {
    border-spacing: 0 14px;
  }

  .wpt-product-table thead {
    display: none;
  }

  .wpt-product-table,
  .wpt-product-table tbody,
  .wpt-product-table tr,
  .wpt-product-table td {
    display: block;
    width: 100%;
  }

  .wpt-product-table tr {
    border: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(17, 17, 17, 0.08);
    margin-bottom: 16px;
    padding: 10px 12px;
  }

  .wpt-product-table td {
    border: none;
    border-bottom: 1px solid #ececec;
    padding: 8px 0;
    box-shadow: none;
  }

  .wpt-product-table td:last-child {
    border-bottom: none;
  }

  .wpt-product-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: #666;
  }

  .wpt-cell--image {
    width: 100%;
    white-space: normal;
  }

  .wpt-cell--actions .wpt-actions-form {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
  }

  .wpt-actions-wrap,
  .wpt-actions-wrap.vinderen-m2-qty-wrap {
    flex-direction: column !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 12px !important;
  }

  .wpt-actions-wrap .uuc-inputs-wrapper {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-direction: row !important;
    gap: 12px !important;
    justify-content: center;
  }

  .wpt-actions-wrap .uuc-inputs-wrapper .uuc-input-block {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }

  .wpt-actions-wrap .uuc-inputs-wrapper:has(.uuc-active) .uuc-input-block,
  .wpt-actions-wrap .uuc-inputs-wrapper .uuc-unit-calculator.uuc-active {
    flex: 1 1 50% !important;
    max-width: 50% !important;
  }

  .wpt-actions-wrap .uuc-inputs-wrapper .quantity,
  .wpt-actions-wrap .uuc-inputs-wrapper .uuc-m2-qty-control {
    max-width: 100% !important;
    width: 100% !important;
  }

  .wpt-actions-wrap button.wpt-actions-add {
    width: 100% !important;
    max-width: 100% !important;
    align-self: stretch !important;
    margin-top: 6px !important;
  }
}

/* Discount Badge Styling */
.wpt-discount-badge {
  display: inline-block;
  background-color: #e53e3e;
  color: #ffffff;
  padding: 4px 8px;
  font-weight: 700;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}

/* Hide Prices Button Styling */
.wpt-price-toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  user-select: none;
}

.wpt-price-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1.5px solid #d1d5db;
  background-color: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.wpt-price-toggle-btn:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: #334155;
}

/* Active State (Prices and savings are hidden) */
body.wpt-prices-hidden .wpt-price-toggle-btn {
  border-color: var(--wpt-primary-color, #f36b21);
  background-color: rgba(243, 107, 33, 0.06);
  color: var(--wpt-primary-color, #f36b21);
  padding: 0;
  width: 36px;
}

body.wpt-prices-hidden .wpt-price-toggle-btn:hover {
  background-color: rgba(243, 107, 33, 0.1);
}

body.wpt-prices-hidden .wpt-price-toggle-text {
  display: none;
}

.wpt-icon-slashed-dollar {
  display: block;
}

.wpt-icon-slashed-dollar .strike-line {
  stroke: #ef4444; /* red line for the slash */
  opacity: 0.25;
  transition: opacity 0.2s ease;
}

body.wpt-prices-hidden .wpt-icon-slashed-dollar .strike-line {
  opacity: 1;
}

/* Hiding logic when toggle is active (hides sale price & discount, leaves catalog price) */
.wpt-prices-hidden .wpt-cell--sale_price,
.wpt-prices-hidden .wpt-cell--discount,
.wpt-prices-hidden th.wpt-th--sale_price,
.wpt-prices-hidden th.wpt-th--discount,
.wpt-prices-hidden .b2b-cart-savings-banner,
.wpt-prices-hidden #b2b-cart-savings-banner,
.wpt-prices-hidden [data-id*="cart"] .ct-amount,
.wpt-prices-hidden [data-id*="cart"] .amount,
.wpt-prices-hidden [data-id*="cart"] .b2b-price-net,
.wpt-prices-hidden [data-id*="cart"] .b2b-price-gross,
.wpt-prices-hidden .ct-header-cart .ct-amount,
.wpt-prices-hidden .ct-header-cart .amount,
.wpt-prices-hidden .ct-header-cart .b2b-price-net,
.wpt-prices-hidden .ct-header-cart .b2b-price-gross,
.wpt-prices-hidden .ct-cart-content .b2b-price-net,
.wpt-prices-hidden .ct-cart-content .b2b-price-gross,
.wpt-prices-hidden .ct-cart-content .amount,
.wpt-prices-hidden .header-cart .b2b-price-net,
.wpt-prices-hidden .header-cart .b2b-price-gross,
.wpt-prices-hidden .header-cart .amount,
.wpt-prices-hidden .cart-contents .amount,
.wpt-prices-hidden .widget_shopping_cart .amount,
.wpt-prices-hidden .widget_shopping_cart .b2b-price-net,
.wpt-prices-hidden .widget_shopping_cart .b2b-price-gross,
.wpt-prices-hidden .widget_shopping_cart .total,
.wpt-prices-hidden .summary .price ins,
.wpt-prices-hidden .single-product .price ins,
.wpt-prices-hidden .product .price ins,
.wpt-prices-hidden .b2b-product-price-details .your-price,
.wpt-prices-hidden .b2b-product-price-details .your-price * {
  display: none !important;
}