/* Billing: a counter-led page. Hero headline sits over a wide working counter (products | receipt | payment);
   then a three-column "calculator vs Bisro" ledger, the camera spotlight, and a branching "one Save" diagram. */

/* hero head: headline left, intro right, both above the counter */
.bl-hero { padding-top: 124px; padding-bottom: clamp(50px, 8vh, 90px) }
.bl-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 5vw; align-items: end; margin-bottom: 40px }
.bl-hero .h-xl { font-size: clamp(38px, 4.6vw, 68px); max-width: 14ch }
.bl-intro .lead { margin-top: 0 }

/* the counter */
.ctr { position: relative; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 50px 90px -60px rgba(31,35,40,.5); overflow: hidden }
.ctr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 22px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px }
.ctr-bar .tag { margin: 0; background: var(--sky); color: var(--ink) } .ctr-bar .eg { margin-left: auto; color: #A3ACB7 }
.ctr-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .95fr) minmax(0, .9fr) }
.ctr-grid > div { padding: 22px }
.ctr-l { display: block; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px }

.prods { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
.prod { all: unset; box-sizing: border-box; position: relative; display: grid; gap: 2px; width: 100%; padding: 14px 14px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: #F7FBFF; cursor: pointer; transition: border-color .15s, background .15s, transform .1s }
.prod:hover { border-color: #9CCBF5; background: #fff } .prod:active { transform: scale(.98) }
.prod:focus-visible { outline: 3px solid var(--sky-dark); outline-offset: 2px }
.prod b { font-size: 15.5px; color: var(--ink) } .prod span { font-weight: 700; font-size: 17px; color: var(--ink) } .prod small { font-size: 12.5px; color: var(--faint) }
.prod-q { position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; background: var(--ink); color: #fff; font: 700 13px/24px var(--font); text-align: center; font-style: normal }

.shelf-sum { display: none }
/* the receipt */
.ctr-bill { background: #FBFAF6; border-left: 1px dashed #D9D2C3; border-right: 1px dashed #D9D2C3; display: flex; flex-direction: column }
.lines { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 170px }
.lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px dotted #D9D2C3 }
.lines li.empty { display: block; color: var(--faint); border: 0; padding-top: 30px; text-align: center }
.lines b { display: block; font-size: 15px } .lines small { color: var(--faint); font-size: 13px } .lines span.tnum { font-weight: 700 }
.rm { all: unset; cursor: pointer; width: 26px; height: 26px; border-radius: 50%; text-align: center; line-height: 25px; font-weight: 700; color: var(--red); background: #FDECEC }
.rm:focus-visible { outline: 2px solid var(--sky-dark) }
.tot { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; margin-top: 8px; border-top: 2px solid var(--ink) }
.tot span { font-weight: 700 } .tot b { font: 800 34px/1 var(--font); letter-spacing: -0.02em }

/* payment */
.ctr-pay { display: flex; flex-direction: column; gap: 14px }
.pay-seg { width: 100% } .pay-seg button { flex: 1; text-align: center }
.pay-p { display: grid; gap: 10px } .pay-p[hidden] { display: none }
.pay-p .ctr-l { margin: 0 }
.cash-in { display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); border-radius: 10px; padding: 0 14px; background: #fff }
.cash-in:focus-within { border-color: var(--sky-dark) }
.cash-in span { font-weight: 700; color: var(--muted) }
.cash-in input { all: unset; width: 100%; padding: 12px 0; font: 800 24px/1 var(--font); color: var(--ink) }
.chips { display: flex; flex-wrap: wrap; gap: 8px } .chips .kb { padding: 9px 12px; font-size: 14px }
.change { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: 10px; background: #E6F7F1; color: #0B6B50; font-weight: 700 }
.change[hidden] { display: none } .change b { font-size: 24px } .change.short { background: #FDECEC; color: var(--red) }
.upi-box { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1.5px solid var(--border); border-radius: 10px }
.upi-box svg { width: 96px; height: 96px; flex: none }
.upi-box b { display: block; font: 800 24px/1.1 var(--font) } .upi-box span { display: block; font-size: 14px; color: var(--muted) } .upi-box small { display: block; margin-top: 6px; font-size: 12px; color: var(--faint) }
.kh-line { margin: 0; padding: 12px 14px; border-radius: 10px; background: #FDF2F2; color: var(--ink); font-weight: 600 }
.save { margin-top: auto; width: 100%; padding: 15px } .save:disabled { opacity: .45 }

/* after Save */
.ctr-done { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; background: #E6F7F1; border-top: 1px solid #BFE8D8 }
.ctr-done[hidden] { display: none }
.ctr-done b { display: block; font-size: 18px; color: #0B6B50 } .ctr-done ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; color: #2F3640; font-size: 15px }
.is-done .ctr-grid { opacity: .55; pointer-events: none }

/* rush ledger */
.br-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5vw; align-items: end; margin-bottom: 34px }
.br-head .lead { margin: 0 }
.br-table { width: 100%; border-collapse: collapse; text-align: left }
.br-table thead th { padding: 10px 28px 10px 0; border-bottom: 2px solid var(--ink); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint) }
.br-table tbody th { width: 200px; padding: 18px 28px 18px 0; font-size: 18px; vertical-align: top }
.br-table td { padding: 18px 28px 18px 0; vertical-align: top; width: 40% }
.br-table tbody tr { border-bottom: 1px solid var(--border) }
.br-table td { padding-left: 18px; background: no-repeat 0 21px / 3px calc(100% - 39px) }
.br-table td.br-was { color: var(--muted); background-image: linear-gradient(#F3C7C7, #F3C7C7) }
.br-table td.br-now { color: var(--ink); font-weight: 500; background-image: linear-gradient(var(--teal), var(--teal)) }

/* camera spotlight */
.bl-scan { background: linear-gradient(180deg, var(--bg), #E8F5FE 25%, #E8F5FE 75%, var(--bg)) }
.bs-in { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 6vw; align-items: center; padding-top: clamp(50px, 8vh, 90px); padding-bottom: clamp(50px, 8vh, 90px) }
.bs-vis { display: grid; place-items: center }
.cam { width: min(320px, 80vw) }
.cam-view { position: relative; flex: 1; background: radial-gradient(120% 80% at 50% 40%, #3A3F45, #15181C); display: grid; place-items: center; overflow: hidden }
.cam-pack { width: 74%; padding: 18px 16px 14px; border-radius: 10px; background: #F4E3C3; color: #5A3B12; text-align: center; transform: rotate(-4deg); box-shadow: 0 30px 40px -20px rgba(0,0,0,.6) }
.cam-pack b { display: block; font-size: 15px; letter-spacing: .06em; margin-bottom: 10px }
.cam-bars { display: block; width: 100%; height: 64px; background: #fff; padding: 6px 8px 0 }
.cam-pack span { display: block; background: #fff; font-size: 12px; color: #111; padding: 2px 0 4px; letter-spacing: .12em }
.cam-frame { position: absolute; inset: 34% 9% 34%; border: 3px solid transparent;
  background: linear-gradient(#fff, #fff) top left / 26px 3px no-repeat, linear-gradient(#fff, #fff) top left / 3px 26px no-repeat,
              linear-gradient(#fff, #fff) top right / 26px 3px no-repeat, linear-gradient(#fff, #fff) top right / 3px 26px no-repeat,
              linear-gradient(#fff, #fff) bottom left / 26px 3px no-repeat, linear-gradient(#fff, #fff) bottom left / 3px 26px no-repeat,
              linear-gradient(#fff, #fff) bottom right / 26px 3px no-repeat, linear-gradient(#fff, #fff) bottom right / 3px 26px no-repeat }
.cam-frame i { position: absolute; left: 4%; right: 4%; top: 50%; height: 2px; background: #FF4D4D; box-shadow: 0 0 12px 2px rgba(255,77,77,.7); animation: cam-scan 2.4s ease-in-out infinite }
@keyframes cam-scan { 0%, 100% { top: 12% } 50% { top: 88% } }
.cam-hint { position: absolute; bottom: 18px; left: 0; right: 0; margin: 0; text-align: center; color: #fff; font-size: 13px; opacity: .85 }
.cam-toast { display: flex; gap: 12px; align-items: center; padding: 14px 16px 22px; background: #fff }
.cam-ok { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--teal) var(--check) center / 0 0; position: relative }
.cam-ok::after { content: ""; position: absolute; inset: 9px; background: #fff; -webkit-mask: var(--check) center / contain no-repeat; mask: var(--check) center / contain no-repeat }
.cam-toast b { display: block; font-size: 15px } .cam-toast small { color: var(--faint); font-size: 13px }
.bs-list { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; max-width: 520px }
.bs-list li { padding: 14px 0 0; border-top: 1px solid #C9E4F8; color: var(--muted) } .bs-list b { color: var(--ink) }

/* one Save, branching */
.ba-chain { --P: clamp(200px, 18vw, 260px); --B: 140px; list-style: none; margin: 44px 0 0; padding: 0 0 0 var(--P); position: relative; display: grid; gap: 0;
  background: linear-gradient(#9CCBF5, #9CCBF5) no-repeat calc(var(--B)) 50% / calc((var(--P) - var(--B)) / 2) 2px }
.ba-chain::before { content: "Save bill"; position: absolute; left: 0; top: 50%; translate: 0 -50%; width: var(--B); box-sizing: border-box; text-align: center; padding: 16px 0; border-radius: 12px; background: var(--teal); color: #00281D; font: 800 19px/1 var(--font); box-shadow: 0 20px 40px -24px rgba(0,120,90,.7) }
.ba-chain::after { content: ""; position: absolute; left: calc(var(--B) + (var(--P) - var(--B)) / 2); top: 38px; bottom: 38px; border-left: 2px solid #9CCBF5 }
.ba-chain li { position: relative; display: grid; grid-template-columns: 34px minmax(0, 260px) minmax(0, 1fr) auto; gap: 18px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--border) }
.ba-chain li::before { content: ""; position: absolute; left: calc(-1 * (var(--P) - var(--B)) / 2); width: calc((var(--P) - var(--B)) / 2 - 8px); top: 50%; border-top: 2px solid #9CCBF5 }
.ba-k { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--sky-light); color: var(--link); font-weight: 800; font-size: 14px }
.ba-chain b { font-size: 19px } .ba-chain p { margin: 0; color: var(--muted) }
.ba-chain a { color: var(--link); font-weight: 700; text-decoration: none; white-space: nowrap } .ba-chain a:hover { text-decoration: underline }

@media (max-width: 1100px) {
  .ctr-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) } .ctr-shelf { grid-column: 1 / -1; border-bottom: 1px solid var(--border) }
  .ctr-bill { border-left: 0 }
}
@media (max-width: 980px) {
  .bl-hero { padding-top: 104px } .bl-head { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 26px }
  .ctr-grid { grid-template-columns: minmax(0, 1fr) } .ctr-grid > div { padding: 16px } .ctr-bill { border-right: 0; border-top: 1px dashed #D9D2C3; border-bottom: 1px dashed #D9D2C3 }
  .shelf-sum:not([hidden]) { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 13px 16px; border-radius: 10px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 600 }
  .shelf-sum b { color: #7DD3FC }
  .prods { gap: 8px } .prod { padding: 11px 12px 10px } .prod b { font-size: 14.5px }
  .ctr-bar { padding: 12px 16px } .ctr-bar .eg { margin-left: 0 } .lines { min-height: 90px }
  .br-head { grid-template-columns: minmax(0, 1fr); gap: 12px } .br-table thead { display: none }
  .br-table tr, .br-table tbody th, .br-table td { display: block; width: auto; padding: 0 } .br-table tbody tr { padding: 16px 0 } .br-table tbody th { margin-bottom: 8px } .br-table td { margin-top: 6px; padding-left: 16px; background-position: 0 3px; background-size: 3px calc(100% - 6px) }
  .bs-in { grid-template-columns: minmax(0, 1fr); gap: 28px } .cam { aspect-ratio: auto; height: 470px }
  .ba-chain { padding-left: 0; padding-top: 70px; background: none } .ba-chain::before { top: 0; translate: none } .ba-chain::after { display: none }
  .ba-chain li { grid-template-columns: 34px minmax(0, 1fr); gap: 4px 14px } .ba-chain li::before { display: none }
  .ba-chain p, .ba-chain a { grid-column: 2 }
}
@media (prefers-reduced-motion: reduce) { .prod { transition: none } .cam-frame i { animation: none; top: 50% } }
