/* --- THUMB (miniatura) --- */
.wp-list-table th.column-thumb,
.wp-list-table td.column-thumb {
  width: 64px;
  text-align: center;
  vertical-align: middle;
}

.wp-list-table td.column-thumb img.alter-thumb {
  display: block;
  margin: 0 auto;
}

/* --- Embed links: do not inherit unrelated .column-links styles --- */
.wp-list-table th.column-alterEmbedLinks,
.wp-list-table td.column-alterEmbedLinks {
  width: auto; /* not 10% */
  vertical-align: middle;
  white-space: normal; /* pozwól na wrap */
}

/* Embed links cell: inline layout with clean wrapping */
.alter-embed-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  max-width: 100%;
}

/* “Pill”: link + ikonka */
.alter-embed-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid #dcdcde;
  border-radius: 999px;
  background: #fff;
  line-height: 1.2;
  white-space: nowrap;
}

/* Link w pilli */
.alter-embed-pill .alter-embed-link {
  text-decoration: none;
}

/* Small copy icon */
.alter-copy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
}

.alter-copy-icon .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  line-height: 16px;
  margin: 0;
}

.alter-copy-icon:hover {
  background: #f6f7f7;
}
.alter-copy-icon.is-copied {
  background: #edfaef;
}

/* Product: thumbnail + meta (always in primary column) */
.alter-product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.alter-thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
  flex: 0 0 auto;
  display: block;
}

.alter-thumb--empty {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #f6f7f7;
  border: 1px solid #dcdcde;
}

.alter-product-meta {
  min-width: 0;
}

.alter-product-name {
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.alter-product-sub {
  margin-top: 2px;
  color: #646970;
  font-size: 12px;
}

.alter-product-mockups {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alter-product-mockup-trigger {
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.alter-product-mockup-trigger:focus {
  outline: none;
  box-shadow: 0 0 0 2px #2271b1;
}

.alter-product-mockup-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.alter-product-preview-modal[hidden] {
  display: none;
}

.alter-product-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alter-product-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.alter-product-preview-dialog {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 420px);
  max-height: min(80vh, 420px);
  background: #fff;
  border-radius: 10px;
  border: 1px solid #dcdcde;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  padding: 12px;
}

.alter-product-preview-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.alter-product-preview-image {
  max-width: 100%;
  max-height: calc(min(80vh, 420px) - 24px);
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
}

body.alter-product-modal-open {
  overflow: hidden;
}

/* On narrow screens, let the name use full width */
@media (max-width: 782px) {
  .alter-product-name {
    max-width: none;
  }
}

/* === Stabilny layout kolumn WP_List_Table === */
/* Enforce practical layout: Created/Share narrow, Embed wide, Product medium */
.wp-list-table {
  table-layout: fixed; /* usually present in WP, but enforced here for stability */
  width: 100%;
}

.wp-list-table th.column-createdAt,
.wp-list-table td.column-createdAt {
  width: 170px;
  white-space: nowrap;
}

.wp-list-table th.column-shareAccess,
.wp-list-table td.column-shareAccess {
  width: 90px;
  white-space: nowrap;
}

.wp-list-table th.column-product,
.wp-list-table td.column-product {
  width: 320px; /* prevent Product column from consuming full table */
  white-space: normal;
}

.wp-list-table th.column-alterEmbedLinks,
.wp-list-table td.column-alterEmbedLinks {
  width: auto; /* remaining space for embed links */
  white-space: normal;
}

/* Ensure wrapping works correctly in table cells with table-layout: fixed */
.wp-list-table td.column-alterEmbedLinks,
.wp-list-table td.column-product {
  overflow: hidden;
}

/* Embed pills can wrap */
.alter-embed-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  max-width: 100%;
}

/* Truncate Product name instead of stretching layout */
.alter-product-name {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wp-list-table th.column-product,
.wp-list-table td.column-product {
  width: 260px;
}
