.vm-customer-canvas .vm-catalog-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;

  .vm-catalog-header {
    flex: none;
    padding: 24px var(--vm-customer-gutter) 22px;

    h1 {
      margin-top: 24px;
      font-size: 38px;
      line-height: 1.15;
    }

    > p {
      margin-top: 8px;
      color: rgba(36, 28, 63, 0.6);
      font-size: 18px;
    }
  }

  .vm-catalog-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    // Content and footer share CSS pixels; reserve enough room to reveal the last card.
    padding: 4px var(--vm-customer-gutter) var(--vm-bottom-bar-space);
    scrollbar-width: thin;
  }

  .vm-catalog-group {
    margin-bottom: 32px;

    > header {
      display: flex;
      align-items: center;
      gap: 16px;
      margin-bottom: 16px;

      > div {
        min-width: 0;
      }
      h2 {
        font-size: 30px;
        line-height: 1.2;
        overflow-wrap: anywhere;
      }
      p {
        margin-top: 4px;
        color: rgba(36, 28, 63, 0.6);
        font-size: 18px;
      }
    }
  }

  .vm-catalog-product-icon {
    display: flex;
    flex: 0 0 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    background: var(--vm-customer-soft);
    color: var(--vm-customer-primary);

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    svg {
      width: 28px;
      height: 28px;
    }
  }

  svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .vm-catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .vm-catalog-card {
    display: flex;
    min-width: 0;
    min-height: 188px;
    flex-direction: column;
    gap: 20px;
    padding: 20px 16px 16px;
    border: 1px solid rgba(36, 28, 63, 0.12);
    border-radius: 24px;
    background: #fff;
    transition: border-color 160ms ease, background-color 160ms ease;

    &.is-selected {
      border-color: var(--vm-customer-primary);
      box-shadow: 0 0 0 2px var(--vm-primary-bg);
    }

    &.is-unavailable {
      border-style: dashed;
      background: rgba(36, 28, 63, 0.05);
      .vm-catalog-card-heading {
        color: rgba(36, 28, 63, 0.45);
      }
    }
  }

  .vm-catalog-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;

    h3 {
      min-width: 0;
      margin: 0;
      color: inherit;
      font-size: 24px;
      font-weight: 700;
      line-height: 1.3;
      overflow-wrap: anywhere;
    }
    > strong {
      flex-shrink: 0;
      font-size: 24px;
      line-height: 1.3;
      font-variant-numeric: tabular-nums;
    }
  }

  .vm-catalog-stock {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--vm-customer-ink);
    color: #fff;
    font-size: 18px;
    font-weight: 700;

    svg {
      flex: none;
      width: 24px;
      height: 24px;
    }
  }

  .vm-catalog-quantity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;

    > span {
      color: rgba(36, 28, 63, 0.55);
      font-size: 16px;
      font-weight: 600;
    }
  }
  .is-selected .vm-catalog-quantity > span {
    color: var(--vm-customer-primary);
  }

  .vm-catalog-stepper {
    width: auto;
    height: auto;
    gap: 12px;

    .numeric-stepper-button {
      width: 58px;
      height: 62px;
      border-radius: 18px;
      font-size: 32px;
      font-weight: 700;
      line-height: 1;
      background: var(--vm-customer-primary);
      color: var(--vm-primary-foreground);
    }

    .numeric-stepper-minus:not(.numeric-stepper-button-disabled) {
      border: 2px solid rgba(36, 28, 63, 0.12);
      background: #fff;
      color: var(--vm-customer-ink);
    }
    .numeric-stepper-display {
      width: auto;
      height: auto;
      min-width: 26px;
      max-width: none;
      padding: 0;
      text-align: center;
      font-size: 28px;
      font-variant-numeric: tabular-nums;
    }
  }

  .vm-catalog-empty {
    padding: 48px 16px;
    text-align: center;
    color: rgba(36, 28, 63, 0.6);
    font-size: 20px;
  }
  .vm-catalog-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    border-radius: 16px;
    background: #fff7e6;
    color: #ad4e00;
    font-size: 18px;

    button {
      flex: none;
      padding: 10px 16px;
      border: 1px solid currentColor;
      border-radius: 12px;
      background: #fff;
      color: inherit;
    }
  }

  button {
    touch-action: manipulation;
  }
  button:disabled {
    cursor: default;
    opacity: 0.35;
  }
  button:not(:disabled):active {
    transform: scale(0.97);
  }
}

@container vending-customer (max-width: 620px) {
  .vm-customer-canvas .vm-catalog-screen {
    .vm-catalog-header h1 {
      font-size: 30px;
    }
    .vm-catalog-group > header h2 {
      font-size: 24px;
    }
    .vm-catalog-grid {
      grid-template-columns: minmax(0, 1fr);
    }
    .vm-catalog-warning {
      flex-wrap: wrap;
    }
  }
}
