.pos-mode {
    min-height: 100dvh;
    background: #f3f6fa;
    color: var(--mx-text);
}

.pos-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 4.4rem;
    padding: .65rem clamp(.8rem, 2.5vw, 2rem);
    background: white;
    border-bottom: 1px solid #dce4ee;
}

.pos-identity {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding-right: 1rem;
    border-right: 1px solid #dce4ee;
    color: var(--mx-brand-dark);
    font-weight: 800;
    white-space: nowrap;
}

.pos-mark {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: .6rem;
    background: var(--mx-brand-dark);
    color: #f8d676;
}

.pos-store { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.pos-store label, .pos-customer label, .pos-payment legend { color: #475569; font-size: .84rem; font-weight: 700; }
.pos-store select { min-width: 0; max-width: 18rem; }
.pos-exit { flex-shrink: 0; }
.pos-operator { margin-left: auto; color: #475569; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pos-content { max-width: 100rem; margin: auto; padding: clamp(.8rem, 2.5vw, 2rem); }
.pos-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.35rem; align-items: start; }
.pos-catalog { min-width: 0; }
.pos-title { margin: 0 0 .85rem; font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 800; letter-spacing: -.04em; }

.pos-search { display: flex; gap: .5rem; margin-bottom: .85rem; }
.pos-search input { min-width: 0; }
.pos-search input, .pos-search button, .pos-category, .pos-add { min-height: 2.75rem; }
.pos-category-list { display: flex; gap: .5rem; overflow-x: auto; padding: .2rem .2rem .65rem; margin: 0 -.2rem .6rem; }
.pos-category {
    flex: 0 0 auto;
    padding: .4rem .9rem;
    color: #334155;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: .6rem;
    font-size: .87rem;
    font-weight: 650;
}
.pos-category:hover { border-color: var(--mx-brand); }
.pos-category[aria-pressed="true"] { background: #e5edf9; border-color: #7693bf; color: var(--mx-brand-dark); }

.pos-results-header { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin: .4rem 0 .65rem; }
.pos-results-header h2 { margin: 0; font-size: 1.1rem; font-weight: 750; }
.pos-results-header span { color: #475569; font-size: .86rem; }
.pos-product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.pos-product {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: white;
    border: 1px solid #dce4ee;
    border-radius: .85rem;
    box-shadow: var(--mx-shadow-sm);
}
.pos-product-image {
    position: relative;
    display: grid;
    place-items: center;
    background: #edf2f8;
    aspect-ratio: 1.75;
    color: #64748b;
    font-size: 1.6rem;
}
.pos-product-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #edf2f8;
}
.pos-product-body { display: flex; flex-direction: column; gap: .28rem; flex: 1; padding: .65rem; }
.pos-product-meta { color: #475569; font-size: .75rem; overflow-wrap: anywhere; }
.pos-product h3 { font-size: .93rem; font-weight: 750; line-height: 1.25; margin: 0 0 .4rem; overflow-wrap: anywhere; }
.pos-product-action { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .35rem; margin-top: auto; }
.pos-product-action strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pos-add { min-width: 2.75rem; }
.pos-empty { color: #475569; background: white; border: 1px dashed #cbd5e1; border-radius: .75rem; padding: 1.25rem; text-align: center; }
.pos-pagination { display: flex; justify-content: center; align-items: center; gap: .7rem; margin: 1rem 0; }

.pos-cart { --bs-offcanvas-width: min(100vw, 29rem); background: white; }
.pos-transaction { display: flex; flex-direction: column; height: 100%; min-height: 0; background: #fff; }
.pos-cart-header, .pos-checkout { flex: 0 0 auto; }
.pos-cart-header {
    display: flex; align-items: center; justify-content: space-between; gap: .55rem;
    padding: .75rem 1rem; min-height: 3.5rem; border-bottom: 1px solid #dce4ee;
}
.pos-cart-header h2 { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: 1.15rem; font-weight: 800; }
.pos-cart-header-actions { display: flex; align-items: center; gap: .75rem; }
.pos-cart-header-actions .btn-close { min-width: 2rem; min-height: 2rem; }
.pos-cart-body { flex: 1 1 auto; min-height: 4rem; overflow-y: auto; overscroll-behavior: contain; padding: .8rem 1rem; }
.pos-customer label { display: block; margin-bottom: .25rem; }
.pos-customer select { min-height: 2.65rem; }
.pos-empty-cart { margin-top: .9rem; }
.pos-empty-cart i { display: block; margin-bottom: .35rem; font-size: 1.45rem; }
.pos-lines { list-style: none; margin: .55rem 0 0; padding: 0; }
.pos-lines li { padding: .6rem 0; border-bottom: 1px solid #e2e8f0; }
.pos-line-title, .pos-line-detail { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.pos-line-title strong { overflow-wrap: anywhere; }
.pos-line-detail { margin-top: .3rem; }
.pos-stepper { display: inline-flex; align-items: center; gap: .3rem; background: #f1f5f9; border-radius: .65rem; }
.pos-stepper .btn { min-width: 2.75rem; min-height: 2.75rem; font-size: 1.12rem; }
.pos-stepper span { min-width: 1.75rem; text-align: center; font-weight: 700; }
.pos-checkout { padding: .8rem 1rem max(.85rem, env(safe-area-inset-bottom)); border-top: 1px solid #dce4ee; background: #f8fafc; }
.pos-totals { margin: 0 0 .6rem; }
.pos-totals div { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .22rem; }
.pos-totals dt { color: #475569; font-weight: 600; }
.pos-totals dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; }
.pos-totals .pos-payable { border-top: 1px solid #dce4ee; padding-top: .38rem; margin-top: .45rem; align-items: baseline; }
.pos-payable dd { font-size: clamp(1.45rem, 4vw, 1.85rem); color: var(--mx-brand-dark); overflow-wrap: anywhere; }
.pos-payment legend { margin: 0 0 .25rem; }
.pos-payment fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.pos-payment-methods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; }
.pos-payment-methods .btn { padding: .35rem .2rem; font-size: .82rem; display: grid; place-items: center; min-height: 2.75rem; }
.pos-payment-methods .btn-check:checked + .btn { background: #e5edf9; border-color: #7693bf; color: var(--mx-brand-dark); font-weight: 750; }
.pos-checkout-button { margin-top: .65rem; min-height: 2.9rem; font-weight: 750; }
.pos-cart-launcher {
    position: fixed; inset: auto .8rem max(.8rem, env(safe-area-inset-bottom)); z-index: 1030;
    min-height: 3.1rem; display: flex; align-items: center; gap: .55rem;
    padding-inline: 1rem; box-shadow: 0 6px 22px #0f172a44; border-radius: .8rem;
}
.pos-cart-launcher strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.pos-cart-count { background: #f8d676; color: #172032; font-weight: 800; border-radius: 1rem; padding: .05rem .5rem; }

@media (min-width: 620px) {
    .pos-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pos-cart-launcher { left: auto; min-width: 15rem; }
}

@media (min-width: 992px) {
    .pos-workspace { grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem); }
    .pos-cart { position: sticky; top: 5.3rem; }
    .pos-transaction { height: calc(100dvh - 6.5rem); min-height: 29rem; border: 1px solid #dce4ee; border-radius: .85rem; overflow: hidden; }
}

@media (min-width: 1250px) {
    .pos-product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .pos-content { padding-bottom: 5rem; }
    .pos-cart { max-height: 100dvh; overflow-y: auto; }
}

@media (max-width: 680px) {
    .pos-header { flex-wrap: wrap; gap: .4rem .65rem; }
    .pos-identity { order: -1; border: 0; margin-right: auto; padding: 0; }
    .pos-store { flex-basis: 100%; }
    .pos-store select { max-width: none; }
    .pos-operator { display: none; }
}

@media (max-height: 580px) and (max-width: 991.98px) {
    .pos-transaction { height: auto; }
    .pos-cart-body { flex: initial; overflow: visible; }
}

@media (max-height: 580px) and (min-width: 992px) {
    .pos-cart { position: static; }
    .pos-transaction { height: auto; }
}
