.txw-inventory {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 14px 10px;
}

.txw-search {
  max-width: 1040px;
  margin: 0 auto 22px;
  border: 1px solid #d8dde6;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.04);
}

.txw-search-meta {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 0 0 10px;
}

.txw-search-meta-right {
  font-size: 15px;
  color: #222;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.txw-results-count {
  font-weight: 700;
  color: #0b57d0;
}

.txw-search-version {
  font-size: 11px;
  opacity: .55;
  margin-left: 6px;
}

.txw-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  border: 1px solid #d7dbe2;
  border-radius: 10px;
  font-size: 16px;
  margin: 0;
  background: #fff;
}

.txw-search-input:focus {
  outline: none;
  border-color: #1259d6;
  box-shadow: 0 0 0 3px rgba(18, 89, 214, 0.10);
}

.txw-search-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 0;
}

.txw-toggle-filters,
.txw-clear-filters {
  appearance: none;
  border: 0;
  background: #1259d6;
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.txw-toggle-filters:hover,
.txw-clear-filters:hover {
  opacity: .94;
}

.txw-search.filters-collapsed .txw-filter-group,
.txw-search.filters-collapsed .txw-filter-actions {
  display: none;
}

.txw-filter-group {
  margin-top: 18px;
}

.txw-filter-label {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #222;
}

.txw-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.txw-filter-btn {
  appearance: none;
  border: 1px solid #cfd6df;
  background: #fff;
  color: #222 !important;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.txw-filter-btn:hover {
  border-color: #b7c0cb;
  background: #f8fafc;
}

.txw-filter-btn.is-active {
  background: #0b57d0;
  border-color: #0b57d0;
  color: #fff !important;
}

.txw-results {
  max-width: 1060px;
  margin: 0 auto;
}

.txw-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  column-gap: 16px;
  align-items: start;
  padding: 16px 18px;
  margin: 0 0 16px;
  border: 1px solid #e3e7ee;
  border-radius: 16px;
  background: #fff;
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(0,0,0,.035);
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}


.txw-row:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
  border-color: #d4dbe6;
  transform: translateY(-1px);
}

.txw-mainline {
  font-size: 17px;
  font-weight: 600;
  color: #1b1f24;
  margin-bottom: 8px;
  line-height: 1.35;
}

.txw-subline {
  font-size: 15px;
  color: #4b5563;
  line-height: 1.5;
}

.txw-divider {
  color: #9aa4b2;
  margin: 0 6px;
}

.txw-retail-wrap {
  color: #555;
}

.txw-row del {
  opacity: 0.9;
}

.txw-retail {
  color: #b00020;
}

.txw-sale {
  color: #0a7a2f;
  font-weight: 800;
}

.txw-row.is-hidden {
  display: none;
}

.txw-photos-link,
.txw-photos-link:visited,
.txw-photos-link:hover,
.txw-photos-link:focus {
  color: #0b57d0;
  text-decoration: underline;
}

.txw-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.txw-modal.is-open {
  display: flex;
}

.txw-modal-inner {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  max-width: 920px;
  width: calc(100% - 24px);
  max-height: 86vh;
  overflow: auto;
}

.txw-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.txw-modal-close {
  border: 0;
  background: #eee;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.txw-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.txw-thumb {
  width: 180px;
  display: block;
  flex: 0 0 180px;
}

.txw-thumb img {
  width: auto !important;
  max-width: 180px !important;
  max-height: 240px !important;
  height: auto !important;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  border: 1px solid #eee;
  background: #f7f7f7;
}

@media (max-width: 640px) {
  .txw-inventory {
    padding: 0 10px 10px;
  }

  .txw-search {
    padding: 14px;
    border-radius: 14px;
  }

  .txw-toggle-filters,
  .txw-clear-filters {
    width: 100%;
    justify-content: center;
  }

  .txw-search-actions {
    flex-direction: column;
  }

  .txw-filter-buttons {
    gap: 8px;
  }

  .txw-filter-btn {
    font-size: 13px;
    padding: 8px 12px;
  }

.txw-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 14px;
}

  .txw-mainline {
    font-size: 15px;
    line-height: 1.35;
  }

  .txw-subline {
    font-size: 14px;
    line-height: 1.45;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
  }

  .txw-divider {
    display: none;
    margin: 0 3px;
  }
}

.txw-row-image {
  width: 78px;
  min-width: 78px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.txw-row-body {
  min-width: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.txw-card-thumb-link,
.txw-card-thumb-link:hover,
.txw-card-thumb-link:focus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.txw-card-thumb {
  display: block;
  max-width: 78px;
  max-height: 130px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f7f7f7;
  object-fit: contain;
}

.txw-card-thumb-placeholder {
  opacity: 0.92;
}

@media (max-width: 640px) {
  .txw-row-image {
    width: 64px;
    min-width: 64px;
  }

  .txw-card-thumb {
    max-width: 64px;
    max-height: 110px;
  }
}

.txw-row[data-has-photos="1"] {
  cursor: pointer;
}

.txw-row[data-has-photos="1"]:hover .txw-mainline {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.txw-toggle-filters::after {
  content: "▾";
  margin-left: 8px;
  display: inline-block;
  transition: transform .2s ease;
}

.txw-search:not(.filters-collapsed) .txw-toggle-filters::after {
  transform: rotate(180deg);
}