/* =========================================================
   PRODUCTS LIST – Naleng AutoPOS
   Mobile-first | Finger-friendly | Modal-safe | Consistent UI
========================================================= */

/* =========================
   HEADER
========================= */
.products-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
}

/* =========================
   TOOLBAR
========================= */
.pos-products-toolbar{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  margin-top:10px;
}

/* =========================
   SEARCH (CONSISTENT WITH CUSTOMERS)
========================= */
.pos-products-search{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-radius:16px;
  background:var(--panel);
  border:1px solid var(--line);
  box-shadow:var(--shadow2);
  flex:1;
  min-width:min(520px, 100%);
}

.pos-products-search i{
  color:var(--muted);
  font-size:1rem;
}

.pos-products-search input{
  border:0;
  outline:none;
  width:100%;
  background:transparent;
  font-size:.95rem;
  font-weight:600;
  color:var(--text);
}

.pos-products-search input::placeholder{
  color:var(--muted);
  font-weight:500;
}

.pos-products-search:focus-within{
  border-color:var(--orange);
  box-shadow:0 0 0 3px rgba(255,122,24,.18);
}

/* =========================
   META
========================= */
.pos-products-meta{
  display:flex;
  gap:10px;
  align-items:center;
}

.meta-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel);
  box-shadow:var(--shadow2);
  font-weight:900;
  color:var(--text);
  white-space:nowrap;
}

.meta-pill i{ color:var(--orange); }

/* =========================
   TABLE
========================= */
.pos-products-table{ margin-top:4px; }

.pos-table th.num,
.pos-table td.num{ text-align:right; }

/* =========================
   TABLE ACTIONS
========================= */
.pos-row-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.pos-row-actions .icon-action{
  width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--panel);
  box-shadow:var(--shadow2);
  cursor:pointer;
  display:grid;
  place-items:center;
  color:var(--deep2);
  transition:transform .15s ease, color .15s ease;
}

.pos-row-actions .icon-action:hover{
  transform:translateY(-1px);
  color:var(--orange);
}

.pos-row-actions .icon-action.danger{
  color:#b91c1c;
}

.pos-row-actions .icon-action.danger:hover{
  color:#ef4444;
}

/* =========================
   MOBILE CARDS
========================= */
.pos-products-cards{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin-top:12px;
}

.product-card{
  border:1px solid var(--line);
  background:var(--panel);
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:12px;
}

.product-card-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}

.product-card-title{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.product-name{
  font-weight:950;
  font-size:.95rem;
  color:var(--text);
  line-height:1.15;
}

.product-sub{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  font-size:.78rem;
  font-weight:850;
  color:var(--muted);
}

.badge-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.55);
  font-weight:900;
  font-size:.78rem;
  color:var(--text);
}

/* KPI GRID */
.product-kpis{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:8px;
}

.kpi{
  border:1px solid var(--line);
  border-radius:14px;
  padding:8px 10px;
  background:rgba(255,255,255,.55);
}

.kpi .k{
  font-size:.72rem;
  font-weight:900;
  color:var(--muted);
}

.kpi .v{
  margin-top:2px;
  font-size:.88rem;
  font-weight:950;
  color:var(--text);
}

/* CARD ACTIONS */
.product-card-actions{
  margin-top:10px;
  display:flex;
  gap:10px;
  justify-content:center;
}

.product-card-actions .btn-action{
  min-width:52px;
  height:44px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--panel);
  box-shadow:var(--shadow2);
  display:grid;
  place-items:center;
  cursor:pointer;
  color:var(--deep2);
}

.product-card-actions .btn-action.danger{
  color:#b91c1c;
}

.product-card-actions .btn-action:active{
  transform:scale(.98);
}

/* =========================
   PAGINATION (FIXED)
========================= */
.pos-pagination{
  margin-top:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
}

.page-btn{
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--panel);
  box-shadow:var(--shadow2);
  display:grid;
  place-items:center;
  cursor:pointer;
  color:var(--deep2);
  transition:all .15s ease;
}

.page-btn i{ font-size:.9rem; }

.page-btn:hover:not(:disabled){
  transform:translateY(-1px);
  color:var(--orange);
}

.page-btn:active:not(:disabled){
  transform:scale(.96);
}

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

.page-info{
  font-size:.85rem;
  font-weight:800;
  color:var(--muted);
  padding:0 6px;
  white-space:nowrap;
}

/* =========================
   RESPONSIVE BEHAVIOR
========================= */
@media (min-width: 980px){
  .pos-products-cards{ display:none; }
  .pos-products-table{ display:block; }
  .pos-products-search{ max-width:520px; }
}

@media (max-width: 979px){
  .pos-products-table{ display:none; }
  .product-card{ padding:11px; }
  .product-name{ font-size:.92rem; }
  .kpi .v{ font-size:.86rem; }
}

@media (max-width: 640px){
  .pos-products-meta{
    width:100%;
    justify-content:flex-start;
  }
}

/* =========================
   MODALS (CONSISTENT)
========================= */
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(5,10,25,.45);
  backdrop-filter:blur(3px);
  z-index:1100;
}

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

.modal[aria-hidden="true"]{ display:none; }

.modal-card{
  width:min(560px, 92vw);
  max-height:90vh;
  overflow:auto;
  background:var(--panel);
  border-radius:18px;
  box-shadow:var(--shadow);
  animation:modalIn .18s ease;
}

@keyframes modalIn{
  from{ opacity:0; transform:translateY(8px) scale(.98) }
  to{ opacity:1; transform:none }
}

.modal-head,
.modal-foot{
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.modal-head{ border-bottom:1px solid var(--line); }
.modal-foot{ border-top:1px solid var(--line); }

.modal-title{
  font-weight:950;
  display:flex;
  align-items:center;
  gap:8px;
}

.modal-title i{ color:var(--orange); }
.modal-title.danger i{ color:#ef4444; }

.modal-body{ padding:16px; }

.icon-btn{
  border:0;
  background:none;
  cursor:pointer;
  font-size:1.1rem;
  color:var(--muted);
}

.icon-btn:hover{ color:var(--orange); }

.modal.modal-view .modal-card{ max-width:460px; }

/* DELETE MODAL */
.del-lead{ font-weight:900; margin-bottom:10px; }
.del-name{ font-weight:950; }
.del-sub{ color:var(--muted); font-weight:850; }
.del-warn{ margin-top:12px; font-weight:900; color:#b91c1c; }

/* MODAL BUTTONS */
.modal-foot .btn{
  padding:10px 14px;
  border-radius:12px;
  font-weight:950;
  cursor:pointer;
  border:0;
}

.modal-foot .btn.ghost{
  background:transparent;
  border:1px solid var(--line);
  color:var(--muted);
}

.modal-foot .btn{
  background:linear-gradient(135deg, var(--deep), var(--deep2));
  color:#fff;
}

.modal-foot .btn.danger{
  background:linear-gradient(135deg, #b91c1c, #ef4444);
  color:#fff;
}

/* =========================
   BULK DELETE (APPEND ONLY)
========================= */
.pos-bulk-bar{
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  padding:12px 14px;
  margin:10px 0;
  border-radius:14px;
  border:1px dashed #ef4444;
  background:rgba(239,68,68,.08);
  font-weight:900;
}

.pos-bulk-bar .btn{
  white-space:nowrap;
}

/* checkbox sizing for touch */
.product-check,
#selectAllProducts{
  width:18px;
  height:18px;
  cursor:pointer;
}

/* mobile cards checkbox */
.product-card input.product-check{
  position:absolute;
  top:12px;
  right:12px;
}

/* =========================================================
   BULK SELECT LABEL (NON-INTRUSIVE)
   Appended only – no layout break
========================================================= */

/* Wrap visual meaning for select-all without touching table */
.pos-products-table{
  position: relative;
}

/* Select-all helper label area */
.bulk-select-helper{
  display:flex;
  align-items:center;
  gap:10px;
  margin:10px 0 4px;
  padding-left:6px; /* aligns with table content */
  font-size:.82rem;
  font-weight:800;
  color:var(--muted);
}

/* Checkbox consistency */
.bulk-select-helper input{
  width:18px;
  height:18px;
  cursor:pointer;
}

/* Label emphasis */
.bulk-select-helper label{
  cursor:pointer;
  color:var(--text);
  font-weight:900;
}

/* Sub hint */
.bulk-select-helper .hint{
  font-weight:700;
  color:var(--muted);
  font-size:.78rem;
}

/* Keep clean on mobile */
@media (max-width: 640px){
  .bulk-select-helper{
    font-size:.78rem;
    gap:8px;
  }
}

