/* Purchase line items: keep Qty / Amount headers aligned with the inputs */
.pos-purchase-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem 8.5rem 2.25rem;
  align-items: center;
  column-gap: 0.5rem;
  box-sizing: border-box;
}
.pos-purchase-line > input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  box-sizing: border-box;
}
.pos-purchase-line > button {
  width: 2.25rem;
  min-width: 2.25rem;
  padding-left: 0;
  padding-right: 0;
  justify-self: center;
}

/* Keep the main menu fully visible at all desktop sizes — never scroll with the page */

@media (min-width: 1024px) {
  .min-h-screen.lg\:grid {
    grid-template-columns: max-content 1fr !important;
    align-items: start !important;
  }

  /*
    Critical: without a real height utility + align-self:start, the grid row
    stretches the aside to the full page height. Sticky then does nothing and
    the menu scrolls away with the content.
  */
  aside.lg\:sticky {
    position: sticky !important;
    top: 0 !important;
    align-self: start !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    width: max-content !important;
    max-width: min(24rem, 42vw);
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  aside.lg\:sticky > nav {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    justify-content: stretch !important;
    gap: clamp(0.04rem, 0.35dvh, 0.24rem) !important;
  }

  aside.lg\:sticky > nav a {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    font-size: clamp(0.85rem, 2.15dvh, 1.8rem) !important;
    line-height: 1.15 !important;
    padding-top: clamp(0.12rem, 0.65dvh, 0.5rem) !important;
    padding-bottom: clamp(0.12rem, 0.65dvh, 0.5rem) !important;
    gap: clamp(0.35rem, 0.9dvh, 0.7rem) !important;
  }

  aside.lg\:sticky > nav a svg {
    width: clamp(1rem, 2.6dvh, 2rem) !important;
    height: clamp(1rem, 2.6dvh, 2rem) !important;
    flex-shrink: 0 !important;
  }

  /* Brand row — shrink on short screens so nav keeps the space */
  aside.lg\:sticky > div.flex.shrink-0 {
    flex: 0 0 auto !important;
    padding-top: clamp(0.25rem, 1.1dvh, 0.85rem) !important;
    padding-bottom: clamp(0.25rem, 1.1dvh, 0.85rem) !important;
  }

  aside.lg\:sticky > div.flex.shrink-0 > p {
    font-size: clamp(0.9rem, 2.35dvh, 1.9rem) !important;
  }

  aside.lg\:sticky > div.flex.shrink-0 img,
  aside.lg\:sticky > div.flex.shrink-0 > div.flex {
    width: clamp(1.75rem, 4dvh, 3rem) !important;
    height: clamp(1.75rem, 4dvh, 3rem) !important;
  }

  /* Language + user footer */
  aside.lg\:sticky > div.hidden {
    flex: 0 0 auto !important;
  }

  aside.lg\:sticky button {
    font-size: clamp(0.7rem, 1.45dvh, 1.15rem) !important;
  }

  aside.lg\:sticky > div.hidden p {
    font-size: clamp(0.8rem, 1.9dvh, 1.64rem) !important;
  }
}

/* Short desktop monitors: keep every item readable and on-screen */
@media (min-width: 1024px) and (max-height: 820px) {
  aside.lg\:sticky > nav a {
    font-size: clamp(0.8rem, 1.9dvh, 1.25rem) !important;
    padding-top: clamp(0.08rem, 0.45dvh, 0.28rem) !important;
    padding-bottom: clamp(0.08rem, 0.45dvh, 0.28rem) !important;
  }

  aside.lg\:sticky > nav a svg {
    width: clamp(0.95rem, 2.2dvh, 1.35rem) !important;
    height: clamp(0.95rem, 2.2dvh, 1.35rem) !important;
  }

  aside.lg\:sticky > div.flex.shrink-0 > p {
    font-size: clamp(0.85rem, 2dvh, 1.2rem) !important;
  }

  aside.lg\:sticky > div.flex.shrink-0 img,
  aside.lg\:sticky > div.flex.shrink-0 > div.flex {
    width: clamp(1.5rem, 3.2dvh, 2.25rem) !important;
    height: clamp(1.5rem, 3.2dvh, 2.25rem) !important;
  }
}
