/* Sipariş (POS), tahsilat ve mutfak ekranı */

/* ---------- Siparişler ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s-4); align-items: start; }
@media (max-width: 1100px) { .pos { grid-template-columns: minmax(0, 1fr) 330px; } }
@media (max-width: 860px) { .pos { grid-template-columns: minmax(0, 1fr); } }
.pos-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-bottom: var(--s-3); }
@media (max-width: 720px) { .pos-filters { grid-template-columns: 1fr 1fr; } .pos-filters .pos-filters__cat { grid-column: 1 / -1; } }
.pos-search { margin-bottom: var(--s-3); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--s-3); }
@media (max-width: 520px) { .product-grid { grid-template-columns: 1fr 1fr; gap: var(--s-2); } }
.product-tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); margin: 0; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.product-tile:hover { border-color: var(--brand-200); box-shadow: var(--sh-2); }
.product-tile__img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--bg-sunken); display: block; border-bottom: 1px solid var(--line); }
.product-tile__ph { height: 58px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 18px; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
:root[data-theme="dark"] .product-tile__ph { background: var(--bg-sunken); }
.product-tile__body { padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.product-tile__name { font-weight: 700; line-height: 1.3; font-size: var(--fs-md); }
.product-tile__price { font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.product-tile__foot { margin-top: auto; display: grid; gap: var(--s-2); }
.product-tile details summary { font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 4px; }
.product-tile details summary::-webkit-details-marker { display: none; }
.product-tile textarea { min-height: 56px; font-size: var(--fs-sm); margin-top: 6px; }
@media (max-width: 520px) { .product-tile__img { aspect-ratio: 16 / 9; } .product-tile__body { padding: var(--s-2) var(--s-3) var(--s-3); } }
.product-tile[hidden] { display: none; }
.cart { position: sticky; top: calc(var(--topbar-h) + var(--s-4)); display: flex; flex-direction: column; gap: var(--s-4); }
@media (max-width: 860px) { .cart { position: static; } }
.cart__head { display: flex; justify-content: space-between; gap: var(--s-3); align-items: flex-start; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.cart__table { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.01em; }
.cart__total { font-size: var(--fs-2xl); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); text-align: right; line-height: 1.1; }
.cart__items { max-height: 46vh; overflow: auto; }
.cart__items li { padding: var(--s-3) var(--s-5); align-items: flex-start; }
.cart__name { font-weight: 700; }
.cart__note { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; display: flex; gap: 4px; align-items: center; }
.cart__price { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart__actions { display: grid; gap: var(--s-2); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.ready-panel .card__head { background: var(--warn-50); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.ready-panel .count { min-width: 26px; height: 26px; border-radius: 99px; background: var(--warn-600); color: #fff; font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; }
.ready-bulk { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); }
.ready-list { padding: var(--s-2) 0; }
.ready-item { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-2) var(--s-5); }
.ready-item label { flex: 1; display: flex; gap: var(--s-3); align-items: center; cursor: pointer; min-width: 0; }
.ready-item input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.ready-item__name { font-weight: 700; }
.ready-item__meta { font-size: var(--fs-xs); color: var(--text-3); }
.ready-group { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: var(--s-3) var(--s-5) var(--s-1); }
.ready-empty { padding: var(--s-5); text-align: center; color: var(--text-3); font-weight: 600; }
.cartbar { display: none; }
@media (max-width: 860px) {
  .cartbar { display: flex; position: fixed; left: var(--s-3); right: var(--s-3); bottom: calc(var(--bottomnav-h) + var(--s-3) + env(safe-area-inset-bottom)); z-index: 45; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); background: var(--n-900); color: #fff; box-shadow: var(--sh-3); font-weight: 700; }
  .cartbar:hover { text-decoration: none; }
  .cartbar b { font-variant-numeric: tabular-nums; }
}

/* ---------- Tahsilat ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s-4); align-items: start; }
@media (max-width: 960px) { .checkout { grid-template-columns: minmax(0, 1fr); } }
.items-table td:first-child, .items-table th:first-child { width: 44px; }
.items-table input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--primary); }
.items-table tr.paid-item td { color: var(--text-3); }
.items-table tr.paid-item .cell-title { text-decoration: line-through; text-decoration-color: var(--text-3); }
.pay-summary { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.pay-summary div { padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--bg-sunken); }
.pay-summary .label { font-size: var(--fs-xs); font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.pay-summary .value { font-size: var(--fs-xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-summary .is-due { background: var(--warn-50); color: var(--warn-700); }
.pay-summary .is-done { background: var(--ok-50); color: var(--ok-700); }
.split-info { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.amount-input { font-size: var(--fs-2xl) !important; font-weight: 800; font-variant-numeric: tabular-nums; min-height: 56px !important; }
.done-box { text-align: center; padding: var(--s-6) var(--s-5); }
.done-box .empty__icon { background: var(--ok-50); color: var(--ok-600); }

/* ---------- Mutfak ---------- */
.kds-bar { display: flex; gap: var(--s-2); align-items: center; justify-content: space-between; flex-wrap: wrap; padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); }
.kds-bar .sel-count { color: var(--text-2); font-weight: 700; font-size: var(--fs-sm); }
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-4); align-items: start; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.ticket__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4); background: var(--brand-900); color: #fff; }
.ticket__table { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.01em; }
.ticket__meta { font-size: var(--fs-xs); color: #b8c6e8; font-weight: 600; }
.ticket__age { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: var(--fs-sm); padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.14); }
.ticket__age.is-late { background: var(--bad-600); }
.ticket__age.is-warm { background: var(--warn-600); }
.ticket__item { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.ticket__item:last-child { border-bottom: 0; }
.ticket__item input[type=checkbox] { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.ticket__name { font-weight: 800; font-size: var(--fs-lg); line-height: 1.3; }
.ticket__qty { display: inline-flex; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 800; align-items: center; justify-content: center; margin-right: 6px; font-variant-numeric: tabular-nums; }
.ticket__note { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--warn-50); color: var(--warn-700); font-weight: 700; font-size: var(--fs-sm); display: flex; gap: 6px; align-items: flex-start; }
.ticket__item form { margin-left: auto; }
.kds-toast { position: fixed; top: calc(var(--topbar-h) + 12px); left: 50%; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; z-index: 90; padding: var(--s-3) var(--s-5); border-radius: var(--r-lg); background: var(--ok-600); color: #fff; font-weight: 800; box-shadow: var(--sh-3); display: flex; gap: var(--s-2); align-items: center; transition: all .25s var(--ease); }
.kds-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Tahsilat kalemleri: dar ekranda tablo yerine kompakt satırlar (yapı ve JS kancaları aynı) */
@media (max-width: 560px) {
  .items-table thead { display: none; }
  .items-table, .items-table tbody, .items-table tfoot { display: block; width: 100%; }
  .items-table tr { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "chk name total" "chk stat total"; column-gap: 10px; row-gap: 4px; align-items: center; padding: 12px var(--s-4); border-bottom: 1px solid var(--line); }
  .items-table td { display: block; padding: 0; border: 0; width: auto !important; }
  .items-table tbody td:nth-child(1) { grid-area: chk; }
  .items-table tbody td:nth-child(2) { grid-area: name; }
  .items-table tbody td:nth-child(3) { grid-area: stat; }
  .items-table tbody td:nth-child(4) { grid-area: total; }
  .items-table tfoot tr { grid-template-areas: "chk name total"; grid-template-columns: 34px minmax(0, 1fr) auto; border-bottom: 0; }
  .items-table tfoot td:nth-child(2) { grid-area: name; }
  .items-table tfoot td:nth-child(3) { grid-area: total; }
}
