/* (CSS unchanged — exact copy from original) */
.store-selector-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #f8f9fa;
  border: 1px solid #e2e4e7;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.store-selector-wrap label {
  white-space: nowrap;
  font-size: 14px;
}

#active-store-selector {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  min-width: 220px;
  cursor: pointer;
}

.store-selector-hint {
  font-size: 12px;
  color: #888;
}

.active-store-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: #fff;
  border: 1px solid #e2e4e7;
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 20px;
}

.active-store-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.active-store-name {
  font-weight: 600;
  font-size: 15px;
}

.active-store-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.4px;
}

.status-publish {
  /* background: #edfaef; */
  color: #1a7a2e;
}

.status-pending {
  background: #fff8e1;
  color: #b45309;
}

.status-draft {
  background: #f0f0f0;
  color: #666;
}

.store-edit-link {
  font-size: 13px;
  color: #2271b1;
  text-decoration: none;
  font-weight: 500;
}

.store-edit-link:hover {
  text-decoration: underline;
}

.store-products-container.is-loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s;
}

.spt-tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e8eaed;
  margin-bottom: 0;
  padding: 0;
  position: relative;
}

.spt-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
  white-space: nowrap;
  position: relative;
}

.spt-tab-btn:hover:not(.is-active) {
  color: #333;
  background: #f5f6f7;
}

.spt-tab-btn.is-active {
  color: #2271b1;
  font-weight: 700;
  border-bottom-color: #2271b1;
  background: #f0f6ff;
}

.spt-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  background: #e8eaed;
  color: #555;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transition:
    background 0.15s,
    color 0.15s;
}

.spt-tab-btn.is-active .spt-tab-count {
  background: #2271b1;
  color: #fff;
}

.spt-tab-panel {
  border: 1px solid #e8eaed;
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: #fff;
  padding: 20px;
  margin-bottom: 20px;
}

.spt-tab-panel[hidden] {
  display: none;
}

#product-picker-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  align-items: center;
  justify-content: center;
}

#product-picker-modal.is-open {
  display: flex;
}

.ppm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.ppm-dialog {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: 92%;
  max-width: 960px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: ppm-slide-in 0.22s ease;
}

@keyframes ppm-slide-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ppm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.ppm-header-left h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}

.ppm-header-left p {
  margin: 0;
  font-size: 13px;
  color: #666;
}

.ppm-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  padding: 0;
  margin-left: 12px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.ppm-close:hover {
  color: #333;
}

.ppm-search-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  background: #fafafa;
  flex-wrap: wrap;
}

.ppm-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 200px;
  min-width: 160px;
}

.ppm-search-icon {
  position: absolute;
  left: 11px;
  color: #aaa;
  pointer-events: none;
  flex-shrink: 0;
}

#ppm-search {
  width: 100%;
  padding: 9px 34px 9px 36px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 13.5px;
  background: #fff;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  box-sizing: border-box;
}

#ppm-search:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.ppm-search-clear {
  position: absolute;
  right: 9px;
  background: none;
  border: none;
  font-size: 17px;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.12s;
}

.ppm-search-clear:hover {
  color: #333;
}

.ppm-filter-wrap {
  flex-shrink: 0;
}

.ppm-filter-select {
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: #444;
  cursor: pointer;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  appearance: auto;
  max-width: 160px;
}

.ppm-filter-select:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.ppm-filter-select.has-value {
  border-color: #2271b1;
  background: #f0f6ff;
  color: #1a5a9a;
  font-weight: 500;
}

.ppm-reset-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  border: 1.5px solid #e0bfbf;
  border-radius: 8px;
  background: #fff5f5;
  color: #c0392b;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  flex-shrink: 0;
}

.ppm-reset-btn:hover {
  background: #fdecea;
  border-color: #c0392b;
}

.ppm-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 24px 0;
  flex-shrink: 0;
}

.ppm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 12px;
  background: #e8f0fb;
  border: 1px solid #b8d0f0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #1a5a9a;
}

.ppm-chip-remove {
  background: none;
  border: none;
  font-size: 14px;
  color: #5a87c8;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.12s;
}

.ppm-chip-remove:hover {
  color: #c0392b;
}

.ppm-results-meta {
  padding: 8px 24px 0;
  flex-shrink: 0;
}

#ppm-results-count {
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.ppm-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 8px;
}

.ppm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 13px;
}

.ppm-product-card {
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
  background: #fff;
  position: relative;
}

.ppm-product-card:hover {
  border-color: #2271b1;
  box-shadow: 0 4px 16px rgba(34, 113, 177, 0.15);
  transform: translateY(-2px);
}

.ppm-product-card.is-selected {
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.2);
}

.ppm-product-card.is-selected .ppm-card-check {
  display: flex;
}

.ppm-product-card.is-already-linked {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.ppm-card-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
  background: #f5f5f5;
}

.ppm-card-img-placeholder {
  width: 100%;
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ppm-card-img-placeholder svg {
  color: #ccc;
}

.ppm-card-body {
  padding: 8px 10px 10px;
}

.ppm-card-title {
  font-size: 12px;
  font-weight: 600;
  color: #222;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ppm-card-cat {
  font-size: 11px;
  color: #888;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ppm-card-already {
  font-size: 10px;
  font-weight: 600;
  color: #2271b1;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ppm-card-check {
  display: none;
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  background: #2271b1;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ppm-card-check svg {
  color: #fff;
}

.ppm-loading,
.ppm-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 40px 20px;
  color: #888;
}

.ppm-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #eee;
  border-top-color: #2271b1;
  border-radius: 50%;
  animation: ppm-spin 0.7s linear infinite;
  margin: 0 auto 12px;
}

@keyframes ppm-spin {
  to {
    transform: rotate(360deg);
  }
}

.ppm-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
  flex-wrap: wrap;
  background: #fafafa;
}

.ppm-page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid #ddd;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ppm-page-btn:hover:not(:disabled) {
  background: #f0f4ff;
  border-color: #2271b1;
  color: #2271b1;
}

.ppm-page-btn.is-active {
  background: #2271b1;
  border-color: #2271b1;
  color: #fff;
  font-weight: 700;
}

.ppm-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ppm-page-ellipsis {
  font-size: 14px;
  color: #aaa;
  padding: 0 2px;
  line-height: 36px;
}

.ppm-page-info {
  font-size: 12px;
  color: #888;
  margin-left: 8px;
}

.ppm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 24px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}

.ppm-selected-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.ppm-selected-thumb-wrap {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #eee;
  background: #f5f5f5;
}

#ppm-selected-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#ppm-selected-label {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ppm-footer-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.ppm-btn-cancel {
  padding: 9px 18px;
  border: 1px solid #ddd;
  border-radius: 7px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  color: #555;
  transition: background 0.15s;
}

.ppm-btn-cancel:hover {
  background: #f5f5f5;
}

.ppm-btn-confirm {
  padding: 9px 20px;
  border: none;
  border-radius: 7px;
  background: #2271b1;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    opacity 0.15s;
}

.ppm-btn-confirm:hover:not(:disabled) {
  background: #1a5a96;
}

.ppm-btn-confirm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ppm-message {
  margin: 0 24px 10px;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
  flex-shrink: 0;
}

.ppm-message.success {
  background: #edfaef;
  color: #1a7a2e;
  border: 1px solid #b3e6bc;
}

.ppm-message.error {
  background: #fdecea;
  color: #c0392b;
  border: 1px solid #f5c6c6;
}

.ppm-store-region-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #e8f4fd;
  color: #1a5a9a;
  border: 1px solid #b8d8f5;
  border-radius: 20px;
  padding: 2px 9px 2px 7px;
  font-size: 11.5px;
  font-weight: 600;
}

.ppm-header-state-note {
  font-size: 11.5px;
  color: #888;
  font-style: italic;
}

.badge-own-product {
  background: #f0f6ff;
  color: #2271b1;
  border: 1px solid #b8d0f0;
}

@media (max-width: 700px) {
  .spt-tab-btn {
    padding: 9px 13px;
    font-size: 13px;
  }

  .spt-tab-panel {
    padding: 14px;
  }

  .ppm-search-filter-bar {
    gap: 8px;
  }

  .ppm-filter-select {
    max-width: 130px;
    font-size: 12px;
  }

  .ppm-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .ppm-dialog {
    width: 100%;
    max-height: 100vh;
    border-radius: 14px 14px 0 0;
    align-self: flex-end;
  }

  #product-picker-modal.is-open {
    align-items: flex-end;
  }

  .ppm-pagination {
    gap: 4px;
  }

  .ppm-page-btn {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
  }
}
