.sw-ptoolbar {
  gap: 10px;
  margin-bottom: 18px;
}
.sw-psearch {
  border-color: #e5e8ec;
}

.sw-ptools {
  display: flex;
  gap: 10px;
}

.sw-pfilter {
  --bs-btn-padding-x: 0px;
  --bs-btn-padding-y: 0px;
  --bs-btn-bg: #fff;
  --bs-btn-border-color: #e5e8ec;
  --bs-btn-border-radius: 10px;
  --bs-btn-color: var(--sw-text);
  --bs-btn-hover-bg: #f7f7f9;
  --bs-btn-hover-color: var(--bs-btn-color);
  --bs-btn-hover-border-color: var(--bs-btn-border-color);
  --bs-btn-active-bg: var(--bs-btn-hover-bg);
  --bs-btn-active-color: var(--bs-btn-hover-color);
  --bs-btn-active-border-color: var(--bs-btn-hover-border-color);
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
  display: none;
  width: 40px;
  height: 36px;
}
.sw-pfilter svg {
  width: 16px;
  height: 16px;
  color: var(--sw-text-muted);
}

.sw-pimport:has(input:focus-visible) {
  box-shadow: var(--bs-btn-focus-box-shadow);
}

.sw-pview {
  gap: 2px;
  padding: 3px;
  background: #f2f2f6;
  border-radius: 8px;
}

.sw-pview__btn {
  --bs-btn-padding-x: 6px;
  --bs-btn-padding-y: 1px;
  --bs-btn-border-width: 0;
  --bs-btn-border-color: currentColor;
  --bs-btn-border-radius: 6px;
  --bs-btn-bg: transparent;
  --bs-btn-color: #667080;
  --bs-btn-hover-bg: transparent;
  --bs-btn-hover-color: #0f1020;
  --bs-btn-hover-border-color: currentColor;
  --bs-btn-active-bg: var(--bs-btn-hover-bg);
  --bs-btn-active-color: var(--bs-btn-hover-color);
  --bs-btn-active-border-color: currentColor;
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
  width: 34px;
  height: 30px;
  vertical-align: baseline;
}
.sw-pview__btn svg {
  width: 17px;
  height: 17px;
}

.sw-pview__btn.active {
  --bs-btn-bg: #fff;
  --bs-btn-color: #0f1020;
  --bs-btn-hover-bg: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.sw-pgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 16px;
}

.sw-pcard {
  --bs-card-border-color: var(--sw-violet);
  --bs-card-border-radius: 14px;
  min-width: auto;
  position: static;
  box-shadow: 0 6px 18px rgba(26, 26, 56, 0.07);
}

.sw-pcard__img {
  position: relative;
  height: 200px;
  background: #f2f2f7;
}

.sw-pbadge {
  --bs-badge-padding-x: 10px;
  --bs-badge-padding-y: 4px;
  --bs-badge-font-size: 10px;
  --bs-badge-font-weight: 700;
  line-height: var(--bs-body-line-height);
  display: inline-flex;
  position: absolute;
  top: 12px;
  left: 12px;
  letter-spacing: 0.02em;
}
.sw-pbadge--hot {
  background: #fce5e5;
  color: #d13d3d;
}
.sw-pbadge--new {
  background: #dbf5e5;
  color: #0f9966;
}
.sw-pbadge--trending {
  background: #f3f1fe;
  color: #6e5df8;
}
.sw-pbadge--premium {
  background: #fcf2d1;
  color: #b2850d;
}

.sw-pcard__bd {
  gap: 8px;
  padding: 12px 14px 14px;
}

.sw-pcard__nv {
  gap: 2px;
  min-width: 0;
}

.sw-pcard__name {
  font-size: 14px;
}

.sw-pcard__adv {
  font-size: 11.5px;
  color: #9499a8;
}

.sw-pcard__dist {
  gap: 5px;
  min-width: 0;
  color: #6b7280;
}
.sw-pcard__dist svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.sw-pcard__dist span {
  font-size: 11.5px;
  font-weight: 500;
}

.sw-pcard__meta {
  gap: 8px;
}

.sw-pcat {
  --bs-badge-padding-x: 10px;
  --bs-badge-padding-y: 4px;
  --bs-badge-font-size: 10px;
  --bs-badge-color: #667080;
  --bs-badge-font-weight: 700;
  line-height: var(--bs-body-line-height);
  background: #f0f2f7;
}

.sw-pcard__camp {
  font-size: 11.5px;
  font-weight: 500;
  color: #6b7280;
}

.sw-plist-wrap {
  --bs-border-color: #e5e8ed;
  --bs-border-radius: 12px;
}
.sw-plist {
  width: 100%;
  min-width: 1050px;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
}
.sw-plist thead th {
  height: 42px;
  padding: 0 16px 0 0;
  background: #f8f8fa;
  font-size: 12px;
  font-weight: 600;
  color: #8c919e;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
.sw-plist thead th:first-child {
  padding-left: 16px;
}

.sw-plist th.sw-plc--dist {
  width: 220px;
}
.sw-plist th.sw-plc--cat {
  width: 120px;
}
.sw-plist th.sw-plc--camp {
  width: 120px;
}
.sw-plist th.sw-plc--badge {
  width: 130px;
}
.sw-plist th.sw-plc--actions {
  /* three 30px buttons + two 6px gaps + the cell inset */
  width: 118px;
}
.sw-plist tbody td {
  height: 72px;
  padding: 8px 16px 8px 0;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}
.sw-plist tbody td:first-child {
  padding-left: 16px;
}
.sw-plist tbody tr:last-child td {
  border-bottom: 0;
}

.sw-plrow__product {
  gap: 12px;
  min-width: 0;
}

.sw-plrow__img {
  width: 46px;
  height: 46px;
  background: #f2f2f7;
}

.sw-plrow__nv {
  gap: 2px;
  min-width: 0;
}

.sw-plrow__name {
  white-space: nowrap;
  overflow: hidden;
  gap: 8px;
  font-size: 15px;
}

.sw-plrow__adv {
  font-size: 13px;
  color: #8c919e;
}

.sw-plist .sw-pbadge {
  position: static;
  flex-shrink: 0;
}

.sw-plrow__dist {
  gap: 5px;
  min-width: 0;
  padding-right: 10px;
  color: #6b7280;
}
.sw-plrow__dist svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.sw-plrow__dist span {
  font-size: 11.5px;
  font-weight: 500;
}

.sw-plrow__camp {
  font-size: 14px;
  color: #6b7280;
}

.sw-plist .sw-plc--badge .sw-pbadge {
  font-size: 11px;
  font-weight: 600;
}
.sw-plrow__nobadge {
  color: #c3c8d4;
  font-size: 13px;
}

.sw-plrow__actions {
  gap: 6px;
}

/* neutral tint only — the danger variant must keep its red background */
.sw-plrow__actions .sw-uact:not(.sw-uact--danger) {
  --bs-btn-bg: #f7f7fa;
  --bs-btn-hover-bg: #eceef2;
}

.sw-fgroup + .sw-fgroup {
  margin-top: 18px;
}

.sw-cp__head {
  --bs-border-color: #e5e8ed;
  padding: 20px 24px 16px;
}

.sw-cp__head-top {
  gap: 12px;
  margin-bottom: 12px;
}

.sw-cp__crumb {
  gap: 6px;
  font-size: 11.5px;
}

.sw-cp__crumb a {
  color: var(--sw-violet);
}
.sw-cp__crumb span {
  color: #9499a8;
  font-weight: 500;
}

.sw-cp__close {
  --bs-btn-padding-x: 6px;
  --bs-btn-padding-y: 1px;
  --bs-btn-border-width: 0;
  --bs-btn-border-color: currentColor;
  --bs-btn-border-radius: 8px;
  --bs-btn-bg: #f0f2f5;
  --bs-btn-color: #0f1020;
  --bs-btn-hover-bg: #e7eaef;
  --bs-btn-hover-color: #0f1020;
  --bs-btn-hover-border-color: currentColor;
  --bs-btn-active-bg: var(--bs-btn-hover-bg);
  --bs-btn-active-color: var(--bs-btn-hover-color);
  --bs-btn-active-border-color: currentColor;
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
  width: 30px;
  height: 30px;
}
.sw-cp__close svg {
  width: 15px;
  height: 15px;
}

.sw-cp__title {
  font-size: 18px;
}
.sw-cp__sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #9499a8;
  line-height: 1.4;
}

.sw-cp-seg-wrap {
  --bs-border-color: #f0f1f4;
  padding: 14px 24px;
}
.sw-cp-seg-wrap .sw-seg {
  width: 100%;
}
#addProductModal .sw-seg__btn {
  height: 40px;
  font-size: 14px;
  padding: 1px 6px;
}
#addProductModal .sw-seg__btn.active {
  color: var(--sw-text);
}

/* Reassert only on INACTIVE tabs — clicking a tab focuses it, and this must not
   repaint the active tab (its .active rule beats .nav-link:focus on its own). */
#addProductModal .sw-seg__btn:hover:not(.active):not(.is-active),
#addProductModal .sw-seg__btn:focus:not(.active):not(.is-active) {
  color: var(--sw-text-muted);
}

#addProductModal .sw-cp-tabs,
#addProductModal .tab-pane.active {
  display: contents;
}

.sw-cp__body {
  flex: 1;
  gap: 16px;
  padding: 18px 24px;
}

.sw-cp-field {
  gap: 7px;
  min-width: 0;
}

.sw-cp-label {
  gap: 3px;
  font-size: 12.5px;
  color: #2b3345;
}
.sw-cp-label .sw-req {
  color: #d13d3d;
}

.sw-cp-control {
  position: relative;
}
.sw-cp-control__input {
  --bs-border-color: #e0e5ed;
  --bs-border-radius: 10px;
  padding: 9.875px 14px;
  font-size: 13.5px;
}
.sw-cp-control__input:focus {
  outline: 0;
  border-color: var(--sw-violet);
  box-shadow: 0 0 0 3px rgba(110, 93, 248, 0.15);
}
.sw-cp-control__input::placeholder {
  color: #9ea3ad;
}
.sw-cp-control--icon .sw-cp-control__input {
  padding-left: 40px;
}
.sw-cp-control__ic {
  position: absolute;
  left: 13px;
  top: 13px;
  width: 16px;
  height: 16px;
  color: #9499a8;
  pointer-events: none;
}

.sw-cp-row {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sw-cp-row > * {
  min-width: 0;
}

textarea.sw-cp-textarea {
  min-height: 88px;
}

.sw-cp-textarea {
  --bs-border-color: #e0e5ed;
  --bs-border-radius: 10px;
  padding: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  resize: vertical;
}
.sw-cp-textarea:focus {
  outline: 0;
  border-color: var(--sw-violet);
  box-shadow: 0 0 0 3px rgba(110, 93, 248, 0.15);
}
.sw-cp-textarea::placeholder {
  color: #9ea3ad;
}

.sw-cp__body .sw-dd--field .sw-dd__toggle {
  --bs-btn-border-color: #e0e5ed;
  height: 42px;
}

.sw-cp-dd-lead {
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.sw-cp-dd-lead > svg {
  width: 16px;
  height: 16px;
  color: #9499a8;
  flex-shrink: 0;
}

.sw-cp-active {
  --bs-border-color: #e5e8ed;
  --bs-border-radius: 10px;
  gap: 14px;
  padding: 12px 14px;
  background: #fbfcfe;
}
.sw-cp-active__tx {
  min-width: 0;
}

.sw-cp-active__title {
  font-size: 13px;
}
.sw-cp-active__sub {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: #9499a8;
}

.sw-cp__foot {
  --bs-border-color: #e5e8ed;
  gap: 10px;
  padding: 16px 24px 20px;
  background: #fbfcfe;
}

/* =========================
  Responsive
========================= */
@media (max-width: 1279.98px) {
  .sw-pgrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .sw-pgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .sw-ptoolbar {
    flex-wrap: wrap;
  }
  .sw-psearch {
    flex: 1 1 100%;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .sw-plist {
    min-width: 0;
  }
  .sw-plist thead th {
    padding-right: 10px;
  }
  .sw-plist tbody td {
    padding-right: 10px;
  }
  .sw-plist th.sw-plc--dist {
    width: 150px;
  }
  .sw-plist th.sw-plc--cat {
    width: 92px;
  }
  .sw-plist th.sw-plc--camp {
    width: 96px;
  }
  .sw-plist th.sw-plc--badge {
    width: 100px;
  }
  .sw-plist th.sw-plc--actions {
    width: 114px;
  }
  .sw-plrow__name {
    font-size: 14px;
  }

  .sw-plrow__nv {
    min-width: 0;
  }
  .sw-plrow__name .sw-pbadge {
    display: none;
  }
  .sw-plrow__adv {
    font-size: 12px;
  }
  .sw-plrow__camp {
    font-size: 12.5px;
  }
}

@media (max-width: 767.98px) {
  .sw-plist,
  .sw-plist tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .sw-plist thead {
    display: none;
  }
  .sw-plist tbody tr {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f2f5;
  }
  .sw-plist tbody tr:last-child {
    border-bottom: 0;
  }
  .sw-plist tbody td {
    display: block;
    height: auto;
    padding: 0;
    border: 0;
  }
  .sw-plist tbody td[data-label] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .sw-plist tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9499a8;
    flex-shrink: 0;
  }

  .sw-plist td.sw-plc--actions {
    position: absolute;
    top: 14px;
    right: 16px;
  }
  .sw-plrow__product {
    padding-right: 126px;
  }
  .sw-plrow__name .sw-pbadge {
    display: none;
  }

  .sw-plrow__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sw-plrow__name {
    font-size: 14px;
  }
}

@media (min-width: 768px) {
  #addProductModal .sw-sheet__grip {
    display: none;
  }
}
@media (max-width: 767.98px) {
  .sw-ptools {
    display: none;
  }
  .sw-pfilter {
    display: inline-flex;
  }
  .sw-pgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }
  .sw-pcard__img {
    height: 150px;
  }

  .sw-cp__foot .sw-btn-ghost,
  .sw-cp__foot .sw-btn-primary {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
@media (max-width: 380px) {
  .sw-pgrid {
    grid-template-columns: 1fr;
  }
}

.sw-pcard__img {
  overflow: hidden;
  border-radius: calc(
      var(--bs-card-border-radius) - var(--bs-card-border-width)
    )
    calc(var(--bs-card-border-radius) - var(--bs-card-border-width)) 0 0;
}

.sw-pkebab {
  position: absolute;
  top: 10px;
  right: 10px;
}
.sw-pkebab__btn {
  --bs-btn-padding-x: 0px;
  --bs-btn-padding-y: 0px;
  --bs-btn-border-width: 0px;
  --bs-btn-border-color: transparent;
  --bs-btn-bg: #fff;
  --bs-btn-color: #2b3345;
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-color: var(--sw-violet);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-bg: var(--bs-btn-hover-bg);
  --bs-btn-active-color: var(--bs-btn-hover-color);
  --bs-btn-active-border-color: transparent;
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(15, 16, 32, 0.18);
}
.sw-pkebab__btn svg {
  width: 16px;
  height: 16px;
}

.sw-pkebab__menu {
  --bs-dropdown-min-width: 160px;
  --bs-dropdown-padding-x: 6px;
  --bs-dropdown-padding-y: 6px;
  --bs-dropdown-border-color: var(--sw-border);
  --bs-dropdown-border-radius: 12px;
  --bs-dropdown-box-shadow: 0 14px 36px rgba(15, 16, 32, 0.16);
  --bs-dropdown-link-color: var(--sw-text);
  --bs-dropdown-link-hover-bg: #f5f4fe;
  --bs-dropdown-link-hover-color: var(--sw-text);
  --bs-dropdown-link-active-bg: #f5f4fe;
  --bs-dropdown-link-active-color: var(--sw-text);
  --bs-dropdown-font-size: 14px;
  margin-top: 6px;
}
.sw-pkebab__menu .dropdown-item {
  border-radius: 8px;
  cursor: pointer;
}
.sw-pkebab__menu .dropdown-item.text-danger:hover,
.sw-pkebab__menu .dropdown-item.text-danger:focus {
  background-color: #fef2f2;
}

.sw-plist-card {
  --bs-border-radius: 14px;
  overflow: visible;
}
.sw-plist__foot {
  padding: 12px 16px;
  border-top: 1px solid var(--sw-border);
}
.sw-plist__count {
  font-size: 13px;
  color: var(--sw-text-muted);
}
.sw-prpp {
  font-size: 13px;
}

#viewProductModal.modal {
  --bs-modal-width: 700px;
}

#viewProductModal .sw-vd__body {
  padding-bottom: 0;
}
#viewProductModal .sw-vd__foot {
  border-top: 0;
}

#viewProductModal .sw-vd__sub {
  color: #9499a8;
}
#viewProductModal .sw-vd-row__k {
  color: #9499a8;
}

#viewProductModal .sw-vd-table tbody td {
  color: #6b7280;
}
/* the Type column is the one dark cell in the row */
#viewProductModal .sw-vd-table tbody td:nth-child(2) {
  color: #0f1020;
}

#viewProductModal .sw-vd-table th:first-child {
  width: 46.4%;
}
#viewProductModal .sw-vd-table th:nth-child(2) {
  width: 16.7%;
}
#viewProductModal .sw-vd-table th:nth-child(3) {
  width: 18.6%;
}

.sw-ep__title-row {
  gap: 10px;
}

.sw-ep__status {
  --bs-badge-font-size: 11.5px;
  letter-spacing: normal;
}

#editProductModal .sw-cp__foot {
  flex-wrap: wrap;
  row-gap: 10px;
}
#editProductModal .sw-cp__foot .btn {
  white-space: nowrap;
}
