/* TPV: catálogo fluido, imágenes 1:1 y fidelización trazable. */
.pos-toolbar { flex-wrap: wrap; margin-bottom: 10px; }
.pos-toolbar .search { flex: 1 1 300px; max-width: none; }
.pos-stock-filter { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 39px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--ink); font: 600 11px inherit; cursor: pointer; user-select: none; }
.pos-stock-filter:hover { border-color: var(--lilac); background: var(--lilac-pale); }
.pos-stock-filter:has(input:checked) { border-color: var(--lilac); background: var(--lilac-pale); color: var(--accent-strong, #654d88); }
.pos-stock-filter input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent-strong, #654d88); cursor: pointer; }
.pos-family-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 6px; }
.pos-family-chip { border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); padding: 6px 10px; font: 600 10px inherit; cursor: pointer; }
.pos-family-chip:hover, .pos-family-chip.active { background: var(--lilac-pale); border-color: var(--lilac); color: var(--accent-strong, #654d88); }
.pos-results { min-height: 17px; margin: 0; color: var(--muted); font-size: 10px; }
.pos-catalog { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); grid-auto-flow: row; grid-auto-rows: minmax(242px, max-content); align-items: start; gap: 12px; }
.pos-item { display: flex; flex-direction: column; min-width: 0; min-height: 242px; height: max-content; padding: 9px; text-align: left; border-radius: 15px; overflow: hidden; }
.pos-product-media {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--line) 72%, rgba(255, 255, 255, .28));
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  position: relative;
  background: var(--product-shade, linear-gradient(145deg, var(--lilac-pale), var(--panel)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .64), inset 0 -26px 35px rgba(32, 39, 48, .055);
}
.pos-product-media::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 68%;
  height: 68%;
  left: 16%;
  top: 14%;
  border-radius: 50%;
  background: var(--product-shade, var(--lilac));
  opacity: .26;
  filter: blur(28px);
  transform: scale(1.08);
}
.pos-product-media::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), transparent 28%, transparent 67%, rgba(28, 35, 44, .09));
}
.pos-product-media img, .pos-product-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.pos-product-media img {
  z-index: 1;
  display: block;
  padding: clamp(13px, 9%, 20px);
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 12px 13px rgba(28, 35, 44, .16));
}
/* Las fotos de catálogo horizontales ocupan el mismo encuadre cuadrado sin dejar una caja blanca aislada. */
.pos-product-media.product-photo-wide img {
  padding: 0;
  object-fit: cover;
  mix-blend-mode: multiply;
  transform: scale(1.04);
}
.pos-product-media.product-photo-composed img {
  padding: 0;
  object-fit: cover;
}
.pos-product-media:has(img) .pos-product-fallback { z-index: 0; }
.pos-product-details { display: grid; gap: 7px; padding: 2px 2px 1px; }
.pos-item .pos-product-details > b { min-height: 30px; font-size: 12px; line-height: 1.3; }
.pos-product-fallback { padding: 12px; }
.pos-product-fallback b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-product-fallback small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pos-product-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pos-product-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-product-meta strong { margin: 0; white-space: nowrap; }
.pos-product-condition, .loyalty-condition { display: inline-flex; width: fit-content; border-radius: 999px; padding: 3px 6px; font-size: 9px; font-weight: 700; background: var(--lilac-pale); color: var(--accent-strong, #654d88); }
.pos-product-condition.offer, .loyalty-condition.offer { background: var(--pink-pale); color: #a34e6a; }
.pos-product-condition.excluded, .loyalty-condition.excluded { background: var(--sand); color: var(--muted); }
.demo-valid-pill { display: inline-flex; width: fit-content; border-radius: 999px; padding: 3px 6px; background: var(--sage-pale); color: #34725a; font-size: 9px; font-weight: 700; }
.discontinued-pill { display: inline-flex; width: fit-content; border-radius: 999px; padding: 3px 6px; background: var(--sand); color: var(--muted); font-size: 9px; font-weight: 700; }
.catalog-active-pill { display: inline-flex; border-radius: 999px; padding: 3px 6px; background: var(--sage-pale); color: #34725a; font-size: 9px; font-weight: 700; }
.product-edit-button { white-space: nowrap; }
.product-editor { min-width: min(470px, 100%); }
.product-editor-summary { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.product-editor-summary span { border-radius: 999px; background: var(--sand); color: var(--muted); padding: 5px 8px; font-size: 10px; font-weight: 700; }
.product-discontinued-switch { display: flex; justify-content: space-between; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 13px; padding: 13px; color: var(--ink); }
.product-discontinued-switch b, .product-discontinued-switch small { display: block; }
.product-discontinued-switch b { font-size: 12px; }
.product-discontinued-switch small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.product-discontinued-switch .switch { position: static; flex: 0 0 auto; }
.product-editor #product-visibility-note { margin-top: 13px; }
.pos-item:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.wallet-use-note { min-height: 15px; margin: -6px 0 9px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.wallet-discount-row { color: #35745b; margin-top: -3px; }
.total-row-final { padding-top: 8px; border-top: 1px solid var(--line); }
#customer-dialog { width: min(620px, calc(100vw - 28px)); max-width: calc(100vw - 28px); max-height: calc(100dvh - 28px); }
.customer-dialog { width: 100%; max-height: calc(100dvh - 28px); border: 0; border-radius: 22px; padding: clamp(20px, 2.2vw, 27px); background: var(--panel); color: var(--ink); box-shadow: 0 25px 70px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; }
.customer-dialog h2 { font: 700 22px "Playfair Display", serif; margin: 0 0 16px; }
.customer-picker-message { margin: -8px 0 14px; padding: 9px 11px; border-radius: 10px; background: var(--lilac-pale); color: var(--accent-strong, #654d88); font-size: 11px; line-height: 1.4; }
.customer-search { width: 100%; min-width: 0; margin-bottom: 12px; }
.customer-picker-list { display: grid; flex: 1 1 auto; min-height: 0; gap: 7px; max-height: min(52dvh, 430px); overflow: auto; padding-right: 3px; }
.customer-dialog .settings-editor-actions { flex: 0 0 auto; margin-bottom: 0; }
.customer-picker-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; background: var(--panel); color: var(--ink); text-align: left; cursor: pointer; }
.customer-picker-item:hover { border-color: var(--lilac); background: var(--lilac-pale); }
.customer-picker-item b, .customer-picker-item small { display: block; }
.customer-picker-item b { font-size: 12px; }
.customer-picker-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.customer-picker-item strong { border-radius: 999px; padding: 4px 7px; background: var(--sand); color: var(--accent-strong, #654d88); font-size: 9px; white-space: nowrap; }
.import-review, .price-review-warning, .catalog-import-notice { color: #98536b; font-size: 9px; line-height: 1.35; }
.import-review { display: inline-flex; width: fit-content; border-radius: 999px; padding: 3px 6px; background: var(--pink-pale); font-weight: 700; }
.table-panel .import-review { margin: 4px 0 0 auto; }
.product-load-row td { text-align: center; padding: 18px; }
.price-review-warning, .catalog-import-notice { margin: 9px 0; padding: 9px 11px; border-radius: 10px; background: var(--pink-pale); }
.catalog-import-notice { font-size: 11px; }
.checkout:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.pos-empty-results { grid-column: 1 / -1; padding: 35px 15px; margin: 0; text-align: center; color: var(--muted); font-size: 12px; }
.pos-load-more { grid-column: 1 / -1; justify-self: center; border: 1px solid var(--lilac); border-radius: 10px; padding: 9px 14px; background: var(--lilac-pale); color: var(--accent-strong, #654d88); font: 700 11px inherit; cursor: pointer; }
.pos-load-more:hover { transform: translateY(-1px); }
.cart-line { position: relative; align-items: flex-start; }
.cart-line-info { min-width: 0; flex: 1; }
.cart-line-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-line-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; }
.cart-line-tools label { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 9px; }
.cart-line-tools input, .ticket-points-control input, .points-unit-field input { width: 70px; min-height: 27px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; background: var(--panel); color: var(--ink); font: 600 10px inherit; text-align: right; }
.cart-line-tools button { min-width: 24px; height: 25px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); font: 700 12px inherit; cursor: pointer; }
.cart-line-tools button:hover { background: var(--sand); }
.cart-line-tools .cart-remove { color: #a34e6a; font-size: 10px; padding: 0 6px; }
.cart-line-points { color: var(--muted); font-size: 9px; }
.ticket-points-control { display: grid; grid-template-columns: 1fr auto; gap: 4px 9px; align-items: center; margin: 0 0 7px; color: var(--muted); font-size: 10px; }
.ticket-points-control small { grid-column: 1 / -1; font-size: 9px; color: var(--muted); }
.ticket-points-summary { display: flex; justify-content: space-between; margin: 8px 0; font-size: 11px; }
.ticket-points-summary strong { font-variant-numeric: tabular-nums; }
.loyalty-customer-warning { min-height: 14px; margin: 0 0 8px; color: #a34e6a; font-size: 9px; line-height: 1.35; }
.points-preview { display: grid; gap: 7px; }
.points-preview > span { color: var(--muted); font-size: 10px; }
.points-unit-field { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; }
.points-unit-field input { margin-left: 8px; }
.points-preview .text-button { width: fit-content; }
.points-preview strong { font-size: 11px; }
.wallet-credit { color: #34725a; }
.wallet-debit { color: #a34e6a; }
.demo-empty-row { padding: 18px; color: var(--muted); text-align: center; }
@media (max-width: 850px) { .pos-catalog { grid-template-columns: repeat(auto-fill, minmax(min(142px, 100%), 1fr)); grid-auto-rows: minmax(230px, max-content); gap: 10px; } .pos-item { min-height: 230px; padding: 8px; } .pos-product-details { gap: 5px; } .pos-item .pos-product-details > b { min-height: 27px; font-size: 11px; } }
@media (max-width: 650px) { #customer-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px); } .customer-dialog { max-height: calc(100dvh - 20px); border-radius: 18px; padding: 18px; } .customer-dialog h2 { font-size: 20px; } .customer-picker-list { max-height: min(49dvh, 380px); } .pos-catalog { grid-template-columns: repeat(auto-fill, minmax(min(128px, 100%), 1fr)); grid-auto-rows: minmax(216px, max-content); } .pos-item { min-height: 216px; padding: 7px; } .pos-product-media { border-radius: 10px; } }
@media (max-width: 650px) { .pos-toolbar .search { flex: 1 1 100%; min-width: 0; } .pos-stock-filter { width: 100%; justify-content: center; } }

/* TPV de escritorio: la página no se desplaza; solo se desplazan los listados. */
.pos-stock-sync { display: flex; align-items: center; gap: 9px; padding: 9px 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--sand); color: var(--ink); }
.pos-stock-sync-icon { display: grid; flex: 0 0 25px; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: var(--lilac-pale); color: var(--accent-strong, #654d88); font-weight: 700; }
.pos-stock-sync b, .pos-stock-sync small { display: block; }
.pos-stock-sync b { font-size: 10px; }
.pos-stock-sync small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.pos-stock-sync-state { margin-left: auto; padding: 4px 6px; border-radius: 99px; background: var(--pink-pale); color: #9b4c66; font-size: 9px; font-weight: 700; text-align: right; white-space: nowrap; }

@media (min-width: 1001px) and (min-height: 620px) {
  body.sales-workspace { overflow: hidden; }
  body.sales-workspace .main { padding-bottom: 0; overflow: hidden; }
  #sales.active { display: flex; height: calc(100dvh - 80px); min-height: 0; flex-direction: column; overflow: hidden; }
  #sales.active .page-heading { flex: 0 0 auto; margin: 17px 0 15px; }
  #sales.active .pos-layout { flex: 1 1 auto; min-height: 0; height: auto; align-items: stretch; }
  #sales.active .pos-products, #sales.active .cart { min-height: 0; height: 100%; }
  #sales.active .pos-products { display: flex; flex-direction: column; overflow: hidden; }
  #sales.active .pos-catalog { flex: 1 1 auto; min-height: 0; align-content: start; overflow: auto; overscroll-behavior: contain; padding: 1px 5px 14px 1px; scrollbar-gutter: stable; }
  #sales.active .cart { display: flex; flex-direction: column; overflow: hidden; }
  #sales.active .cart-head, #sales.active .cart-bottom { flex: 0 0 auto; }
  #sales.active .cart-lines { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
}

@media (max-width: 1000px), (max-height: 619px) {
  body.sales-workspace { overflow: auto; }
  #sales.active, #sales.active .pos-layout, #sales.active .pos-products, #sales.active .cart, #sales.active .pos-catalog, #sales.active .cart-lines { height: auto; min-height: initial; overflow: visible; }
  #sales.active .cart-lines { max-height: 360px; overflow: auto; }
  .pos-stock-sync { align-items: flex-start; }
  .pos-stock-sync-state { white-space: normal; }
}
