/* Catalog controls and responsive product tables. */
.price-manager-container, .price-controls-card, .price-table-wrapper,
.catalog-grid, .catalog-filter-bar, .pos-catalog-column { min-width: 0; }
.price-header-banner h3 { line-height: 1.35; }
.price-controls-card { gap: 1rem; }
#pmMetalPills, #catalogMetalPills, #posMetalPills,
#pmCategoryPills, #catalogCategoryPills, #categoryPillsContainer {
  flex-wrap: wrap; max-width: 100%; overflow: visible; gap: .5rem;
}
.cat-pill { min-height: 36px; line-height: 1.25; white-space: nowrap; }
.category-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.45rem; margin-left: .35rem; padding: .12rem .3rem;
  border-radius: 20px; background: rgba(100,116,139,.1); font-size: .68rem;
  font-variant-numeric: tabular-nums;
}
.cat-pill.active .category-count { background: rgba(255,255,255,.18); color: inherit; }
.selection-scope-hint { margin: 0; color: #475569; font-size: .8rem; line-height: 1.5; }
.price-bulk-strip { align-items: stretch; gap: .9rem; }
.price-bulk-strip > div { flex-wrap: wrap; min-width: 0; }
.price-bulk-strip > div:last-child { flex: 1 1 520px; justify-content: flex-end; }
.price-bulk-strip button { min-height: 42px; line-height: 1.35; justify-content: center; white-space: normal; }
.price-bulk-strip label { min-height: 40px; }
.price-bulk-strip input[type=checkbox], .price-data-table input[type=checkbox] {
  width: 20px !important; height: 20px !important; flex-shrink: 0; accent-color: #680c22;
}
.price-bulk-strip input[type=checkbox] { accent-color: #eab308; }
.pos-tab-pane :is(.btn-dock-action, .pos-search-btn, .btn-export-gold, .btn-single-sync, .btn-pos-charge) {
  min-height: 40px; line-height: 1.3; align-items: center; justify-content: center;
}
.pos-tab-pane button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.pos-tab-pane :is(button, input, select):focus-visible {
  outline: 3px solid #bc8190; outline-offset: 3px;
}
.price-table-wrapper .table-responsive { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.price-data-table { min-width: 1080px; table-layout: fixed; }
.price-data-table th { min-width: 0 !important; white-space: normal; line-height: 1.4; }
.price-data-table th:nth-child(1) { width: 4% !important; }
.price-data-table th:nth-child(2) { width: 19%; }
.price-data-table th:nth-child(3) { width: 10%; }
.price-data-table th:nth-child(4) { width: 12%; }
.price-data-table th:nth-child(5), .price-data-table th:nth-child(6), .price-data-table th:nth-child(7) { width: 11%; }
.price-data-table th:nth-child(8) { width: 10%; }
.price-data-table th:nth-child(9) { width: 12%; }
.price-data-table td:nth-child(2) > div > div { min-width: 0; }
.price-data-table td:nth-child(2) strong { overflow-wrap: anywhere; }
.price-data-table .input-proposed-price { width: 100%; min-width: 0; }
.price-data-table :is(th,td) { padding: .85rem .75rem; }
.price-data-table tbody tr:has(.chk-item-price:checked) { background: #fff5f7; }
.price-data-table input[type=number] { min-height: 36px; max-width: 130px; }
.price-data-table .btn-price-details { min-width: 36px; }
.price-data-table .btn-single-sync { padding: .45rem .65rem; font-size: .75rem; }
.price-data-table td:last-child { padding-left: .4rem; padding-right: .4rem; }
.price-data-table td:last-child > div { gap: .3rem !important; }
.price-data-table tbody img { object-fit: cover; flex-shrink: 0; }
.price-data-table td:last-child { white-space: nowrap; }
#pmPaginationWrap { gap: .85rem !important; }
#pmPaginationWrap :is(button,select) { min-height: 38px; }
.catalog-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding: 1rem 0; color: #475569; font-size: .85rem; }
.catalog-pagination[hidden], .catalog-pagination button[hidden] { display: none; }
.catalog-card-body { display: flex; flex-direction: column; min-width: 0; }
.catalog-card-body .btn-add-from-catalog { margin-top: auto !important; }
.catalog-card-title, .tile-title { overflow-wrap: anywhere; }
.catalog-card-sku-row { flex-wrap: wrap; overflow-wrap: anywhere; gap: .35rem; }
.catalog-card-specs-box { margin-bottom: .75rem; }
#catalogCountPill { white-space: normal; }
.catalog-section-heading { flex-wrap: wrap; }
.catalog-section-actions { flex-wrap: wrap; min-width: 0; }
.catalog-section-actions .pos-search-wrapper { max-width: 100%; }
.sidebar-scrim { display: none; }

@media (min-width: 1301px) {
  .price-data-table :is(th,td):last-child { position: sticky; right: 0; background: #fff; box-shadow: -2px 0 4px rgba(15,23,42,.04); z-index: 1; }
  .price-data-table thead th:last-child { background: #f8fafc; }
}
@media (max-width: 1300px) {
  .price-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
  .price-kpi-card { padding: 1rem; min-width: 0; }
  .price-header-banner { padding: 1rem !important; }
  .price-header-banner > div { min-width: 0; max-width: 100%; }
  .price-header-banner h3 { font-size: 1.1rem !important; }
  .price-bulk-strip > div:last-child { justify-content: flex-start; }
  .price-table-wrapper { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .price-table-wrapper .table-responsive { overflow: visible; }
  .price-data-table, .price-data-table tbody { display: block; min-width: 0; width: 100%; }
  .price-data-table thead { display: none; }
  .price-data-table tbody { display: grid; gap: 1rem; }
  .price-data-table tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); position: relative; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: .75rem; }
  .price-data-table td { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .35rem; text-align: left !important; min-width: 0 !important; padding: .65rem .45rem; overflow-wrap: anywhere; }
  .price-data-table td::before { content: attr(data-label); font-size: .65rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .025em; }
  .price-data-table td:first-child { position: absolute; top: .5rem; right: .5rem; padding: .4rem; }
  .price-data-table td:nth-child(2) { grid-column: 1 / -1; padding-right: 2.4rem; border-bottom: 1px solid #f1f5f9; }
  .price-data-table td:nth-child(2) > div { max-width: 100%; }
  .price-data-table td:nth-child(2) > div > div { min-width: 0; }
  .price-data-table td:first-child::before, .price-data-table td:nth-child(2)::before { display: none; }
  .price-data-table td:last-child { position: static; grid-column: 1 / -1; border-top: 1px solid #f1f5f9; align-items: stretch; }
  .price-data-table td:last-child > div { justify-content: flex-end; }
  .price-data-table td:last-child::before { display: none; }
  .price-data-table td[colspan] { grid-column: 1 / -1; position: static; }
  #pmPaginationWrap { margin-top: 1rem; border: 1px solid #e2e8f0; border-radius: 12px; }
}
@media (max-width: 768px) {
  #appSidebar { width: 260px; min-width: 260px; max-width: 85vw; transform: translateX(-105%); visibility: hidden; }
  #appSidebar.mobile-open { transform: translateX(0); visibility: visible; }
  .sidebar-scrim.open { display: block; position: fixed; inset: 0; z-index: 999; background: rgba(15,23,42,.4); border: 0; border-radius: 0; }
  .full-view-tab { padding: 1rem .75rem; }
  .price-manager-container { gap: .85rem; }
  .price-controls-card { padding: .85rem; }
  .price-bulk-strip { padding: .85rem; }
  .price-bulk-strip > div:last-child { display: grid !important; grid-template-columns: 1fr 1fr; width: 100%; gap: .5rem !important; }
  .price-bulk-strip button { padding: .6rem .5rem; font-size: .75rem; }
  #pmRatesTickerBadge { white-space: normal; line-height: 1.65; border-radius: 8px !important; width: 100%; }
  #btnExportGoldCsv { width: 100%; white-space: normal; }
  #posActiveRateNotice { line-height: 1.6; }
  .catalog-section-heading h3 { font-size: 1.1rem !important; }
  .catalog-section-actions { width: 100%; }
  .catalog-section-actions .pos-search-wrapper { flex: 1; min-width: 160px; }
  .catalog-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,250px),1fr)); gap: .85rem; }
  .catalog-pagination { align-items: stretch; }
  .catalog-pagination button { min-height: 44px; }
  .pos-metal-switcher-bar { padding: .65rem !important; }
}
@media (prefers-reduced-motion: reduce) {
  .cat-pill, .price-bulk-strip button, #appSidebar { transition: none; }
}

/* Store collections and product identification. */
.cat-pill[hidden], .collections-page [hidden] { display: none !important; }
.tile-sku { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.collection-filter-label { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin: .65rem 0; font-size: .8rem; font-weight: 700; color: #475569; }
.collection-filter-label select { max-width: 100%; min-width: 170px; min-height: 38px; border: 1px solid #cbd5e1; background: white; border-radius: 8px; padding: .45rem .65rem; color: #334155; }
.collections-page { width: 100%; max-width: 1240px; margin: 0 auto; color: #172033; }
.collections-heading, .collection-toolbar, .collection-actions, .collection-selection-bar, .collection-pagination, .collection-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.collections-heading { margin-bottom: 1.5rem; }
.collections-heading h2 { font-size: 1.5rem; }
.collections-heading p { color: #64748b; margin-top: .4rem; line-height: 1.5; }
.collections-page label:not(.collection-checkbox):not(.collection-product-row) { display: flex; flex-direction: column; gap: .4rem; font-size: .8rem; font-weight: 700; min-width: 0; }
.collections-page :is(input:not([type=checkbox]),select) { min-height: 42px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; padding: .65rem .75rem; width: 100%; min-width: 0; font: inherit; color: #172033; }
.collections-page :is(button,input,select):focus-visible { outline: 3px solid #bc8190; outline-offset: 2px; }
.collections-page button { min-height: 42px; padding: .6rem 1rem; border-radius: 8px; font-weight: 700; cursor: pointer; }
.collections-page .btn-pos-primary { background: #680c22; color: #fff; border: 1px solid #680c22; }
.collections-page .btn-dock-action { background: #fff; border: 1px solid #cbd5e1; color: #334155; }
.collection-checkbox { display: flex; align-items: center; gap: .55rem; font-size: .82rem; cursor: pointer; }
.collections-page input[type=checkbox] { width: 20px; height: 20px; accent-color: #680c22; flex: 0 0 auto; }
.custom-collection-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,280px),1fr)); gap: 1rem; margin: 1.25rem 0; }
.custom-collection-card { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 1.2rem; min-width: 0; }
.custom-collection-card h3 { margin: .5rem 0; font-size: 1rem; overflow-wrap: anywhere; }
.custom-collection-card p, .collection-pagination, #collectionSelectionCount { font-size: .8rem; color: #64748b; }
.collection-metal { font-size: .7rem; font-weight: 800; background: #f8f0e7; border-radius: 20px; padding: .25rem .6rem; }
.collection-empty { padding: 1.5rem; color: #64748b; line-height: 1.6; text-align: center; }
.collection-editor { background: #fff; border: 1px solid #d5b8c0; padding: 1.4rem; border-radius: 12px; margin: 1.5rem 0; scroll-margin-top: 1rem; }
.collection-editor h3 { margin-bottom: 1rem; }
.collection-editor fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.collection-editor-details { display: grid; grid-template-columns: minmax(0,3fr) minmax(120px,1fr); gap: 1rem; }
.collection-picker-filters { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr) auto; align-items: end; gap: 1rem; margin: 1.25rem 0; }
.collection-picker-filters .collection-checkbox { min-height: 42px; }
.collection-selection-bar { background: #f8fafc; border: 1px solid #e2e8f0; padding: .75rem; border-radius: 8px; }
.collection-product-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; margin: 1rem 0; }
.collection-product-row { display: flex; align-items: center; gap: .8rem; border: 1px solid #e2e8f0; border-radius: 8px; padding: .9rem; cursor: pointer; min-width: 0; }
.collection-product-row:has(input:checked) { border-color: #b47587; background: #fff5f7; }
.collection-product-row span { min-width: 0; overflow-wrap: anywhere; }
.collection-product-row strong, .collection-product-row small { display: block; font-size: .8rem; }
.collection-product-row small { color: #64748b; margin-top: .3rem; font-size: .73rem; }
.collection-editor-actions { justify-content: flex-end; border-top: 1px solid #e2e8f0; padding-top: 1rem; margin-top: 1rem; }
#btnDeleteCollection { margin-right: auto; color: #9f1239; }
.collection-error { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; border-radius: 8px; padding: .9rem; margin: 1rem 0; }
@media (max-width: 650px) {
 .collections-heading, .collection-toolbar { align-items: stretch; }
 .collection-editor { padding: .85rem; }
 .collection-editor-details, .collection-picker-filters, .collection-product-list { grid-template-columns: minmax(0,1fr); }
 .collection-pagination { justify-content: center; }
 .collection-pagination span { order: -1; width: 100%; text-align: center; }
 .collection-editor-actions button { flex: 1 1 auto; }
 .collection-toolbar > button { width: 100%; }
}

@media (max-width: 768px) {
  #appSidebar:not(.mobile-open), #appSidebar:not(.mobile-open) * { visibility: hidden !important; }
}

.checkout-huid-field { display:flex;flex-direction:column;gap:.25rem;margin-top:.55rem;font-size:.68rem;font-weight:700;color:#475569; }
.checkout-huid-field input { width:100%;min-height:36px;border:1px solid #cbd5e1;border-radius:6px;padding:.35rem .5rem;font-size:.8rem;text-transform:uppercase; }
.checkout-huid-field input:focus-visible { outline:2px solid #9f5067;outline-offset:1px; }
@media print {
  html, body { height:auto!important;min-height:0!important;overflow:visible!important; }
  body > :not(#invoiceModal) { display:none!important; }
  #invoiceModal { position:static!important;display:block!important;visibility:visible!important;opacity:1!important;overflow:visible!important;height:auto!important;min-height:0!important; }
  #invoiceModal .modal-container { transform:none!important;opacity:1!important;height:auto!important;max-height:none!important;overflow:visible!important; }
  #invoicePrintArea { height:auto!important;overflow:visible!important; }
  #invoicePrintArea .invoice-box { break-inside:auto!important;page-break-inside:auto!important; }
  #invoicePrintArea .inv-table tr { break-inside:avoid!important; }
}
