/*
 * GAINVO POS v4.9.181 — Record Sale Checkout UI/UX Refinement
 * UI-only: cart line presentation, checkout hierarchy and responsive clarity.
 * No checkout logic, cart engine, stock, totals, payment or submit behaviour changes.
 */

/* ============================================================
   DESKTOP / INSTALLED PC
   ============================================================ */
@media (min-width:901px){

  /* Give the checkout enough breathing room on wide screens without
     compromising the catalogue on notebook widths. */
  @media (min-width:1440px){
    body.record-sale-desktop-v4988 .pos-shell{
      grid-template-columns:minmax(0,1fr) minmax(470px,510px)!important;
    }
  }

  body.record-sale-desktop-v4988 .pos-cart-card{
    padding:15px!important;
  }

  body.record-sale-desktop-v4988 .pos-cart-head{
    margin-bottom:7px!important;
    padding-bottom:10px!important;
    border-bottom:1px solid var(--line,#e2e8f0)!important;
  }

  body.record-sale-desktop-v4988 .pos-cart-head h2{
    font-size:18px!important;
    line-height:1.15!important;
  }

  /* Cart list becomes a collection of clear item cards instead of
     one compressed four-column table-like row. */
  body.record-sale-desktop-v4988 .pos-cart-items{
    min-height:118px!important;
    max-height:290px!important;
    padding:2px 2px 5px!important;
  }

  body.record-sale-desktop-v4988 .pos-cart-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto auto!important;
    grid-template-areas:
      "copy copy remove"
      "qty total remove"
      "discount discount discount"!important;
    gap:8px 10px!important;
    margin:0 0 8px!important;
    padding:10px 11px!important;
    border:1px solid var(--line,#dfe7ef)!important;
    border-radius:12px!important;
    background:var(--surface,#fff)!important;
    box-shadow:0 2px 8px rgba(22,40,62,.035)!important;
  }

  body.record-sale-desktop-v4988 .pos-cart-item-copy{
    grid-area:copy!important;
    min-width:0!important;
    padding-right:4px!important;
  }

  body.record-sale-desktop-v4988 .pos-cart-item-copy>strong{
    display:block!important;
    font-size:12px!important;
    line-height:1.28!important;
  }

  body.record-sale-desktop-v4988 .pos-cart-item-copy>small{
    margin-top:2px!important;
    font-size:10px!important;
    line-height:1.35!important;
  }

  body.record-sale-desktop-v4988 .pos-cart-item-copy>em{
    margin-top:3px!important;
    font-size:9.5px!important;
    line-height:1.2!important;
  }

  body.record-sale-desktop-v4988 .pos-cart-row>.qty-control{
    grid-area:qty!important;
    width:128px!important;
    max-width:128px!important;
    align-self:center!important;
  }

  body.record-sale-desktop-v4988 .pos-cart-row>[data-cart-line-total]{
    grid-area:total!important;
    align-self:center!important;
    justify-self:end!important;
    min-width:82px!important;
    font-size:13px!important;
    line-height:1.2!important;
    text-align:right!important;
  }

  body.record-sale-desktop-v4988 .pos-cart-row>[data-cart-remove]{
    grid-area:remove!important;
    align-self:start!important;
    justify-self:end!important;
    width:32px!important;
    height:32px!important;
    min-width:32px!important;
    border-radius:9px!important;
  }

  body.record-sale-desktop-v4988 .pos-cart-row>.pos-line-discount{
    grid-area:discount!important;
    margin-top:1px!important;
    border-top:1px solid var(--line,#e6edf3)!important;
    padding-top:7px!important;
  }

  body.record-sale-desktop-v4988 .pos-line-discount>summary{
    min-height:30px!important;
    padding:4px 2px!important;
  }

  /* Checkout flow hierarchy */
  body.record-sale-desktop-v4988 .pos-checkout{
    padding:9px 3px 5px 0!important;
  }

  body.record-sale-desktop-v4988 .pos-checkout-flow{
    gap:9px!important;
  }

  body.record-sale-desktop-v4988 .pos-checkout-card{
    border:1px solid var(--line,#dfe7ef)!important;
    border-radius:13px!important;
    background:var(--surface,#fff)!important;
    box-shadow:0 1px 5px rgba(22,40,62,.025)!important;
  }

  body.record-sale-desktop-v4988 .pos-checkout-card-head strong,
  body.record-sale-desktop-v4988 .pos-adjustments summary strong,
  body.record-sale-desktop-v4988 .pos-more-options summary strong{
    font-size:11.5px!important;
    line-height:1.25!important;
  }

  body.record-sale-desktop-v4988 .pos-checkout-card-head small,
  body.record-sale-desktop-v4988 .pos-adjustments summary small,
  body.record-sale-desktop-v4988 .pos-more-options summary small{
    font-size:9.5px!important;
    line-height:1.35!important;
  }

  body.record-sale-desktop-v4988 .pos-buyer-summary{
    min-height:58px!important;
    padding:11px 12px!important;
  }

  body.record-sale-desktop-v4988 .pos-buyer-summary strong{
    font-size:11.5px!important;
  }

  body.record-sale-desktop-v4988 .pos-buyer-summary small{
    font-size:9.5px!important;
  }

  body.record-sale-desktop-v4988 .pos-totals,
  body.record-sale-desktop-v4988 .pos-payment-section{
    padding:11px 12px!important;
  }

  body.record-sale-desktop-v4988 .pos-totals p{
    font-size:10px!important;
    line-height:1.3!important;
  }

  body.record-sale-desktop-v4988 .pos-totals p.grand{
    margin-top:8px!important;
    padding:9px 10px!important;
    border-radius:10px!important;
  }

  body.record-sale-desktop-v4988 .pos-totals p.grand strong{
    font-size:19px!important;
  }

  body.record-sale-desktop-v4988 .pos-payment label{
    font-size:10.5px!important;
    line-height:1.25!important;
  }

  body.record-sale-desktop-v4988 .pos-payment select,
  body.record-sale-desktop-v4988 .pos-payment input{
    font-size:12px!important;
  }

  body.record-sale-desktop-v4988 .pos-submit-actions{
    margin-top:3px!important;
    padding-top:10px!important;
  }
}

/* ============================================================
   TABLET / MOBILE BROWSER / INSTALLED MOBILE
   ============================================================ */
@media (max-width:900px){

  /* The same DOM becomes a natural two-line cart item on narrow screens. */
  .pos-counter-page-v468 .pos-cart-items{
    padding:2px 1px 5px!important;
  }

  .pos-counter-page-v468 .pos-cart-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-areas:
      "copy remove"
      "qty total"
      "discount discount"!important;
    gap:8px 10px!important;
    margin:0 0 8px!important;
    padding:11px!important;
    border:1px solid var(--line,#dfe7ef)!important;
    border-radius:13px!important;
    background:var(--surface,#fff)!important;
    box-shadow:0 2px 8px rgba(22,40,62,.035)!important;
  }

  .pos-counter-page-v468 .pos-cart-item-copy{
    grid-area:copy!important;
    min-width:0!important;
  }

  .pos-counter-page-v468 .pos-cart-item-copy>strong{
    display:block!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }

  .pos-counter-page-v468 .pos-cart-row>.qty-control{
    grid-area:qty!important;
    width:138px!important;
    max-width:138px!important;
  }

  .pos-counter-page-v468 .pos-cart-row>[data-cart-line-total]{
    grid-area:total!important;
    align-self:center!important;
    justify-self:end!important;
    min-width:74px!important;
    text-align:right!important;
  }

  .pos-counter-page-v468 .pos-cart-row>[data-cart-remove]{
    grid-area:remove!important;
    align-self:start!important;
    justify-self:end!important;
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    border-radius:10px!important;
  }

  .pos-counter-page-v468 .pos-cart-row>.pos-line-discount{
    grid-area:discount!important;
    margin-top:1px!important;
    padding-top:7px!important;
    border-top:1px solid var(--line,#e6edf3)!important;
  }

  .pos-counter-page-v468 .pos-checkout-flow{
    gap:9px!important;
  }

  .pos-counter-page-v468 .pos-checkout-card{
    border:1px solid var(--line,#dfe7ef)!important;
    background:var(--surface,#fff)!important;
    box-shadow:0 1px 5px rgba(22,40,62,.025)!important;
  }

  .pos-counter-page-v468 .pos-buyer-summary{
    padding:12px!important;
  }

  .pos-counter-page-v468 .pos-totals p{
    line-height:1.35!important;
  }

  .pos-counter-page-v468 .pos-totals p.grand{
    border-radius:11px!important;
  }

  .pos-counter-page-v468 .pos-submit-actions{
    border-top:1px solid var(--line,#e3eaf1)!important;
  }
}

@media (max-width:390px){
  .pos-counter-page-v468 .pos-cart-row{
    grid-template-columns:minmax(0,1fr) auto!important;
    gap:7px 8px!important;
    padding:10px!important;
  }

  .pos-counter-page-v468 .pos-cart-row>.qty-control{
    width:126px!important;
    max-width:126px!important;
  }

  .pos-counter-page-v468 .pos-cart-row>[data-cart-line-total]{
    min-width:66px!important;
  }
}

/* Dark mode follows existing design tokens. */
html[data-theme="dark"] .pos-counter-page-v468 .pos-cart-row,
html[data-theme="dark"] .pos-counter-page-v468 .pos-checkout-card{
  background:var(--surface,#101c25)!important;
  border-color:var(--line)!important;
  box-shadow:none!important;
}
