/* PA i PUNT · TPV de nou encàrrec */
body.tpv-on { overflow: hidden; }
.tpv { position: fixed; inset: 0; z-index: 80; background: #ece7dc; display: flex; flex-direction: column; opacity: 0; transform: translateY(16px); transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.tpv.on { opacity: 1; transform: none; pointer-events: auto; }
.tpv:empty { display: none; }
.tpv-h { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: var(--ink); color: var(--paper); flex: none; }
.tpv-h h2 { margin: 0; font-size: 28px; line-height: 1; font-weight: 400; }
.tpv-h p { margin: 3px 0 0; font-size: 13px; color: var(--mint-2); }
.tpv-x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: none; color: var(--paper); font-size: 18px; flex: none; }

.tpv-b { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr minmax(360px, 420px); grid-template-rows: minmax(0, 1fr); }
.tpv-l { min-height: 0; overflow-y: auto; padding: 16px 18px 30px; -webkit-overflow-scrolling: touch; }
.tpv-r { background: var(--paper); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 16px 18px 0; overflow-y: auto; }

.tpv-days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.tpv-days::-webkit-scrollbar { display: none; }
.tpv-days button { position: relative; flex: none; width: 66px; border: 1.5px solid var(--ink); background: #fff; border-radius: 14px; padding: 8px 4px 7px; display: grid; justify-items: center; gap: 0; min-height: 64px; }
.tpv-days span { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.tpv-days b { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.05; }
.tpv-days i { font-style: normal; font-size: 10px; color: var(--orange-d); font-weight: 700; }
.tpv-days em { position: absolute; top: -7px; right: -6px; background: var(--orange); color: #fff; font-style: normal; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; }
.tpv-days button.on { background: var(--ink); color: var(--paper); }
.tpv-days button.on i { color: var(--mint-2); }
.tpv-sub { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0 10px; }
.tpv-q { flex: 1; min-width: 180px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 16px; background: #fff; }
.tpv-q:focus { outline: none; border-color: var(--ink); }
.tpv-cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.tpv-cats::-webkit-scrollbar { display: none; }
.tpv-cats button { flex: none; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 9px 14px; font-size: 14px; min-height: 40px; }
.tpv-cats button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.tpv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; border: 0; background: #fff; border-radius: 16px; padding: 0 0 10px; text-align: left; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 0 rgba(20, 20, 19, .06); transition: transform .12s, box-shadow .2s; }
.tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e8dfcf; }
.tile-t { font-weight: 700; font-size: 14.5px; line-height: 1.2; padding: 9px 11px 2px; }
.tile-p { font-size: 13px; color: var(--ink-3); padding: 0 11px; font-variant-numeric: tabular-nums; }
.tile-n { position: absolute; top: 8px; right: 8px; min-width: 32px; height: 32px; border-radius: 16px; background: var(--orange); color: #fff; font-weight: 800; display: grid; place-items: center; padding: 0 8px; font-size: 15px; box-shadow: 0 4px 10px -3px rgba(0, 0, 0, .35); }
.tile:active { transform: scale(.97); }
.tile.has { box-shadow: 0 0 0 2.5px var(--orange); }
.tile.off { opacity: .42; }
.tile.off img { filter: grayscale(1); }
.tile.bumped .tile-n { animation: bump .35s cubic-bezier(.2, .8, .2, 1.4); }
@keyframes bump { 40% { transform: scale(1.35); } }

.tpv-cust { display: grid; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.fld { display: grid; gap: 5px; font-size: 13px; font-weight: 700; }
.fld small { font-weight: 400; color: var(--ink-3); }
.fld input, .fld textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 13px; background: #fff; font-size: 16px; font-weight: 400; }
.fld input:focus, .fld textarea:focus { outline: none; border-color: var(--ink); }
.tpv-r > .fld { margin-top: 12px; }
.ch-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; font-weight: 700; }
.ch-pick > span { width: 100%; }
.ch-pick small { font-weight: 400; color: var(--ink-3); }
.ch-pick button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 16px; font-weight: 700; font-size: 14px; min-height: 44px; }
.ch-pick button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-static { background: var(--mint); color: var(--sage-d); border-radius: 999px; padding: 8px 14px; font-weight: 800; }

.tpv-lines { flex: 1; padding: 6px 0; }
.tpv-empty { color: var(--ink-3); text-align: center; padding: 28px 10px; font-size: 15px; }
.tg { margin-top: 10px; }
.tg-h { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1.5px solid var(--ink); }
.tg-h b { font-family: var(--serif); font-weight: 400; font-size: 21px; }
.tg-h span { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.tl { display: grid; grid-template-columns: 1fr auto 70px; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tl-n b { display: block; font-size: 15px; line-height: 1.2; }
.tl-n small { display: block; color: var(--orange-d); font-size: 12px; font-weight: 600; }
.tl-sl { margin-top: 4px; border: 1px dashed var(--crust); background: none; border-radius: 8px; padding: 4px 8px; font-size: 12.5px; color: var(--ink-2); }
.tl-sl.on { border-style: solid; background: var(--mint); border-color: var(--mint-2); color: var(--sage-d); font-weight: 700; }
.tl-sl small { color: var(--ink-3); font-weight: 400; }
.tl .qty { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; }
.tl .qty button { border: 0; background: none; width: 40px; height: 40px; font-size: 20px; }
.tl .qty output { min-width: 22px; text-align: center; font-weight: 800; }
.tl-p { text-align: right; font-variant-numeric: tabular-nums; }
.tpv .err { color: #b3261e; font-size: 14px; margin: 8px 0 0; min-height: 1.2em; }
.tpv-f { position: sticky; bottom: 0; background: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); margin-top: 8px; }
.tpv-f span { display: block; font-size: 12.5px; color: var(--ink-3); }
.tpv-f b { font-size: 26px; font-variant-numeric: tabular-nums; }
.tpv-f .btn { padding: 17px 26px; font-size: 16px; }
.tpv-bar { display: none; }

@media (max-width: 899px) {
  .tpv-b { grid-template-columns: 1fr; position: relative; }
  .tpv-l { padding-bottom: 100px; }
  .tpv-r { position: absolute; inset: 0 0 72px 0; border-left: 0; transform: translateY(102%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); z-index: 2; }
  .sheet-on .tpv-r { transform: none; }
  .tpv-r .tpv-f { padding-bottom: 14px; }
  .tpv-bar { display: flex; position: absolute; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 3; justify-content: space-between; align-items: center; gap: 10px; border: 0; border-radius: 16px; background: var(--ink); color: var(--paper); padding: 0 18px; height: 56px; font-size: 15px; box-shadow: var(--shadow); }
  .tpv-bar b { font-size: 17px; }
  .tpv-bar span:last-child { font-weight: 700; color: var(--mint-2); }
  .tpv-grid { grid-template-columns: repeat(2, 1fr); }
  .tpv-h h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .tpv, .tpv-r { transition: none; } }
