/* Products screens. Reuses labwolf-os.css (woo-product, woo-row-actions, woo-thumb, woo-toggle) and xtazy.css. */

/* list */
.xp-sub { display: block; font-size: 11px; color: #656b60; margin-top: 2px; font-weight: 400; }
.xp-flag { display: block; font-size: 11px; color: var(--xz-warn, #9a5b00); margin-top: 3px; }
.xp-name { font-weight: 600; }
.xp-row-actions { gap: 2px 14px; }
.xp-row-actions .xp-danger-link { color: var(--xz-bad, #b42318); }
.xp-hide-wide { display: none; }
.page-heading .xp-add { font-size: 13px; }

/* editor: two equal columns for English / Spanish */
.xp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.xp-pair label, .woo-product-side label:not(.woo-toggle) { display: grid; gap: 6px; }
.xp-pair small, .woo-product-side label small { font-weight: 400; color: #656b60; }
.xp-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.xp-fieldset legend { font-size: 13px; font-weight: 550; padding: 0; margin-bottom: 6px; }
.xp-checks { display: grid; gap: 2px; }
.xp-checks .woo-toggle, .woo-product .woo-toggle { min-height: 40px; display: flex; align-items: center; gap: 10px; }
.woo-product .woo-toggle input { width: 18px; height: 18px; flex: none; }
.xp-warn { margin: 0; border-color: #f2d6a2 !important; background: #fff8eb !important; }
.xp-warn[hidden] { display: none; }
.xp-lock { margin: 0 0 4px; }
.xp-save { display: flex; flex-wrap: wrap; gap: 8px; }
.xp-status:empty, .xp-progress:empty { display: none; }
.xp-status, .xp-progress { font-size: 12px; color: #40413e; margin: 0; }
.xp-hold { display: grid; gap: 8px; }
.xp-hold[hidden], [data-brand][hidden] { display: none; }
[data-brand] { display: grid; gap: 8px; }

/* photos */
.xp-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.xp-photo { position: relative; aspect-ratio: 1; padding: 0; border: 1px solid var(--os-line, #e1e4dc); border-radius: 9px; overflow: hidden; cursor: pointer;
  background: #f6f6f3 repeating-conic-gradient(#efefea 0 25%, #f8f8f5 0 50%) 0 0 / 16px 16px; }
.xp-photo:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.xp-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.xp-badge { position: absolute; left: 6px; top: 6px; background: #111210; color: #fff; font-size: 10px; font-weight: 600; padding: 3px 7px; border-radius: 999px; }
.xp-badge.xp-cut { top: auto; bottom: 6px; background: #e3f4e9; color: var(--xz-ok, #157347); }
.xp-remove { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fffe; font-size: 20px; line-height: 1; cursor: pointer; }
.xp-nophoto { margin: 0; font-size: 13px; color: var(--xz-warn, #9a5b00); }
.xp-drop { display: grid; gap: 4px; padding: 22px 16px; min-height: 40px; }
.xp-drop strong { font-size: 14px; color: #111210; }
.xp-drop.busy { opacity: .6; pointer-events: none; }
.xp-drop:focus-within { outline: 2px solid #2563eb; outline-offset: 2px; }
.xp-preview { width: 100%; max-height: 55vh; object-fit: contain; border-radius: 9px; background: #f6f6f3 repeating-conic-gradient(#efefea 0 25%, #f8f8f5 0 50%) 0 0 / 16px 16px; }
.xp-photo-actions { display: grid; gap: 8px; }
.xp-photo-actions .button { width: 100%; justify-content: center; margin: 0; }

/* categories & filters */
.xp-cat-body { display: grid; gap: 18px; }
.xp-styles { list-style: none; margin: 0; padding: 0; display: grid; }
.xp-styles li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--os-line, #e1e4dc); font-size: 13px; }
.xp-styles li:first-child { border-top: 0; }
.xp-style-btns { display: flex; gap: 6px; flex: none; }
.xp-es { color: #656b60; }
.xp-brand-list { display: grid; gap: 8px; }
.xp-brand-row { display: flex; align-items: center; gap: 10px; }
.xp-brand-row label { flex: 1; }
.xp-brand-row input { width: 100%; }
.xp-brand-row small { color: #656b60; white-space: nowrap; }

/* phones */
@media (max-width: 760px) {
  .xp-pair { grid-template-columns: 1fr; gap: 10px; }
  .xp-hide-sm { display: none; }
  .xp-hide-wide { display: inline; }
  .xp-row-actions { gap: 0 4px; font-size: 13px; }
  .xp-row-actions a, .xp-row-actions button { padding: 11px 6px !important; min-height: 40px; box-sizing: border-box; display: inline-flex !important; align-items: center; }
  .xp-styles li { flex-wrap: wrap; }
  .xp-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading .xz-actions { width: 100%; }
  .page-heading .xz-actions .button { flex: 1 1 auto; justify-content: center; }
  .xp-save .button { flex: 1 1 auto; justify-content: center; }
}

/* phones: the product table becomes a stack of cards, so nothing scrolls sideways */
@media (max-width: 760px) {
  [data-xz-table="products"] .os-table-scroll { overflow: visible; }
  [data-xz-table="products"] table, [data-xz-table="products"] tbody { display: block; width: 100%; min-width: 0 !important; }
  [data-xz-table="products"] thead { display: none; }
  [data-xz-table="products"] tr { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; padding: 12px 14px; border-top: 1px solid var(--os-line, #e1e4dc); }
  [data-xz-table="products"] td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; white-space: normal; }
  [data-xz-table="products"] td.woo-thumb { grid-row: span 2; width: auto; }
  [data-xz-table="products"] td.xp-hide-sm { display: none; }
  [data-xz-table="products"] td:last-child { grid-column: 2; margin-top: 4px; }
  [data-xz-table="products"] .xp-name { white-space: normal; }
}
.xp-warn[hidden] { display: none !important; }

/* phones: a save button that stays at the bottom of the screen */
.xp-mobilebar { display: none; }
@media (max-width: 1000px) {
  .xp-mobilebar { display: block; position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #ffffffee; border-top: 1px solid var(--os-line, #e1e4dc); }
  .xp-mobilebar .button { width: 100%; justify-content: center; margin: 0; min-height: 44px; }
}
